puzzledb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 47 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ConfigAPI     = "api"
	ConfigPlugins = "plugins"
	ConfigGrpc    = "grpc"
	ConfigQuery   = "query"
	ConfigPort    = "port"
	ConfigEnabled = "enabled"
	ConfigTracer  = "tracer"
	ConfigLogger  = "logger"
	ConfigDefault = "default"
	ConfigLevel   = "level"
)
View Source
const (
	// DefaultGrpcPort is the default port number of the gRPC server.
	DefaultGrpcPort = 50053
)
View Source
const (
	// ProductName is the product name.
	ProductName = "puzzledb"
)
View Source
const (
	Version = "v1.0.0"
)

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
	ErrInvalid  = errors.New("invalid")
)

Functions

func NewGrpcServiceWith added in v1.0.0

func NewGrpcServiceWith(server *Server) *gRPCService

NewGrpcServiceWith returns a new GrpcServer.

Types

type Client added in v0.9.0

type Client struct {
	Host string
	Port int
	Conn *grpc.ClientConn
}

Client represens a gRPC client.

func NewClient added in v0.9.0

func NewClient() *Client

NewClient returns a new gRPC client.

func (*Client) Check added in v0.9.0

func (client *Client) Check() (bool, error)

func (*Client) Close added in v0.9.0

func (client *Client) Close() error

func (*Client) CreateDatabase added in v0.9.0

func (client *Client) CreateDatabase(name string) error

CreateDatabase creates a specified database.

func (*Client) GetConfig added in v0.9.0

func (client *Client) GetConfig(name string) (string, error)

func (*Client) GetMetric added in v0.9.0

func (client *Client) GetMetric(name string) (string, error)

func (*Client) GetVersion added in v0.9.0

func (client *Client) GetVersion() (string, error)

func (*Client) ListConfig added in v0.9.0

func (client *Client) ListConfig() ([]string, error)

func (*Client) ListDatabases added in v0.9.0

func (client *Client) ListDatabases() ([]string, error)

ListDatabases returns a list of database names.

func (*Client) ListMetric added in v0.9.0

func (client *Client) ListMetric() ([]string, error)

func (*Client) Open added in v0.9.0

func (client *Client) Open() error

Open opens a gRPC connection.

func (*Client) RemoveDatabase added in v0.9.0

func (client *Client) RemoveDatabase(name string) error

RemoveDatabase removes a specified database.

func (*Client) SetHost added in v0.9.0

func (client *Client) SetHost(host string)

SetHost sets a host name.

func (*Client) SetPort added in v0.9.0

func (client *Client) SetPort(port int)

SetPort sets a port number.

type Config

type Config struct {
	config.Config
}

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns a new configuration.

func NewConfigWith added in v0.9.0

func NewConfigWith(conf config.Config) *Config

NewConfigWith returns a new configuration with the specified configuration.

func NewConfigWithFile added in v0.9.0

func NewConfigWithFile(confFile string) (*Config, error)

NewConfigWithFile returns a new configuration with the specified file.

func NewConfigWithPath

func NewConfigWithPath(path string) (*Config, error)

NewConfigWithPath returns a new configuration with the specified path.

func NewConfigWithPaths added in v0.9.0

func NewConfigWithPaths(paths ...string) (*Config, error)

func NewConfigWithString

func NewConfigWithString(conString string) (*Config, error)

NewConfigWithString returns a new configuration with the specified string.

func NewDefaultConfig added in v0.9.0

func NewDefaultConfig() (*Config, error)

func (*Config) String

func (conf *Config) String() string

String returns a string representation of the configuration.

type PluginManager added in v0.9.0

type PluginManager struct {
	*plugins.Manager
}

func NewPluginManagerWith added in v0.9.0

func NewPluginManagerWith(mgr *plugins.Manager) *PluginManager

func (*PluginManager) CoordinatorServices added in v0.9.0

func (mgr *PluginManager) CoordinatorServices() ([]coordinator.Service, error)

func (*PluginManager) DefaultCoordinatorService added in v0.9.0

func (mgr *PluginManager) DefaultCoordinatorService() (coordinator.Service, error)

func (*PluginManager) DefaultDocumentCoderService added in v0.9.0

func (mgr *PluginManager) DefaultDocumentCoderService() (document.Service, error)

func (*PluginManager) DefaultKeyCoderService added in v0.9.0

func (mgr *PluginManager) DefaultKeyCoderService() (key.Service, error)

func (*PluginManager) DefaultKvCacheStoreService added in v1.0.0

func (mgr *PluginManager) DefaultKvCacheStoreService() (kvcache.Service, error)

func (*PluginManager) DefaultKvStoreService added in v0.9.0

func (mgr *PluginManager) DefaultKvStoreService() (kv.Service, error)

func (*PluginManager) DefaultStoreService added in v0.9.0

func (mgr *PluginManager) DefaultStoreService() (store.Service, error)

func (*PluginManager) DefaultTracingService added in v1.0.0

func (mgr *PluginManager) DefaultTracingService() (tracer.Service, error)

func (*PluginManager) DocumentCoderServices added in v0.9.0

func (mgr *PluginManager) DocumentCoderServices() ([]document.Service, error)

func (*PluginManager) DocumentStoreServices added in v0.9.0

func (mgr *PluginManager) DocumentStoreServices() ([]store.Service, error)

func (*PluginManager) EnabledCoordinatorServices added in v0.9.0

func (mgr *PluginManager) EnabledCoordinatorServices() []coordinator.Service

func (*PluginManager) EnabledDocumentCoderServices added in v0.9.0

func (mgr *PluginManager) EnabledDocumentCoderServices() []document.Service

func (*PluginManager) EnabledDocumentStoreServices added in v0.9.0

func (mgr *PluginManager) EnabledDocumentStoreServices() []store.Service

func (*PluginManager) EnabledKeyCoderServices added in v0.9.0

func (mgr *PluginManager) EnabledKeyCoderServices() []key.Service

func (*PluginManager) EnabledKvStoreServices added in v0.9.0

func (mgr *PluginManager) EnabledKvStoreServices() []kv.Service

func (*PluginManager) EnabledTracingServices added in v1.0.0

func (mgr *PluginManager) EnabledTracingServices() []tracer.Service

func (*PluginManager) KeyCoderServices added in v0.9.0

func (mgr *PluginManager) KeyCoderServices() ([]key.Service, error)

func (*PluginManager) KvCacheStoreServices added in v1.0.0

func (mgr *PluginManager) KvCacheStoreServices() ([]kvcache.Service, error)

func (*PluginManager) KvStoreServices added in v0.9.0

func (mgr *PluginManager) KvStoreServices() ([]kv.Service, error)

func (*PluginManager) MetricsServices added in v1.0.0

func (mgr *PluginManager) MetricsServices() ([]metrics.Service, error)

func (*PluginManager) QueryServices added in v0.9.0

func (mgr *PluginManager) QueryServices() ([]query.Service, error)

func (*PluginManager) RemoveDisabledServices added in v0.9.0

func (mgr *PluginManager) RemoveDisabledServices(services []plugins.Service) []plugins.Service

func (*PluginManager) TracingServices added in v1.0.0

func (mgr *PluginManager) TracingServices() ([]tracer.Service, error)

type Server

type Server struct {
	*Config
	*PluginManager
	cluster.Node
	// contains filtered or unexported fields
}

Server represents a server instance.

func NewServer

func NewServer() *Server

NewServer returns a new server instance.

func NewServerWithConfig

func NewServerWithConfig(conf config.Config) *Server

NewServerWithConfig returns a new server instance with the specified configuradtion.

func (*Server) LoadPlugins

func (server *Server) LoadPlugins() error

func (*Server) Restart

func (server *Server) Restart() error

Restart restarts the server.

func (*Server) SetConfig

func (server *Server) SetConfig(conf *Config)

SetConfig sets a server configuration.

func (*Server) Start

func (server *Server) Start() error

Start starts the server.

func (*Server) Stop

func (server *Server) Stop() error

Stop stops the server.

Jump to

Keyboard shortcuts

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