storage

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetArgs

type GetArgs struct {
	Key string
}

type GetReply

type GetReply struct {
	Value []byte
	Error string
}

type RespServer

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

func NewRespServer

func NewRespServer(addr string, maxConn int, replicaAddrs []string) (*RespServer, error)

func (*RespServer) AddReplica

func (rs *RespServer) AddReplica(addr string, maxConn int) error

AddReplica safely adds a new replica to the server

func (*RespServer) Close

func (rs *RespServer) Close() error

func (*RespServer) Get

func (rs *RespServer) Get(key string) (interface{}, error)

func (*RespServer) RemoveReplica

func (rs *RespServer) RemoveReplica(addr string) error

RemoveReplica safely removes a replica from the server

func (*RespServer) SetEx

func (rs *RespServer) SetEx(key string, ttl int, value string) (int, error)

type SetArgs

type SetArgs struct {
	Key   string
	Value []byte
	TTL   *int // optional TTL in seconds
}

type SetReply

type SetReply struct {
	Error string
}

Jump to

Keyboard shortcuts

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