puzzledb

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 56 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ConfigAPI     = "api"
	ConfigPlugins = "plugins"
	ConfigGrpc    = "grpc"
	ConfigQuery   = "query"
	ConfigPort    = "port"
	ConfigEnabled = "enabled"
	ConfigTracer  = "tracer"
	ConfigPprof   = "pprof"
	ConfigLogger  = "logger"
	ConfigDefault = "default"
	ConfigLevel   = "level"
	ConfigAuth    = "auth"
	ConfigTLS     = "tls"
)
View Source
const (
	// PackageName is the package name.
	PackageName = "github.com/cybergarage/puzzledb-go"
	// ProductName is the product name.
	ProductName = "puzzledb"
)
View Source
const (
	// DefaultGrpcPort is the default port number of the gRPC server.
	DefaultGrpcPort = 50053
)
View Source
const (
	Version = "v1.3.2"
)

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) (map[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 interface {
	config.Config
}

Config represents a configuration interface for PuzzleDB.

func NewConfig

func NewConfig() (Config, error)

NewConfig returns a new 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)

type PluginManager added in v0.9.0

type PluginManager struct {
	*plugins.Manager
}

PluginManager is a manager for plugins.

func NewPluginManagerWith added in v0.9.0

func NewPluginManagerWith(mgr *plugins.Manager) *PluginManager

NewPluginManager returns a new PluginManager.

func (*PluginManager) AuthenticatorServices added in v1.3.0

func (mgr *PluginManager) AuthenticatorServices() ([]auth.Service, error)

AuthenticatorServices returns authenticator services.

func (*PluginManager) CoordinatorServices added in v0.9.0

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

CoordinatorServices returns coordinator services.

func (*PluginManager) DefaultCoordinatorService added in v0.9.0

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

DefaultCoordinatorService returns the default coordinator service.

func (*PluginManager) DefaultDocumentCoderService added in v0.9.0

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

DefaultDocumentCoderService returns the default document coder service.

func (*PluginManager) DefaultKeyCoderService added in v0.9.0

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

DefaultKeyCoderService returns the default key coder service.

func (*PluginManager) DefaultKvCacheStoreService added in v1.0.0

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

DefaultKvCacheStoreService returns the default KV cache store service.

func (*PluginManager) DefaultKvStoreService added in v0.9.0

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

DefaultKvStoreService returns the default KV store service.

func (*PluginManager) DefaultStoreService added in v0.9.0

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

DefaultStoreService returns the default store service.

func (*PluginManager) DefaultTracingService added in v1.0.0

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

DefaultTracingService returns the default tracing service.

func (*PluginManager) DocumentCoderServices added in v0.9.0

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

DocumentCoderServices returns document coder services.

func (*PluginManager) DocumentStoreServices added in v0.9.0

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

DocumentStoreServices returns document store services.

func (*PluginManager) EnabledAuthenticatorServices added in v1.3.0

func (mgr *PluginManager) EnabledAuthenticatorServices() []auth.Service

EnabledMetricsServices returns enabled metrics services.

func (*PluginManager) EnabledCoordinatorServices added in v0.9.0

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

EnabledCoordinatorServices returns enabled coordinator services.

func (*PluginManager) EnabledDocumentCoderServices added in v0.9.0

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

EnabledDocumentCoderServices returns enabled document coder services.

func (*PluginManager) EnabledDocumentStoreServices added in v0.9.0

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

EnabledDocumentStoreServices returns enabled document store services.

func (*PluginManager) EnabledKeyCoderServices added in v0.9.0

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

EnabledKeyCoderServices returns enabled key coder services.

func (*PluginManager) EnabledKvCacheStoreServices added in v1.2.0

func (mgr *PluginManager) EnabledKvCacheStoreServices() []kvcache.Service

EnabledKvCacheStoreServices returns enabled KV cache store services.

func (*PluginManager) EnabledKvStoreServices added in v0.9.0

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

EnabledKvStoreServices returns enabled KV store services.

func (*PluginManager) EnabledTracingServices added in v1.0.0

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

EnabledTracingServices returns enabled tracing services.

func (*PluginManager) KeyCoderServices added in v0.9.0

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

KeyCoderServices returns key coder services.

func (*PluginManager) KvCacheStoreServices added in v1.0.0

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

KvCacheStoreServices returns KV cache store services.

func (*PluginManager) KvStoreServices added in v0.9.0

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

KvStoreServices returns KV store services.

func (*PluginManager) MetricsServices added in v1.0.0

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

MetricsServices returns metrics services.

func (*PluginManager) QueryServices added in v0.9.0

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

QueryServices returns query services.

func (*PluginManager) RemoveDisabledServices added in v0.9.0

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

RemoveDisabledServices removes disabled services.

func (*PluginManager) TracingServices added in v1.0.0

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

TracingServices returns tracing services.

type Server

type Server struct {
	Config

	auth.AuthManager
	*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) IsTLSEnabled added in v1.3.2

func (server *Server) IsTLSEnabled() bool

IsTLSEnabled returns true if TLS is enabled.

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) SetTLSConfig added in v1.3.1

func (server *Server) SetTLSConfig(tlsConfig *std_tls.Config)

SetTLSConfig sets a TLS 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.

func (*Server) TLSConfig added in v1.3.1

func (server *Server) TLSConfig() (*std_tls.Config, bool)

TLSConfig returns a TLS configuration.

Jump to

Keyboard shortcuts

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