server

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService interface {
	Authenticate(ctx context.Context, req *authpb.AuthenticateRequest) (*authpb.AuthenticateResponse, error)
}

type ClientConnListener

type ClientConnListener struct {
	net.Listener
	// contains filtered or unexported fields
}

ClientConnListener is a client connection listener that accepts new connections and tracks active connections.

func NewClientConnListener

func NewClientConnListener(lis net.Listener, s *HakjServer, maxConnections uint32) *ClientConnListener

func (*ClientConnListener) Accept

func (l *ClientConnListener) Accept() (net.Conn, error)

type HakjServer

type HakjServer struct {

	// Cfg is the configuration that the server is configured with.
	// It is not intended to be changed after the server has been set up.
	Cfg config.ServerConfig

	*ClientConnListener
	// contains filtered or unexported fields
}

func NewHakjServer

func NewHakjServer(cfg config.ServerConfig, lg hakjdb.Logger) *HakjServer

func (*HakjServer) Authenticate

func (*HakjServer) AuthorizeIncomingRpcCall

func (s *HakjServer) AuthorizeIncomingRpcCall(ctx context.Context) error

AuthorizeIncomingRpcCall checks that incoming RPC call provides valid credentials.

func (*HakjServer) ChangeDB

func (*HakjServer) CloseLogger

func (s *HakjServer) CloseLogger()

CloseLogger closes logger and releases its possible resources.

func (*HakjServer) Config added in v1.2.0

func (s *HakjServer) Config() config.ServerConfig

func (*HakjServer) CreateDB

func (*HakjServer) CreateDefaultDatabase

func (s *HakjServer) CreateDefaultDatabase(name string)

CreateDefaultDatabase creates an empty default database.

func (*HakjServer) DBMaxKeysReached

func (s *HakjServer) DBMaxKeysReached(db *hakjdb.DB) bool

DBMaxKeysReached returns true if a database has reached or exceeded the maximum key limit.

func (*HakjServer) DeleteAllKeys

func (*HakjServer) DeleteDB

func (*HakjServer) DeleteHashMapFields

func (s *HakjServer) DeleteHashMapFields(ctx context.Context, req *kvpb.DeleteHashMapFieldsRequest) (res *kvpb.DeleteHashMapFieldsResponse, err error)

func (*HakjServer) DeleteKeys

func (*HakjServer) DisableAuth added in v1.2.0

func (s *HakjServer) DisableAuth()

func (*HakjServer) EnableAuth

func (s *HakjServer) EnableAuth(rootPassword string)

EnableAuth enables authentication.

func (*HakjServer) EnableLogFile

func (s *HakjServer) EnableLogFile()

EnableLogFile enables logger to write logs to the log file.

func (*HakjServer) GetAllDBs

func (*HakjServer) GetAllHashMapFieldsAndValues

func (*HakjServer) GetAllKeys

func (*HakjServer) GetDBInfo

func (*HakjServer) GetDBNameFromContext

func (s *HakjServer) GetDBNameFromContext(ctx context.Context) string

GetDBNameFromContext gets the database name from the incoming context gRPC metadata.

func (*HakjServer) GetHashMapFieldValues

func (s *HakjServer) GetHashMapFieldValues(ctx context.Context, req *kvpb.GetHashMapFieldValuesRequest) (res *kvpb.GetHashMapFieldValuesResponse, err error)

func (*HakjServer) GetKeyType

func (*HakjServer) GetLogs

func (*HakjServer) GetServerInfo

func (*HakjServer) GetString

func (*HakjServer) GetTLSCredentials added in v1.1.0

func (s *HakjServer) GetTLSCredentials() credentials.TransportCredentials

func (*HakjServer) Init

func (s *HakjServer) Init()

Init initializes the server.

func (*HakjServer) Logger

func (s *HakjServer) Logger() hakjdb.Logger

func (*HakjServer) ProcessConfigReload added in v1.2.0

func (s *HakjServer) ProcessConfigReload(cfg *config.ServerConfig)

func (*HakjServer) ReloadConfig added in v1.2.0

func (*HakjServer) SetHashMap

func (*HakjServer) SetString

func (*HakjServer) SetupListener

func (s *HakjServer) SetupListener()

type StringKVService

type StringKVService interface {
	SetString(ctx context.Context, req *kvpb.SetStringRequest) (*kvpb.SetStringResponse, error)
	GetString(ctx context.Context, req *kvpb.GetStringRequest) (*kvpb.GetStringResponse, error)
}

Jump to

Keyboard shortcuts

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