From 48827f42d3d0717bae64671368c803019c7b591d Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Wed, 23 Jun 2021 16:29:46 +0300 Subject: [PATCH] [#643] pkg: Sync method names and commentaries to them Signed-off-by: Pavel Karpy --- cmd/neofs-node/reputation/intermediate/storage.go | 2 +- pkg/innerring/processors/alphabet/processor.go | 2 +- pkg/innerring/processors/audit/processor.go | 6 +++--- pkg/innerring/processors/governance/processor.go | 6 +++--- pkg/local_object_storage/blobovnicza/blobovnicza.go | 2 +- pkg/local_object_storage/blobovnicza/get_range.go | 4 ++-- pkg/local_object_storage/blobstor/get_small.go | 2 +- pkg/local_object_storage/blobstor/info.go | 2 +- pkg/local_object_storage/engine/range.go | 2 +- pkg/local_object_storage/metabase/movable.go | 2 +- pkg/local_object_storage/shard/move.go | 2 +- pkg/local_object_storage/shard/range.go | 2 +- pkg/local_object_storage/shard/shard.go | 2 +- pkg/morph/client/audit/wrapper/result.go | 2 +- pkg/morph/client/balance/wrapper/wrapper.go | 2 +- pkg/morph/client/container/load.go | 2 +- pkg/morph/client/container/wrapper/container.go | 2 +- pkg/morph/client/container/wrapper/wrapper.go | 2 +- pkg/morph/client/netmap/config.go | 4 ++-- pkg/morph/client/netmap/netmap.go | 2 +- pkg/morph/client/netmap/wrapper/snapshot.go | 2 +- pkg/morph/client/reputation/wrapper/get.go | 2 +- pkg/morph/client/reputation/wrapper/wrapper.go | 2 +- pkg/morph/client/static.go | 2 +- pkg/services/audit/taskmanager/manager.go | 4 ++-- pkg/services/container/announcement/load/controller/deps.go | 2 +- pkg/services/object/acl/opts.go | 2 +- pkg/services/object/delete/service.go | 4 ++-- pkg/services/object/search/v2/service.go | 2 +- pkg/services/object_manager/transformer/types.go | 2 +- .../reputation/eigentrust/storage/daughters/calls.go | 2 +- pkg/services/util/response/client_stream.go | 2 +- pkg/util/locode/db/boltdb/calls.go | 2 +- 33 files changed, 41 insertions(+), 41 deletions(-) diff --git a/cmd/neofs-node/reputation/intermediate/storage.go b/cmd/neofs-node/reputation/intermediate/storage.go index 520a7b5d0..2a7fb3d72 100644 --- a/cmd/neofs-node/reputation/intermediate/storage.go +++ b/cmd/neofs-node/reputation/intermediate/storage.go @@ -68,7 +68,7 @@ func (ip *DaughterTrustIteratorProvider) InitAllDaughtersIterator( // InitConsumersIterator returns iterator over all daughters // of the current node(manager) and all their consumers' local // trusts for ctx.Epoch() epoch and ctx.I() iteration. - +// // Returns ErrNoData if there is no trust data for // specified epoch and iteration. func (ip *DaughterTrustIteratorProvider) InitConsumersIterator( diff --git a/pkg/innerring/processors/alphabet/processor.go b/pkg/innerring/processors/alphabet/processor.go index 54efc0980..823ceca23 100644 --- a/pkg/innerring/processors/alphabet/processor.go +++ b/pkg/innerring/processors/alphabet/processor.go @@ -21,7 +21,7 @@ type ( // Contracts is an interface of the storage // of the alphabet contract addresses. Contracts interface { - // Get by index must return address of the + // GetByIndex must return address of the // alphabet contract by index of the glagolitic // letter (e.g 0 for Az, 40 for Izhitsa). // diff --git a/pkg/innerring/processors/audit/processor.go b/pkg/innerring/processors/audit/processor.go index 7244d74d2..113c96710 100644 --- a/pkg/innerring/processors/audit/processor.go +++ b/pkg/innerring/processors/audit/processor.go @@ -74,9 +74,9 @@ type epochAuditReporter struct { rep audit.Reporter } -// AuditProcessor manages audit tasks and fills queue for next epoch. This -// process must not be interrupted by new audit epoch, so we limit pool size -// for processor to one. +// ProcessorPoolSize limits pool size for audit Processor. Processor manages +// audit tasks and fills queue for next epoch. This process must not be interrupted +// by new audit epoch, so we limit pool size for processor to one. const ProcessorPoolSize = 1 // New creates audit processor instance. diff --git a/pkg/innerring/processors/governance/processor.go b/pkg/innerring/processors/governance/processor.go index 5b36bc7e8..588403ad1 100644 --- a/pkg/innerring/processors/governance/processor.go +++ b/pkg/innerring/processors/governance/processor.go @@ -15,9 +15,9 @@ import ( "go.uber.org/zap" ) -// GovernanceProcessor manages governance sync tasks. This process must not be -// interrupted by other sync operation, so we limit pool size for processor to -// one. +// ProcessorPoolSize limits pool size for governance Processor. Processor manages +// governance sync tasks. This process must not be interrupted by other sync +// operation, so we limit pool size for processor to one. const ProcessorPoolSize = 1 type ( diff --git a/pkg/local_object_storage/blobovnicza/blobovnicza.go b/pkg/local_object_storage/blobovnicza/blobovnicza.go index 77701ff21..d316f3d79 100644 --- a/pkg/local_object_storage/blobovnicza/blobovnicza.go +++ b/pkg/local_object_storage/blobovnicza/blobovnicza.go @@ -83,7 +83,7 @@ func WithPermissions(perm os.FileMode) Option { } } -// WithSizeLimit returns option to specify maximum size +// WithObjectSizeLimit returns option to specify maximum size // of the objects stored in Blobovnicza. func WithObjectSizeLimit(lim uint64) Option { return func(c *cfg) { diff --git a/pkg/local_object_storage/blobovnicza/get_range.go b/pkg/local_object_storage/blobovnicza/get_range.go index 77895547f..29c0a873b 100644 --- a/pkg/local_object_storage/blobovnicza/get_range.go +++ b/pkg/local_object_storage/blobovnicza/get_range.go @@ -24,7 +24,7 @@ func (p *GetRangePrm) SetAddress(addr *objectSDK.Address) { p.addr = addr } -// SetAddress sets range of the requested payload data . +// SetRange sets range of the requested payload data . func (p *GetRangePrm) SetRange(rng *objectSDK.Range) { p.rng = rng } @@ -34,7 +34,7 @@ func (p *GetRangeRes) RangeData() []byte { return p.rngData } -// Get reads the object from Blobovnicza by address. +// GetRange reads range of the object from Blobovnicza by address. // // Returns any error encountered that // did not allow to completely read the object. diff --git a/pkg/local_object_storage/blobstor/get_small.go b/pkg/local_object_storage/blobstor/get_small.go index f7af3b36e..7ff5d89e8 100644 --- a/pkg/local_object_storage/blobstor/get_small.go +++ b/pkg/local_object_storage/blobstor/get_small.go @@ -6,7 +6,7 @@ type GetSmallPrm struct { rwBlobovniczaID } -// GetBigRes groups resulting values of GetBig operation. +// GetSmallRes groups resulting values of GetSmall operation. type GetSmallRes struct { roObject } diff --git a/pkg/local_object_storage/blobstor/info.go b/pkg/local_object_storage/blobstor/info.go index cb1a11c5f..9f24212c5 100644 --- a/pkg/local_object_storage/blobstor/info.go +++ b/pkg/local_object_storage/blobstor/info.go @@ -2,7 +2,7 @@ package blobstor import "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/fstree" -// FSTree returns file-system tree for big object store. +// DumpInfo returns information about blob stor. func (b *BlobStor) DumpInfo() fstree.Info { return b.fsTree.Info } diff --git a/pkg/local_object_storage/engine/range.go b/pkg/local_object_storage/engine/range.go index ee6b2a4e9..7d58318ea 100644 --- a/pkg/local_object_storage/engine/range.go +++ b/pkg/local_object_storage/engine/range.go @@ -17,7 +17,7 @@ type RngPrm struct { addr *objectSDK.Address } -// GetRes groups resulting values of GetRange operation. +// RngRes groups resulting values of GetRange operation. type RngRes struct { obj *object.Object } diff --git a/pkg/local_object_storage/metabase/movable.go b/pkg/local_object_storage/metabase/movable.go index d81f74e3a..3e7867b74 100644 --- a/pkg/local_object_storage/metabase/movable.go +++ b/pkg/local_object_storage/metabase/movable.go @@ -49,7 +49,7 @@ type MovableRes struct { addrList []*objectSDK.Address } -// WithAddress sets address of the object to prevent moving into another shard. +// AddressList returns resulting addresses of Movable operation. func (p *MovableRes) AddressList() []*objectSDK.Address { return p.addrList } diff --git a/pkg/local_object_storage/shard/move.go b/pkg/local_object_storage/shard/move.go index f160c4bcd..421b7e22c 100644 --- a/pkg/local_object_storage/shard/move.go +++ b/pkg/local_object_storage/shard/move.go @@ -14,7 +14,7 @@ type ToMoveItPrm struct { // ToMoveItRes encapsulates results of ToMoveIt operation. type ToMoveItRes struct{} -// WithAdderss sets object address that should be marked to move into another +// WithAddress sets object address that should be marked to move into another // shard. func (p *ToMoveItPrm) WithAddress(addr *objectSDK.Address) *ToMoveItPrm { if p != nil { diff --git a/pkg/local_object_storage/shard/range.go b/pkg/local_object_storage/shard/range.go index 26d043e0e..2b4d03a69 100644 --- a/pkg/local_object_storage/shard/range.go +++ b/pkg/local_object_storage/shard/range.go @@ -16,7 +16,7 @@ type RngPrm struct { addr *objectSDK.Address } -// RngPrm groups resulting values of GetRange operation. +// RngRes groups resulting values of GetRange operation. type RngRes struct { obj *object.Object } diff --git a/pkg/local_object_storage/shard/shard.go b/pkg/local_object_storage/shard/shard.go index f32c2d018..b85403e29 100644 --- a/pkg/local_object_storage/shard/shard.go +++ b/pkg/local_object_storage/shard/shard.go @@ -110,7 +110,7 @@ func WithMetaBaseOptions(opts ...meta.Option) Option { } } -// WithMetaBaseOptions returns option to set internal metabase options. +// WithWriteCacheOptions returns option to set internal write cache options. func WithWriteCacheOptions(opts ...writecache.Option) Option { return func(c *cfg) { c.writeCacheOpts = opts diff --git a/pkg/morph/client/audit/wrapper/result.go b/pkg/morph/client/audit/wrapper/result.go index 6992b4db2..3d891c687 100644 --- a/pkg/morph/client/audit/wrapper/result.go +++ b/pkg/morph/client/audit/wrapper/result.go @@ -31,7 +31,7 @@ func (w *ClientWrapper) PutAuditResult(result *auditAPI.Result) error { PutAuditResult(args) } -// ListAuditResults returns a list of all audit result IDs inside audit contract. +// ListAllAuditResultID returns a list of all audit result IDs inside audit contract. func (w *ClientWrapper) ListAllAuditResultID() ([]ResultID, error) { args := audit.ListResultsArgs{} diff --git a/pkg/morph/client/balance/wrapper/wrapper.go b/pkg/morph/client/balance/wrapper/wrapper.go index d76da2da7..434352ff2 100644 --- a/pkg/morph/client/balance/wrapper/wrapper.go +++ b/pkg/morph/client/balance/wrapper/wrapper.go @@ -32,7 +32,7 @@ func defaultOpts() *opts { return new(opts) } -// TryNotaryInvoke returns option to enable +// TryNotary returns option to enable // notary invocation tries. func TryNotary() Option { return func(o *opts) { diff --git a/pkg/morph/client/container/load.go b/pkg/morph/client/container/load.go index c41761759..2c588987a 100644 --- a/pkg/morph/client/container/load.go +++ b/pkg/morph/client/container/load.go @@ -41,7 +41,7 @@ func (p *PutSizeArgs) SetReporterKey(v []byte) { p.reporterKey = v } -// Put invokes the call of put container method +// PutSize invokes the call of put container size method // of NeoFS Container contract. func (c *Client) PutSize(args PutSizeArgs) error { err := c.client.Invoke( diff --git a/pkg/morph/client/container/wrapper/container.go b/pkg/morph/client/container/wrapper/container.go index 30c4b5103..47a185c85 100644 --- a/pkg/morph/client/container/wrapper/container.go +++ b/pkg/morph/client/container/wrapper/container.go @@ -278,7 +278,7 @@ type Estimation struct { Reporter []byte } -// Estimation is a structure of grouped container load estimation inside Container contract. +// Estimations is a structure of grouped container load estimation inside Container contract. type Estimations struct { ContainerID *cid.ID diff --git a/pkg/morph/client/container/wrapper/wrapper.go b/pkg/morph/client/container/wrapper/wrapper.go index 5db748d95..4e1f23da3 100644 --- a/pkg/morph/client/container/wrapper/wrapper.go +++ b/pkg/morph/client/container/wrapper/wrapper.go @@ -31,7 +31,7 @@ func defaultOpts() *opts { return new(opts) } -// TryNotaryInvoke returns option to enable +// TryNotary returns option to enable // notary invocation tries. func TryNotary() Option { return func(o *opts) { diff --git a/pkg/morph/client/netmap/config.go b/pkg/morph/client/netmap/config.go index f3bc65dd5..d418f69d8 100644 --- a/pkg/morph/client/netmap/config.go +++ b/pkg/morph/client/netmap/config.go @@ -13,8 +13,8 @@ type ConfigArgs struct { key []byte } -// EpochValues groups the stack parameters -// returned by get epoch number test invoke. +// ConfigValues groups the stack parameters +// returned by get config test invoke. type ConfigValues struct { val interface{} } diff --git a/pkg/morph/client/netmap/netmap.go b/pkg/morph/client/netmap/netmap.go index f75c9aba5..3707901bb 100644 --- a/pkg/morph/client/netmap/netmap.go +++ b/pkg/morph/client/netmap/netmap.go @@ -69,7 +69,7 @@ func (c *Client) NetMap(_ GetNetMapArgs) (*GetNetMapValues, error) { return peersFromStackItems(prms, c.netMapMethod) } -// NetMap performs the test invoke of get snapshot of network map +// Snapshot performs the test invoke of get snapshot of network map // from NeoFS Netmap contract. Contract saves only one previous epoch, // so all invokes with diff > 1 return error. func (c *Client) Snapshot(a GetSnapshotArgs) (*GetNetMapValues, error) { diff --git a/pkg/morph/client/netmap/wrapper/snapshot.go b/pkg/morph/client/netmap/wrapper/snapshot.go index 2c5c0397e..83a0d72f7 100644 --- a/pkg/morph/client/netmap/wrapper/snapshot.go +++ b/pkg/morph/client/netmap/wrapper/snapshot.go @@ -7,7 +7,7 @@ import ( netmap2 "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap" ) -// Fetch returns current netmap node infos. +// Snapshot returns current netmap node infos. // Consider using pkg/morph/client/netmap for this. func (w *Wrapper) Snapshot() (*netmap.Netmap, error) { res, err := w.client.Snapshot(netmap2.GetSnapshotArgs{}) diff --git a/pkg/morph/client/reputation/wrapper/get.go b/pkg/morph/client/reputation/wrapper/get.go index 4f4219a5b..a99cdef50 100644 --- a/pkg/morph/client/reputation/wrapper/get.go +++ b/pkg/morph/client/reputation/wrapper/get.go @@ -20,7 +20,7 @@ type ( id ReputationID } - // GetResults groups the result of "get reputation value" and + // GetResult groups the result of "get reputation value" and // "get reputation value by reputation id" test invocations. GetResult struct { reputations []reputation.GlobalTrust diff --git a/pkg/morph/client/reputation/wrapper/wrapper.go b/pkg/morph/client/reputation/wrapper/wrapper.go index b65ddd278..f9b315aad 100644 --- a/pkg/morph/client/reputation/wrapper/wrapper.go +++ b/pkg/morph/client/reputation/wrapper/wrapper.go @@ -23,7 +23,7 @@ func defaultOpts() *opts { return new(opts) } -// TryNotaryInvoke returns option to enable +// TryNotary returns option to enable // notary invocation tries. func TryNotary() Option { return func(o *opts) { diff --git a/pkg/morph/client/static.go b/pkg/morph/client/static.go index cf14cdcfd..d438bc821 100644 --- a/pkg/morph/client/static.go +++ b/pkg/morph/client/static.go @@ -37,7 +37,7 @@ func defaultStaticOpts() *staticOpts { return new(staticOpts) } -// TryNotaryInvoke returns option to enable +// TryNotary returns option to enable // notary invocation tries. func TryNotary() StaticClientOption { return func(o *staticOpts) { diff --git a/pkg/services/audit/taskmanager/manager.go b/pkg/services/audit/taskmanager/manager.go index ffc8d3a76..8df658d0e 100644 --- a/pkg/services/audit/taskmanager/manager.go +++ b/pkg/services/audit/taskmanager/manager.go @@ -90,14 +90,14 @@ func WithMaxPDPSleepInterval(dur time.Duration) Option { } } -// WithPDPWorkerPool returns option to set worker pool for PDP pairs processing. +// WithPDPWorkerPoolGenerator returns option to set worker pool for PDP pairs processing. func WithPDPWorkerPoolGenerator(f func() (util.WorkerPool, error)) Option { return func(c *cfg) { c.pdpPoolGenerator = f } } -// WithPoRWorkerPool returns option to set worker pool for PoR SG processing. +// WithPoRWorkerPoolGenerator returns option to set worker pool for PoR SG processing. func WithPoRWorkerPoolGenerator(f func() (util.WorkerPool, error)) Option { return func(c *cfg) { c.porPoolGenerator = f diff --git a/pkg/services/container/announcement/load/controller/deps.go b/pkg/services/container/announcement/load/controller/deps.go index 0a72850dd..c598ea261 100644 --- a/pkg/services/container/announcement/load/controller/deps.go +++ b/pkg/services/container/announcement/load/controller/deps.go @@ -73,7 +73,7 @@ type Writer interface { io.Closer } -// IteratorProvider is a group of methods provided +// WriterProvider is a group of methods provided // by entity which generates keepers of // UsedSpaceAnnouncement values. type WriterProvider interface { diff --git a/pkg/services/object/acl/opts.go b/pkg/services/object/acl/opts.go index df3b47a4f..85bae0520 100644 --- a/pkg/services/object/acl/opts.go +++ b/pkg/services/object/acl/opts.go @@ -29,7 +29,7 @@ func WithNextService(v objectSvc.ServiceServer) Option { } } -// WithEACLValidator returns options to set eACL validator options. +// WithEACLValidatorOptions returns options to set eACL validator options. func WithEACLValidatorOptions(v ...eacl.Option) Option { return func(c *cfg) { c.eACLOpts = v diff --git a/pkg/services/object/delete/service.go b/pkg/services/object/delete/service.go index b6e249d45..bb1017972 100644 --- a/pkg/services/object/delete/service.go +++ b/pkg/services/object/delete/service.go @@ -86,14 +86,14 @@ func WithHeadService(h *getsvc.Service) Option { } } -// WithClientCache returns option to set cache of remote node clients. +// WithSearchService returns option to set search service. func WithSearchService(s *searchsvc.Service) Option { return func(c *cfg) { c.searcher = (*searchSvcWrapper)(s) } } -// WithClientOptions returns option to specify options of remote node clients. +// WithPutService returns option to specify put service. func WithPutService(p *putsvc.Service) Option { return func(c *cfg) { c.placer = (*putSvcWrapper)(p) diff --git a/pkg/services/object/search/v2/service.go b/pkg/services/object/search/v2/service.go index 0d6bc3e16..202226938 100644 --- a/pkg/services/object/search/v2/service.go +++ b/pkg/services/object/search/v2/service.go @@ -34,7 +34,7 @@ func NewService(opts ...Option) *Service { } } -// Get calls internal service and returns v2 object stream. +// Search calls internal service and returns v2 object stream. func (s *Service) Search(req *objectV2.SearchRequest, stream objectSvc.SearchStream) error { p, err := s.toPrm(req, stream) if err != nil { diff --git a/pkg/services/object_manager/transformer/types.go b/pkg/services/object_manager/transformer/types.go index 42c537f09..ddbe12abd 100644 --- a/pkg/services/object_manager/transformer/types.go +++ b/pkg/services/object_manager/transformer/types.go @@ -100,7 +100,7 @@ func (a *AccessIdentifiers) Parent() *objectSDK.Object { return nil } -// WithParentID returns AccessIdentifiers with passed parent identifier. +// WithParent returns AccessIdentifiers with passed parent identifier. func (a *AccessIdentifiers) WithParent(v *objectSDK.Object) *AccessIdentifiers { res := a if res == nil { diff --git a/pkg/services/reputation/eigentrust/storage/daughters/calls.go b/pkg/services/reputation/eigentrust/storage/daughters/calls.go index 96fd39d12..28ddb628b 100644 --- a/pkg/services/reputation/eigentrust/storage/daughters/calls.go +++ b/pkg/services/reputation/eigentrust/storage/daughters/calls.go @@ -65,7 +65,7 @@ func (x *Storage) AllDaughterTrusts(epoch uint64) (*DaughterStorage, bool) { return s, ok } -// maps IDs of daughter peers to repositories of the local trusts to their providers. +// DaughterStorage maps IDs of daughter peers to repositories of the local trusts to their providers. type DaughterStorage struct { mtx sync.RWMutex diff --git a/pkg/services/util/response/client_stream.go b/pkg/services/util/response/client_stream.go index 0ad3b42fd..ec0b124cf 100644 --- a/pkg/services/util/response/client_stream.go +++ b/pkg/services/util/response/client_stream.go @@ -16,7 +16,7 @@ type ClientMessageStreamer struct { close util.ClientStreamCloser } -// Recv calls send method of internal streamer. +// Send calls send method of internal streamer. func (s *ClientMessageStreamer) Send(req interface{}) error { if err := s.send(req); err != nil { return fmt.Errorf("(%T) could not send the request: %w", s, err) diff --git a/pkg/util/locode/db/boltdb/calls.go b/pkg/util/locode/db/boltdb/calls.go index 4176e21b0..6d6c4333c 100644 --- a/pkg/util/locode/db/boltdb/calls.go +++ b/pkg/util/locode/db/boltdb/calls.go @@ -132,7 +132,7 @@ func (db *DB) Put(key locodedb.Key, rec locodedb.Record) error { var errRecordNotFound = errors.New("record not found") -// Put reads the record by key from underlying BoltDB instance. +// Get reads the record by key from underlying BoltDB instance. // // Returns an error if no record is presented by key in DB. //