server

package
v0.0.0-...-3137008 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

func NewCluster

func NewCluster() (cluster *Cluster)

type HashMapStore

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

func (*HashMapStore) Delete

func (kv *HashMapStore) Delete(key string) bool

func (*HashMapStore) Get

func (kv *HashMapStore) Get(key string) (string, bool)

func (*HashMapStore) Put

func (kv *HashMapStore) Put(key string, value string) bool

type KeyValueStore

type KeyValueStore interface {
	Put(key string, value string) bool
	Get(key string) (string, bool)
	Delete(key string) bool
}

type LevelDBStore

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

func (*LevelDBStore) Delete

func (kv *LevelDBStore) Delete(key string) bool

func (LevelDBStore) Get

func (kv LevelDBStore) Get(key string) (string, bool)

func (*LevelDBStore) Put

func (kv *LevelDBStore) Put(key string, value string) bool

type NodeRole

type NodeRole int
const (
	Follower NodeRole = iota
	Candidate
	Leader
)

type RaftHeartbeat

type RaftHeartbeat struct {
	Term   int    `json:"term"`
	NodeIP string `json:"nodeIP"`
}

type RaftState

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

func NewRaftState

func NewRaftState(nodes *[]string) (state *RaftState)

type RaftVoteResponse

type RaftVoteResponse struct {
	Term         int  `json:"term"`
	VotedInFavor bool `json:"votedInFavor"`
}

type ReplicationMode

type ReplicationMode int
const (
	NoReplication ReplicationMode = iota
	SingleLeaderReplication
	LeaderlessReplication
)

type SSTableStore

type SSTableStore struct {
}

type Server

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

func NewHTTPServer

func NewHTTPServer(engine string, replMode string, diskDBPath string) *Server

func (*Server) HandleFastHTTP

func (server *Server) HandleFastHTTP(ctx *fasthttp.RequestCtx)

Jump to

Keyboard shortcuts

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