Documentation ¶
Index ¶
- func SignMessage(key *ecdsa.PrivateKey, msg SignedMessage) error
- type DeletedObjectHandler
- type HealthChecker
- type NodeState
- type Option
- func WithAuthorizedKeys(keys [][]byte) Option
- func WithDeletedObjectHandler(h DeletedObjectHandler) Option
- func WithHealthChecker(hc HealthChecker) Option
- func WithKey(key *ecdsa.PrivateKey) Option
- func WithLocalStorage(engine *engine.StorageEngine) Option
- func WithNetMapSource(netMapSrc netmap.Source) Option
- func WithNodeState(state NodeState) Option
- type Server
- func (s *Server) DropObjects(_ context.Context, req *control.DropObjectsRequest) (*control.DropObjectsResponse, error)
- func (s *Server) DumpShard(_ context.Context, req *control.DumpShardRequest) (*control.DumpShardResponse, error)
- func (s *Server) HealthCheck(_ context.Context, req *control.HealthCheckRequest) (*control.HealthCheckResponse, error)
- func (s *Server) ListShards(_ context.Context, req *control.ListShardsRequest) (*control.ListShardsResponse, error)
- func (s *Server) NetmapSnapshot(ctx context.Context, req *control.NetmapSnapshotRequest) (*control.NetmapSnapshotResponse, error)
- func (s *Server) RestoreShard(_ context.Context, req *control.RestoreShardRequest) (*control.RestoreShardResponse, error)
- func (s *Server) SetNetmapStatus(ctx context.Context, req *control.SetNetmapStatusRequest) (*control.SetNetmapStatusResponse, error)
- func (s *Server) SetShardMode(_ context.Context, req *control.SetShardModeRequest) (*control.SetShardModeResponse, error)
- type SignedMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SignMessage ¶
func SignMessage(key *ecdsa.PrivateKey, msg SignedMessage) error
SignMessage signs Control service message with private key.
Types ¶
type DeletedObjectHandler ¶ added in v0.16.0
type DeletedObjectHandler func([]*addressSDK.Address) error
DeletedObjectHandler is a handler of objects to be removed.
type HealthChecker ¶
type HealthChecker interface { // Must calculate and return current status of the node in NeoFS network map. // // If status can not be calculated for any reason, // control.netmapStatus_STATUS_UNDEFINED should be returned. NetmapStatus() control.NetmapStatus // Must calculate and return current health status of the node application. // // If status can not be calculated for any reason, // control.HealthStatus_HEALTH_STATUS_UNDEFINED should be returned. HealthStatus() control.HealthStatus }
HealthChecker is component interface for calculating the current health status of a node.
type NodeState ¶
type NodeState interface {
SetNetmapStatus(control.NetmapStatus) error
}
NodeState is an interface of storage node network state.
type Option ¶
type Option func(*cfg)
Option of the Server's constructor.
func WithAuthorizedKeys ¶
WithAuthorizedKeys returns option to add list of public keys that have rights to use Control service.
func WithDeletedObjectHandler ¶ added in v0.16.0
func WithDeletedObjectHandler(h DeletedObjectHandler) Option
WithDeletedObjectHandler returns option to function which is called on the objects being deleted.
func WithHealthChecker ¶
func WithHealthChecker(hc HealthChecker) Option
WithHealthChecker returns option to set component to calculate node health status.
func WithKey ¶
func WithKey(key *ecdsa.PrivateKey) Option
WithKey returns option to set private key used for signing responses.
func WithLocalStorage ¶ added in v0.27.2
func WithLocalStorage(engine *engine.StorageEngine) Option
WithLocalStorage returns option to set local storage engine that contains information about shards.
func WithNetMapSource ¶
WithNetMapSource returns option to set network map storage.
func WithNodeState ¶
WithNodeState returns option to set node network state component.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an entity that serves Control service on storage node.
func (*Server) DropObjects ¶ added in v0.16.0
func (s *Server) DropObjects(_ context.Context, req *control.DropObjectsRequest) (*control.DropObjectsResponse, error)
DropObjects marks objects to be removed from the local node.
Objects are marked via garbage collector's callback.
If some address is not a valid object address in a binary format, an error returns. If request is unsigned or signed by disallowed key, permission error returns.
func (*Server) DumpShard ¶ added in v0.27.5
func (s *Server) DumpShard(_ context.Context, req *control.DumpShardRequest) (*control.DumpShardResponse, error)
func (*Server) HealthCheck ¶
func (s *Server) HealthCheck(_ context.Context, req *control.HealthCheckRequest) (*control.HealthCheckResponse, error)
HealthCheck returns health status of the local node.
If request is unsigned or signed by disallowed key, permission error returns.
func (*Server) ListShards ¶ added in v0.27.2
func (s *Server) ListShards(_ context.Context, req *control.ListShardsRequest) (*control.ListShardsResponse, error)
func (*Server) NetmapSnapshot ¶
func (s *Server) NetmapSnapshot(ctx context.Context, req *control.NetmapSnapshotRequest) (*control.NetmapSnapshotResponse, error)
NetmapSnapshot reads network map snapshot from Netmap storage.
func (*Server) RestoreShard ¶ added in v0.27.5
func (s *Server) RestoreShard(_ context.Context, req *control.RestoreShardRequest) (*control.RestoreShardResponse, error)
func (*Server) SetNetmapStatus ¶
func (s *Server) SetNetmapStatus(ctx context.Context, req *control.SetNetmapStatusRequest) (*control.SetNetmapStatusResponse, error)
SetNetmapStatus sets node status in NeoFS network.
If request is unsigned or signed by disallowed key, permission error returns.
func (*Server) SetShardMode ¶ added in v0.27.3
func (s *Server) SetShardMode(_ context.Context, req *control.SetShardModeRequest) (*control.SetShardModeResponse, error)
type SignedMessage ¶
type SignedMessage interface { signature.DataSource GetSignature() *control.Signature SetSignature(*control.Signature) }
SignedMessage is an interface of Control service message.