puzzledb

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: 21 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ProductName is the product name.
	ProductName = "puzzledb"
)
View Source
const (
	Version = "v0.8.0"
)

Variables

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

Functions

This section is empty.

Types

type Config

type Config interface {
	// Get returns a value for the specified name.
	Get(name ...string) (any, error)
	// GetString returns a string value for the specified name.
	GetString(name ...string) (string, error)
	// GetInt returns an integer value for the specified name.
	GetInt(name ...string) (int, error)
	// String returns a string representation of the configuration.
	String() string
}

Config represents a configuration interface.

func NewConfig

func NewConfig() (Config, error)

NewConfig returns a new configuration.

func NewConfigWithPath

func NewConfigWithPath(path string) (Config, error)

NewConfigWithPath returns a new configuration with the specified path.

func NewConfigWithString

func NewConfigWithString(config string) (Config, error)

NewConfigWithString returns a new configuration with the specified string.

type Server

type Server struct {
	*ServerConfig
	*plugins.Manager
}

Server represents a server instance.

func NewServer

func NewServer() *Server

NewServer returns a new server instance.

func NewServerWithConfig

func NewServerWithConfig(config Config) *Server

NewServerWithConfig returns a new server instance with the specified configuration.

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(config Config)

SetConfig sets the 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.

type ServerConfig

type ServerConfig struct {
	Config
}

func NewServerConfigWith

func NewServerConfigWith(config Config) *ServerConfig

func (*ServerConfig) Port

func (conf *ServerConfig) Port(name string) (int, error)

Port returns a port number for the specified name.

func (*ServerConfig) String

func (conf *ServerConfig) String() string

Jump to

Keyboard shortcuts

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