forked from TrueCloudLab/frostfs-api-go
b792e4e464
Define `Reputation` section interface. Embed `Reputation` interface to `Client` one. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
41 lines
586 B
Go
41 lines
586 B
Go
package client
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/rpc/client"
|
|
)
|
|
|
|
// Client represents NeoFS client.
|
|
type Client interface {
|
|
Accounting
|
|
Container
|
|
Netmap
|
|
Object
|
|
Session
|
|
Reputation
|
|
|
|
// Raw must return underlying raw protobuf client.
|
|
Raw() *client.Client
|
|
}
|
|
|
|
type clientImpl struct {
|
|
onceInit sync.Once
|
|
|
|
raw *client.Client
|
|
|
|
opts *clientOptions
|
|
}
|
|
|
|
func New(opts ...Option) (Client, error) {
|
|
clientOptions := defaultClientOptions()
|
|
|
|
for i := range opts {
|
|
opts[i](clientOptions)
|
|
}
|
|
|
|
return &clientImpl{
|
|
raw: client.New(),
|
|
opts: clientOptions,
|
|
}, nil
|
|
}
|