Documentation ¶
Index ¶
- Variables
- func NewService[T ClusterIDProvider](svr bs.Server) registry.RegistrableService
- type ClusterIDProvider
- type Manager
- type Service
- func (s *Service) Get(ctx context.Context, req *meta_storagepb.GetRequest) (*meta_storagepb.GetResponse, error)
- func (s *Service) Put(ctx context.Context, req *meta_storagepb.PutRequest) (*meta_storagepb.PutResponse, error)
- func (s *Service) RegisterGRPCService(g *grpc.Server)
- func (s *Service) RegisterRESTHandler(userDefineHandlers map[string]http.Handler)
- func (s *Service) Watch(req *meta_storagepb.WatchRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var SetUpRestHandler = func(srv *Service) (http.Handler, apiutil.APIServiceGroup) { return dummyRestService{}, apiutil.APIServiceGroup{} }
SetUpRestHandler is a hook to sets up the REST service.
Functions ¶
func NewService ¶
func NewService[T ClusterIDProvider](svr bs.Server) registry.RegistrableService
NewService creates a new meta storage service.
Types ¶
type ClusterIDProvider ¶
type ClusterIDProvider interface {
ClusterID() uint64
}
ClusterIDProvider is used to get cluster ID from the given `bs.server`
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the manager of resource group.
func NewManager ¶
func NewManager[T ClusterIDProvider](srv bs.Server) *Manager
NewManager returns a new Manager.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the gRPC service for meta storage.
func (*Service) Get ¶
func (s *Service) Get(ctx context.Context, req *meta_storagepb.GetRequest) (*meta_storagepb.GetResponse, error)
Get gets the key-value pair with a given key.
func (*Service) Put ¶
func (s *Service) Put(ctx context.Context, req *meta_storagepb.PutRequest) (*meta_storagepb.PutResponse, error)
Put puts the key-value pair into meta storage.
func (*Service) RegisterGRPCService ¶
RegisterGRPCService registers the service to gRPC server.
func (*Service) RegisterRESTHandler ¶
RegisterRESTHandler registers the service to REST server.
func (*Service) Watch ¶
func (s *Service) Watch(req *meta_storagepb.WatchRequest, server meta_storagepb.MetaStorage_WatchServer) error
Watch watches the key with a given prefix and revision.
Click to show internal directories.
Click to hide internal directories.