Documentation ¶
Index ¶
- func SignMessage(key *ecdsa.PrivateKey, msg SignedMessage) error
- type HealthChecker
- type NodeState
- type 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) EvacuateShard(_ context.Context, req *control.EvacuateShardRequest) (*control.EvacuateShardResponse, error)
- func (s *Server) FlushCache(_ context.Context, req *control.FlushCacheRequest) (*control.FlushCacheResponse, error)
- func (s *Server) HealthCheck(_ context.Context, req *control.HealthCheckRequest) (*control.HealthCheckResponse, error)
- func (s *Server) ListObjects(req *control.ListObjectsRequest, ...) error
- func (s *Server) ListShards(_ context.Context, req *control.ListShardsRequest) (*control.ListShardsResponse, error)
- func (s *Server) MarkReady(e *engine.StorageEngine, nm netmap.Source, c container.Source, ...)
- func (s *Server) ObjectStatus(_ context.Context, request *control.ObjectStatusRequest) (*control.ObjectStatusResponse, error)
- func (s *Server) RestoreShard(_ context.Context, req *control.RestoreShardRequest) (*control.RestoreShardResponse, error)
- func (s *Server) ReviveObject(_ context.Context, request *control.ReviveObjectRequest) (*control.ReviveObjectResponse, error)
- func (s *Server) SetNetmapStatus(_ context.Context, req *control.SetNetmapStatusRequest) (*control.SetNetmapStatusResponse, error)
- func (s *Server) SetShardMode(_ context.Context, req *control.SetShardModeRequest) (*control.SetShardModeResponse, error)
- func (s *Server) SynchronizeTree(ctx context.Context, req *control.SynchronizeTreeRequest) (*control.SynchronizeTreeResponse, error)
- type SignedMessage
- type TreeService
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 HealthChecker ¶
type HealthChecker interface { // NetmapStatus 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 // HealthStatus 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 switches the storage node to the given network status. // // If status is control.NetmapStatus_MAINTENANCE and maintenance is allowed // in the network settings, the node additionally starts local maintenance. SetNetmapStatus(st control.NetmapStatus) error // ForceMaintenance works like SetNetmapStatus(control.NetmapStatus_MAINTENANCE) // but starts local maintenance regardless of the network settings. ForceMaintenance() error }
NodeState is an interface of storage node network state.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an entity that serves Control service on storage node.
func New ¶
func New(key *ecdsa.PrivateKey, authorizedKeys [][]byte, healthChecker HealthChecker) *Server
New creates, initializes and returns new Server instance. Must be marked as available with Server.MarkReady when all the components for serving are ready. Before Server.MarkReady call only health checks are available.
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) EvacuateShard ¶ added in v0.33.0
func (s *Server) EvacuateShard(_ context.Context, req *control.EvacuateShardRequest) (*control.EvacuateShardResponse, error)
func (*Server) FlushCache ¶ added in v0.33.0
func (s *Server) FlushCache(_ context.Context, req *control.FlushCacheRequest) (*control.FlushCacheResponse, 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) ListObjects ¶ added in v0.44.0
func (s *Server) ListObjects(req *control.ListObjectsRequest, stream control.ControlService_ListObjectsServer) error
func (*Server) ListShards ¶ added in v0.27.2
func (s *Server) ListShards(_ context.Context, req *control.ListShardsRequest) (*control.ListShardsResponse, error)
func (*Server) MarkReady ¶ added in v0.39.0
func (s *Server) MarkReady(e *engine.StorageEngine, nm netmap.Source, c container.Source, r *replicator.Replicator, st NodeState, tr TreeService)
MarkReady marks server available. Before this call none of the other calls are available except for the health checks.
func (*Server) ObjectStatus ¶ added in v0.43.0
func (s *Server) ObjectStatus(_ context.Context, request *control.ObjectStatusRequest) (*control.ObjectStatusResponse, error)
func (*Server) RestoreShard ¶ added in v0.27.5
func (s *Server) RestoreShard(_ context.Context, req *control.RestoreShardRequest) (*control.RestoreShardResponse, error)
func (*Server) ReviveObject ¶ added in v0.44.0
func (s *Server) ReviveObject(_ context.Context, request *control.ReviveObjectRequest) (*control.ReviveObjectResponse, error)
func (*Server) SetNetmapStatus ¶
func (s *Server) SetNetmapStatus(_ 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)
func (*Server) SynchronizeTree ¶ added in v0.30.0
func (s *Server) SynchronizeTree(ctx context.Context, req *control.SynchronizeTreeRequest) (*control.SynchronizeTreeResponse, error)