Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // ListenCommand listens the input from terminal and executes the command. ListenCommand() error // Close closes the tcp connection to the database server. Close() error }
Client defines the related functions of the database server.
func NewCli ¶
func NewCli(config *ClientConfig) (Client, error)
NewCli creates a single-client of KhighDB.
type ClientConfig ¶
ClientConfig defines the structure of the client configuration.
type KhighClient ¶
KhighClient defines the structure of the KhighDB client.
func (*KhighClient) Close ¶
func (client *KhighClient) Close() error
Close closes the tcp connection to KhighServer.
func (*KhighClient) ListenCommand ¶
func (client *KhighClient) ListenCommand() error
ListenCommand listens the input from terminal and executes the command.
type KhighServer ¶
type KhighServer struct {
// contains filtered or unexported fields
}
KhighServer defines the structure of the KhighDB server.
func (*KhighServer) GetSignal ¶
func (server *KhighServer) GetSignal() chan os.Signal
GetSignal returns the KhighServer's signal channel.
func (*KhighServer) Listen ¶
func (server *KhighServer) Listen()
Listen starts the KhighServer to listen for KhighClient's connections.
func (*KhighServer) Stop ¶
func (server *KhighServer) Stop()
Stop stops the KhighServer, closes the connections to KhighClient and the opened databases.
type Server ¶
type Server interface { // Listen starts the Server to listen for connections. Listen() // Stop closes the resources and the connections to client. Stop() // GetSignal returns the Servers's signal channel. GetSignal() chan os.Signal }
Server defines the related functions of the database server.
func NewServer ¶
func NewServer(config *ServerConfig) Server
NewServer initializes and returns a KhighServer instance.