diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..3d3af470 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,32 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug run go", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/main.go", + "cwd": "${workspaceFolder}", + "env": { + "GOROOT":"C:/Go", + }, + "args": [ + ] + }, + { + "name": "Debug run example Server", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/examples/program/server/main.go", + }, + { + "name": "Debug run example Client", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/examples/program/client/main.go", + }, + ] +} diff --git a/app/cache/memory/memory.go b/app/cache/memory/memory.go index 02132ba3..f960c05e 100644 --- a/app/cache/memory/memory.go +++ b/app/cache/memory/memory.go @@ -49,6 +49,7 @@ func (m *memoryCache) String() string { return "memory" } +//NewCache return cache func NewCache(opts ...cache.Option) cache.Cache { return &memoryCache{ values: make(map[string]interface{}), diff --git a/app/client/backoff.go b/app/client/backoff.go index cb285593..3186be76 100644 --- a/app/client/backoff.go +++ b/app/client/backoff.go @@ -7,6 +7,7 @@ import ( "github.com/gonitro/nitro/util/backoff" ) +//BackoffFunc for retry type BackoffFunc func(ctx context.Context, req Request, attempts int) (time.Duration, error) func exponentialBackoff(ctx context.Context, req Request, attempts int) (time.Duration, error) { diff --git a/cspell.json b/cspell.json new file mode 100644 index 00000000..cb398a93 --- /dev/null +++ b/cspell.json @@ -0,0 +1,8 @@ +{ + "version": "0.1", + "words": [ + "pgrpc", + "urfave", + "gonitro" + ] +} \ No newline at end of file diff --git a/util/buf/buf.go b/util/buf/buf.go index ebad4794..076d0b50 100644 --- a/util/buf/buf.go +++ b/util/buf/buf.go @@ -42,6 +42,7 @@ func (b *buffer) Close() error { return nil } +//New return a buffer pointer func New(b *bytes.Buffer) *buffer { if b == nil { b = bytes.NewBuffer(nil) @@ -49,6 +50,7 @@ func New(b *bytes.Buffer) *buffer { return &buffer{b} } +//NewPool return a pool pointer func NewPool() *pool { return &pool{ p: sync.Pool{