Documentation ¶
Index ¶
- type AuthService
- type ClientConnListener
- type DBService
- type GeneralKVService
- type HakjServer
- func (s *HakjServer) Authenticate(ctx context.Context, req *authpb.AuthenticateRequest) (*authpb.AuthenticateResponse, error)
- func (s *HakjServer) AuthorizeIncomingRpcCall(ctx context.Context) error
- func (s *HakjServer) ChangeDB(ctx context.Context, req *dbpb.ChangeDBRequest) (*dbpb.ChangeDBResponse, error)
- func (s *HakjServer) CloseLogger()
- func (s *HakjServer) Config() config.ServerConfig
- func (s *HakjServer) CreateDB(ctx context.Context, req *dbpb.CreateDBRequest) (*dbpb.CreateDBResponse, error)
- func (s *HakjServer) CreateDefaultDatabase(name string)
- func (s *HakjServer) DBMaxKeysReached(db *hakjdb.DB) bool
- func (s *HakjServer) DeleteAllKeys(ctx context.Context, req *kvpb.DeleteAllKeysRequest) (*kvpb.DeleteAllKeysResponse, error)
- func (s *HakjServer) DeleteDB(ctx context.Context, req *dbpb.DeleteDBRequest) (*dbpb.DeleteDBResponse, error)
- func (s *HakjServer) DeleteHashMapFields(ctx context.Context, req *kvpb.DeleteHashMapFieldsRequest) (res *kvpb.DeleteHashMapFieldsResponse, err error)
- func (s *HakjServer) DeleteKeys(ctx context.Context, req *kvpb.DeleteKeysRequest) (*kvpb.DeleteKeysResponse, error)
- func (s *HakjServer) DisableAuth()
- func (s *HakjServer) EnableAuth(rootPassword string)
- func (s *HakjServer) EnableLogFile()
- func (s *HakjServer) GetAllDBs(ctx context.Context, req *dbpb.GetAllDBsRequest) (*dbpb.GetAllDBsResponse, error)
- func (s *HakjServer) GetAllHashMapFieldsAndValues(ctx context.Context, req *kvpb.GetAllHashMapFieldsAndValuesRequest) (res *kvpb.GetAllHashMapFieldsAndValuesResponse, err error)
- func (s *HakjServer) GetAllKeys(ctx context.Context, req *kvpb.GetAllKeysRequest) (*kvpb.GetAllKeysResponse, error)
- func (s *HakjServer) GetDBInfo(ctx context.Context, req *dbpb.GetDBInfoRequest) (*dbpb.GetDBInfoResponse, error)
- func (s *HakjServer) GetDBNameFromContext(ctx context.Context) string
- func (s *HakjServer) GetHashMapFieldValues(ctx context.Context, req *kvpb.GetHashMapFieldValuesRequest) (res *kvpb.GetHashMapFieldValuesResponse, err error)
- func (s *HakjServer) GetKeyType(ctx context.Context, req *kvpb.GetKeyTypeRequest) (*kvpb.GetKeyTypeResponse, error)
- func (s *HakjServer) GetLogs(ctx context.Context, req *serverpb.GetLogsRequest) (*serverpb.GetLogsResponse, error)
- func (s *HakjServer) GetServerInfo(ctx context.Context, req *serverpb.GetServerInfoRequest) (*serverpb.GetServerInfoResponse, error)
- func (s *HakjServer) GetString(ctx context.Context, req *kvpb.GetStringRequest) (*kvpb.GetStringResponse, error)
- func (s *HakjServer) GetTLSCredentials() credentials.TransportCredentials
- func (s *HakjServer) Init()
- func (s *HakjServer) Logger() hakjdb.Logger
- func (s *HakjServer) ProcessConfigReload(cfg *config.ServerConfig)
- func (s *HakjServer) ReloadConfig(ctx context.Context, req *serverpb.ReloadConfigRequest) (*serverpb.ReloadConfigResponse, error)
- func (s *HakjServer) SetHashMap(ctx context.Context, req *kvpb.SetHashMapRequest) (*kvpb.SetHashMapResponse, error)
- func (s *HakjServer) SetString(ctx context.Context, req *kvpb.SetStringRequest) (*kvpb.SetStringResponse, error)
- func (s *HakjServer) SetupListener()
- type HashMapKVService
- type ServerService
- type StringKVService
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 ¶
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
type DBService ¶
type DBService interface { CreateDB(ctx context.Context, req *dbpb.CreateDBRequest) (*dbpb.CreateDBResponse, error) DeleteDB(ctx context.Context, req *dbpb.DeleteDBRequest) (*dbpb.DeleteDBResponse, error) GetAllDBs(ctx context.Context, req *dbpb.GetAllDBsRequest) (*dbpb.GetAllDBsResponse, error) GetDBInfo(ctx context.Context, req *dbpb.GetDBInfoRequest) (*dbpb.GetDBInfoResponse, error) ChangeDB(ctx context.Context, req *dbpb.ChangeDBRequest) (*dbpb.ChangeDBResponse, error) }
type GeneralKVService ¶
type GeneralKVService interface { GetAllKeys(ctx context.Context, req *kvpb.GetAllKeysRequest) (*kvpb.GetAllKeysResponse, error) GetKeyType(ctx context.Context, req *kvpb.GetKeyTypeRequest) (*kvpb.GetKeyTypeResponse, error) DeleteKeys(ctx context.Context, req *kvpb.DeleteKeysRequest) (*kvpb.DeleteKeysResponse, error) DeleteAllKeys(ctx context.Context, req *kvpb.DeleteAllKeysRequest) (*kvpb.DeleteAllKeysResponse, 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 (s *HakjServer) Authenticate(ctx context.Context, req *authpb.AuthenticateRequest) (*authpb.AuthenticateResponse, error)
func (*HakjServer) AuthorizeIncomingRpcCall ¶
func (s *HakjServer) AuthorizeIncomingRpcCall(ctx context.Context) error
AuthorizeIncomingRpcCall checks that incoming RPC call provides valid credentials.
func (*HakjServer) ChangeDB ¶
func (s *HakjServer) ChangeDB(ctx context.Context, req *dbpb.ChangeDBRequest) (*dbpb.ChangeDBResponse, error)
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 (s *HakjServer) CreateDB(ctx context.Context, req *dbpb.CreateDBRequest) (*dbpb.CreateDBResponse, error)
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 (s *HakjServer) DeleteAllKeys(ctx context.Context, req *kvpb.DeleteAllKeysRequest) (*kvpb.DeleteAllKeysResponse, error)
func (*HakjServer) DeleteDB ¶
func (s *HakjServer) DeleteDB(ctx context.Context, req *dbpb.DeleteDBRequest) (*dbpb.DeleteDBResponse, error)
func (*HakjServer) DeleteHashMapFields ¶
func (s *HakjServer) DeleteHashMapFields(ctx context.Context, req *kvpb.DeleteHashMapFieldsRequest) (res *kvpb.DeleteHashMapFieldsResponse, err error)
func (*HakjServer) DeleteKeys ¶
func (s *HakjServer) DeleteKeys(ctx context.Context, req *kvpb.DeleteKeysRequest) (*kvpb.DeleteKeysResponse, error)
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 (s *HakjServer) GetAllDBs(ctx context.Context, req *dbpb.GetAllDBsRequest) (*dbpb.GetAllDBsResponse, error)
func (*HakjServer) GetAllHashMapFieldsAndValues ¶
func (s *HakjServer) GetAllHashMapFieldsAndValues(ctx context.Context, req *kvpb.GetAllHashMapFieldsAndValuesRequest) (res *kvpb.GetAllHashMapFieldsAndValuesResponse, err error)
func (*HakjServer) GetAllKeys ¶
func (s *HakjServer) GetAllKeys(ctx context.Context, req *kvpb.GetAllKeysRequest) (*kvpb.GetAllKeysResponse, error)
func (*HakjServer) GetDBInfo ¶
func (s *HakjServer) GetDBInfo(ctx context.Context, req *dbpb.GetDBInfoRequest) (*dbpb.GetDBInfoResponse, error)
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 (s *HakjServer) GetKeyType(ctx context.Context, req *kvpb.GetKeyTypeRequest) (*kvpb.GetKeyTypeResponse, error)
func (*HakjServer) GetLogs ¶
func (s *HakjServer) GetLogs(ctx context.Context, req *serverpb.GetLogsRequest) (*serverpb.GetLogsResponse, error)
func (*HakjServer) GetServerInfo ¶
func (s *HakjServer) GetServerInfo(ctx context.Context, req *serverpb.GetServerInfoRequest) (*serverpb.GetServerInfoResponse, error)
func (*HakjServer) GetString ¶
func (s *HakjServer) GetString(ctx context.Context, req *kvpb.GetStringRequest) (*kvpb.GetStringResponse, error)
func (*HakjServer) GetTLSCredentials ¶ added in v1.1.0
func (s *HakjServer) GetTLSCredentials() credentials.TransportCredentials
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 (s *HakjServer) ReloadConfig(ctx context.Context, req *serverpb.ReloadConfigRequest) (*serverpb.ReloadConfigResponse, error)
func (*HakjServer) SetHashMap ¶
func (s *HakjServer) SetHashMap(ctx context.Context, req *kvpb.SetHashMapRequest) (*kvpb.SetHashMapResponse, error)
func (*HakjServer) SetString ¶
func (s *HakjServer) SetString(ctx context.Context, req *kvpb.SetStringRequest) (*kvpb.SetStringResponse, error)
func (*HakjServer) SetupListener ¶
func (s *HakjServer) SetupListener()
type HashMapKVService ¶
type HashMapKVService interface { SetHashMap(ctx context.Context, req *kvpb.SetHashMapRequest) (*kvpb.SetHashMapResponse, error) GetHashMapFieldValues(ctx context.Context, req *kvpb.GetHashMapFieldValuesRequest) (*kvpb.GetHashMapFieldValuesResponse, error) GetAllHashMapFieldsAndValues(ctx context.Context, req *kvpb.GetAllHashMapFieldsAndValuesRequest) (*kvpb.GetAllHashMapFieldsAndValuesResponse, error) DeleteHashMapFields(ctx context.Context, req *kvpb.DeleteHashMapFieldsRequest) (*kvpb.DeleteHashMapFieldsResponse, error) }
type ServerService ¶
type ServerService interface { GetServerInfo(ctx context.Context, req *serverpb.GetServerInfoRequest) (*serverpb.GetServerInfoResponse, error) GetLogs(ctx context.Context, req *serverpb.GetLogsRequest) (*serverpb.GetLogsResponse, error) ReloadConfig(ctx context.Context, req *serverpb.ReloadConfigRequest) (*serverpb.ReloadConfigResponse, error) }
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) }
Click to show internal directories.
Click to hide internal directories.