server

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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

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.

func (*Manager) ClusterID

func (m *Manager) ClusterID() uint64

ClusterID returns the cluster ID.

func (*Manager) GetClient

func (m *Manager) GetClient() *clientv3.Client

GetClient returns the client of etcd.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the gRPC service for meta storage.

func (*Service) Get

Get gets the key-value pair with a given key.

func (*Service) Put

Put puts the key-value pair into meta storage.

func (*Service) RegisterGRPCService

func (s *Service) RegisterGRPCService(g *grpc.Server)

RegisterGRPCService registers the service to gRPC server.

func (*Service) RegisterRESTHandler

func (s *Service) RegisterRESTHandler(userDefineHandlers map[string]http.Handler)

RegisterRESTHandler registers the service to REST server.

func (*Service) Watch

Watch watches the key with a given prefix and revision.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL