plugins

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager represents a plug-in manager.

func NewManager

func NewManager() *Manager

NewManager returns a plug-in manager instance.

func (*Manager) RegisterService

func (mgr *Manager) RegisterService(srv Service)

RegisterService adds a plug-in service.

func (*Manager) ReloadServices

func (mgr *Manager) ReloadServices(srvs []Service)

ReloadServices reloads all plug-in services.

func (*Manager) Start

func (mgr *Manager) Start() error

Start starts all plug-in services.

func (Manager) Stop

func (mgr Manager) Stop() error

Stop stops all plug-in services.

func (*Manager) String

func (mgr *Manager) String() string

String returns a string representation of the plug-in manager.

type Service

type Service interface {
	// ServiceType returns the service type.
	ServiceType() ServiceType
	// ServiceName returns the service name.
	ServiceName() string
	// Start starts the service
	Start() error
	// Stop stops the service
	Stop() error
}

Service represents a plugin service.

type ServiceType

type ServiceType uint8

ServiceType represents a service type.

const (
	// EncoderDocumentService represents a serializer service for document.
	EncoderDocumentService ServiceType = iota
	// EncoderKeyService represents a serializer service for key.
	EncoderKeyService
	// QueryService represents a query service.
	QueryService
	// StoreDocumentService represents a document store service.
	StoreDocumentService
	// StoreKvService represents a key-value store service.
	StoreKvService
	// CoordinatorService represents a coordinator service.
	CoordinatorService
	// ExtendService represents an uncategorized service.
	ExtendService
)

func ServiceTypes

func ServiceTypes() []ServiceType

ServiceTypes returns all service types.

func (ServiceType) String

func (t ServiceType) String() string

String returns a string representation of the service type.

Directories

Path Synopsis
kv

Jump to

Keyboard shortcuts

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