cheryl

package
v0.0.0-...-be629c2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENABLE_WRITE_TRUE  = int32(1)
	ENABLE_WRITE_FALSE = int32(0)
)

Variables

View Source
var HealthCheckTimeout = 5 * time.Second
View Source
var (
	HttpProxyNotExistsError = errors.New("HttpProxy not exists")
)

Functions

func Start

func Start(conf *config.CherylConfig)

Types

type AclLog

type AclLog struct {
	Pattern   byte
	IpAddress string
}

type FSM

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

func (*FSM) Apply

func (f *FSM) Apply(logEntry *raft.Log) interface{}

func (*FSM) Restore

func (f *FSM) Restore(serialized io.ReadCloser) error

func (*FSM) Snapshot

func (f *FSM) Snapshot() (raft.FSMSnapshot, error)

type HostLog

type HostLog struct {
	Pattern string
	Host    string
}

type HttpServer

type HttpServer struct {
	Mux *http.ServeMux
	Ctx *StateContext
	// contains filtered or unexported fields
}

func (*HttpServer) SetWriteFlag

func (h *HttpServer) SetWriteFlag(flag bool)

type LogEntry

type LogEntry struct {
	Opt  uint16
	Data []byte
}

func (*LogEntry) Decode

func (l *LogEntry) Decode(data []byte) error

func (*LogEntry) Encode

func (l *LogEntry) Encode() ([]byte, error)

type R

type R struct {
	Code int                    `json:"code"`
	Msg  string                 `json:"msg"`
	Data map[string]interface{} `json:"data"`
}

func Error

func Error(c int, m string) *R

func Ok

func Ok() *R

func (*R) Marshal

func (res *R) Marshal() []byte

func (*R) Put

func (res *R) Put(name string, value interface{}) *R

type State

type State struct {
	ProxyMap *reverseproxy.ProxyMap
	RaftNode *raftNodeInfo
	Hs       *HttpServer
}
var (
	LeaderCheckTimeout = 10 * time.Second
	Context            *State
)

type StateContext

type StateContext struct {
	State *State
}

Jump to

Keyboard shortcuts

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