Documentation ¶
Index ¶
Constants ¶
View Source
const ( EnableWriteTrue = int32(1) EnableWriteFalse = int32(0) )
Variables ¶
This section is empty.
Functions ¶
func NewCacheManager ¶
func NewCacheManager() *cacheManager
Types ¶
type FSM ¶
type FSM struct { Ctx *StCachedContext Log *log.Logger }
FSM : finite state machine,有限状态机
type HttpServer ¶
func NewHttpServer ¶
func NewHttpServer(ctx *StCachedContext, log *log.Logger) *HttpServer
func (*HttpServer) SetWriteFlag ¶
func (h *HttpServer) SetWriteFlag(flag bool)
type LogEntryData ¶
type Options ¶
type Options struct { HttpAddress string // http server address RaftTCPAddress string // construct Raft Address JoinAddress string // peer address to join // contains filtered or unexported fields }
func NewOptions ¶
func NewOptions() *Options
type RaftNodeInfo ¶
type RaftNodeInfo struct { Raft *raft.Raft LeaderNotifyCh chan bool // contains filtered or unexported fields }
func NewRaftNode ¶
func NewRaftNode(opts *Options, ctx *StCachedContext) (*RaftNodeInfo, error)
type Snapshot ¶
type Snapshot struct {
Cm *cacheManager
}
type StCached ¶
type StCached struct { Hs *HttpServer Opts *Options Log *log.Logger Cm *cacheManager Raft *RaftNodeInfo }
type StCachedContext ¶
type StCachedContext struct {
St *StCached
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.