handler

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// name of the command
	Name resp.BulkString

	// number of arguments
	// positive value means fixed number of arguments
	// negative value means at least that number of arguments
	Args int

	// handler of the command
	Handler func(command resp.Array) (resp.Payload, error)
}

type CommandTable

type CommandTable struct {
	// contains filtered or unexported fields
}

func NewCommandTable

func NewCommandTable() *CommandTable

func (*CommandTable) Get

func (c *CommandTable) Get(name resp.BulkString) (*Command, bool)

func (*CommandTable) MustRegister

func (c *CommandTable) MustRegister(command *Command)

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func New

func New(logger *slog.Logger, s store.Store) *Handler

func (*Handler) Serve

func (h *Handler) Serve(conn net.Conn)

Jump to

Keyboard shortcuts

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