25da5d2e13
Replace all elements from `v2` to root directory. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
27 lines
582 B
Go
27 lines
582 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/rpc/grpc"
|
|
)
|
|
|
|
// CallOption is a messaging session option within Protobuf RPC.
|
|
type CallOption func(*callParameters)
|
|
|
|
type callParameters struct {
|
|
callOpts []grpc.CallOption
|
|
}
|
|
|
|
func defaultCallParameters() *callParameters {
|
|
return &callParameters{
|
|
callOpts: make([]grpc.CallOption, 0, 1),
|
|
}
|
|
}
|
|
|
|
// WithContext return options to specify call context.
|
|
func WithContext(ctx context.Context) CallOption {
|
|
return func(prm *callParameters) {
|
|
prm.callOpts = append(prm.callOpts, grpc.WithContext(ctx))
|
|
}
|
|
}
|