Skip to content

Commit

Permalink
feat: refine structure
Browse files Browse the repository at this point in the history
  • Loading branch information
alomerry committed Mar 18, 2024
1 parent 8c38ebc commit 89f8b90
Show file tree
Hide file tree
Showing 43 changed files with 11 additions and 160 deletions.
18 changes: 0 additions & 18 deletions .githooks/install-git-hooks.sh

This file was deleted.

23 changes: 0 additions & 23 deletions .githooks/pre-push

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ go-tools contains several tools

## Usage

- [DNS](./dns/README.md)
- [DNS](modules/dns/README.md)
- [pusher](./pusher/README.md)
- [sgs delay](./sgs/README.md)
- [copier](./copier/README.md)
- [copier](modules/copier/README.md)
- algorithm

## Copier
Expand Down
16 changes: 0 additions & 16 deletions cmd/cmd.go

This file was deleted.

24 changes: 0 additions & 24 deletions cmd/dns.go

This file was deleted.

31 changes: 0 additions & 31 deletions cmd/pusher.go

This file was deleted.

37 changes: 0 additions & 37 deletions cmd/sgs.go

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions dns/client.go → modules/dns/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package dns

import (
"fmt"
dnsImpl "github.com/alomerry/go-tools/dns/impl"
"github.com/alomerry/go-tools/dns/utils"
impl2 "github.com/alomerry/go-tools/modules/dns/impl"
"github.com/alomerry/go-tools/modules/dns/utils"
"github.com/spf13/viper"
"os"
)
Expand Down Expand Up @@ -60,15 +60,15 @@ func (c *client) SetDomainA() {
// TODO 抽出循环中
switch impl {
case IMPL_CF:
cf := &dnsImpl.Cloudflare{
cf := &impl2.Cloudflare{
Secret: os.Getenv(CF_SK),
ZoneId: os.Getenv(CF_ZONE),
Domains: viper.GetStringSlice("domains"),
NewAddr: utils.GetIpv4AddrFromUrl(),
}
cf.UpsertDomainRecords()
case IMPL_ALI:
ali := &dnsImpl.Alidns{
ali := &impl2.Alidns{
AK: os.Getenv(ALI_AK),
SK: os.Getenv(ALI_SK),
Domains: viper.GetStringSlice("domains"),
Expand Down
2 changes: 1 addition & 1 deletion dns/impl/alidns.go → modules/dns/impl/alidns.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"crypto/sha256"
"encoding/base64"
"fmt"
"github.com/alomerry/go-tools/dns/internal"
"github.com/alomerry/go-tools/modules/dns/internal"
"hash"
"io"
"log"
Expand Down
2 changes: 1 addition & 1 deletion dns/impl/cloudflare.go → modules/dns/impl/cloudflare.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/alomerry/go-tools/dns/internal"
"github.com/alomerry/go-tools/modules/dns/internal"
"log"
"net/http"
)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion dns/utils/utils.go → modules/dns/utils/utils.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package utils

import (
"github.com/alomerry/go-tools/dns/internal"
"github.com/alomerry/go-tools/modules/dns/internal"
"io"
"log"
"net/http"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"
"sync"

"github.com/alomerry/go-tools/sgs/tools"
"github.com/alomerry/go-tools/sgs/utils"
"github.com/alomerry/go-tools/modules/sgs/tools"
"github.com/alomerry/go-tools/modules/sgs/utils"
"github.com/emirpasic/gods/stacks"
"github.com/emirpasic/gods/stacks/arraystack"
"github.com/spf13/cast"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 89f8b90

Please sign in to comment.