server

package
v0.0.0-...-199710d Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package server contains the main server code, including RESP handling and high-level database operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(version string)

Serve the database over network.

Types

type Handler

type Handler struct {
	Mux    *redcon.ServeMux
	Server *redcon.Server
	// contains filtered or unexported fields
}

Handler is the main server connection handler.

func NewHandler

func NewHandler(version, addr, hostname, datadir string, s *serf.Serf, eventsCh chan serf.Event) (*Handler, error)

NewHandler initialized the server Handler.

func (*Handler) Register

func (h *Handler) Register(
	command string,
	handler redcon.HandlerFunc,
	arity int,
	flags []string,
	firstKey int,
	lastKey int,
	stepKey int,
	categories []string,
	tips []string,
) *Handler

Register command into RESP handler with given handler and usage information for the command.

func (*Handler) RegisterChild

func (h *Handler) RegisterChild(
	command string,
	arity int,
	flags []string,
	firstKey int,
	lastKey int,
	stepKey int,
	categories []string,
	tips []string,
) *Handler

RegisterChild registers sub-command's usage information only. Handler for parent command needs to handle the sub-command call!

func (*Handler) Stop

func (h *Handler) Stop(done chan bool)

Stop handling connection and close database.

Jump to

Keyboard shortcuts

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