2021-11-09 08:07:49 +00:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
2021-11-16 18:15:56 +00:00
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/rpc/client"
|
2021-11-09 08:07:49 +00:00
|
|
|
)
|
|
|
|
|
2021-12-29 13:18:09 +00:00
|
|
|
type Client struct {
|
2021-11-09 08:07:49 +00:00
|
|
|
raw *client.Client
|
|
|
|
|
|
|
|
opts *clientOptions
|
|
|
|
}
|
|
|
|
|
2021-12-29 13:18:09 +00:00
|
|
|
func New(opts ...Option) (*Client, error) {
|
2021-11-09 08:07:49 +00:00
|
|
|
clientOptions := defaultClientOptions()
|
|
|
|
|
|
|
|
for i := range opts {
|
|
|
|
opts[i](clientOptions)
|
|
|
|
}
|
|
|
|
|
2021-12-29 13:18:09 +00:00
|
|
|
return &Client{
|
2021-11-09 08:07:49 +00:00
|
|
|
opts: clientOptions,
|
|
|
|
raw: client.New(clientOptions.rawOpts...),
|
|
|
|
}, nil
|
|
|
|
}
|