Skip to content

Commit

Permalink
Add config for downloading geo db
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <[email protected]>
  • Loading branch information
yilunzhang committed Oct 17, 2020
1 parent 086809e commit c475a5e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ func (c *TunaSessionClient) Listen(addrsRe *nkn.StringArray) error {
ReverseServiceName: c.config.TunaServiceName,
ReverseSubscriptionPrefix: c.config.TunaSubscriptionPrefix,
ReverseIPFilter: *c.config.TunaIPFilter,
DownloadGeoDB: c.config.TunaDownloadGeoDB,
GeoDBPath: c.config.TunaGeoDBPath,
DialTimeout: int32(dialTimeout),
}

Expand Down
4 changes: 4 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type Config struct {
TunaServiceName string
TunaSubscriptionPrefix string
TunaIPFilter *geo.IPFilter
TunaDownloadGeoDB bool
TunaGeoDBPath string
SessionConfig *ncp.Config
}

Expand All @@ -26,6 +28,8 @@ var defaultConfig = Config{
TunaServiceName: tuna.DefaultReverseServiceName,
TunaSubscriptionPrefix: tuna.DefaultSubscriptionPrefix,
TunaIPFilter: nil,
TunaDownloadGeoDB: false,
TunaGeoDBPath: "",
SessionConfig: nil,
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/nknorg/ncp-go v1.0.3
github.com/nknorg/nkn-sdk-go v1.3.3
github.com/nknorg/nkn/v2 v2.0.6
github.com/nknorg/tuna v0.0.0-20201017002434-416a41ed7b56
github.com/nknorg/tuna v0.0.0-20201017005948-d500a3d9970a
github.com/patrickmn/go-cache v2.1.0+incompatible
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ github.com/nknorg/nnet v0.0.0-20200521002812-357d1b11179f h1:JvDKr6D9LdnsdScND+8
github.com/nknorg/nnet v0.0.0-20200521002812-357d1b11179f/go.mod h1:4DHEQEMhlRGIKGSyhATdjeusdqaHafDatadtpeHBpvI=
github.com/nknorg/portmapper v0.0.0-20200114081049-1c03cdccc283 h1:uS3/DvxCbi0zZau66ggQAgEjyGmql2mj77UQFgumq1I=
github.com/nknorg/portmapper v0.0.0-20200114081049-1c03cdccc283/go.mod h1:dL4PQJ4670oTO6LqvkjrBQEkD+iMiOYjlKRBBw55Csg=
github.com/nknorg/tuna v0.0.0-20201017002434-416a41ed7b56 h1:WeWh2H1Lj5sEC0VHVZ8SaP5AqYYDO3YQqxX4mRkhvhU=
github.com/nknorg/tuna v0.0.0-20201017002434-416a41ed7b56/go.mod h1:t2GI4ZY5NSKEGSxIjIF4t72Tk/4jKBXDPdm2yjE4s+Y=
github.com/nknorg/tuna v0.0.0-20201017005948-d500a3d9970a h1:Ax7jxjvld67qozJXk4g1gPbGVvq9s14FzOi0OtmOL6Q=
github.com/nknorg/tuna v0.0.0-20201017005948-d500a3d9970a/go.mod h1:t2GI4ZY5NSKEGSxIjIF4t72Tk/4jKBXDPdm2yjE4s+Y=
github.com/nrdcg/auroradns v1.0.1/go.mod h1:y4pc0i9QXYlFCWrhWrUSIETnZgrf4KuwjDIWmmXo3JI=
github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ=
github.com/nrdcg/goinwx v0.7.0/go.mod h1:4tKJOCi/1lTxuw9/yB2Ez0aojwtUCSkckjc22eALpqE=
Expand Down

0 comments on commit c475a5e

Please sign in to comment.