controller

package
v0.0.0-...-4c67558 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2018 License: MIT Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FollowHost    = "follow_host"
	FollowPort    = "follow_port"
	FollowID      = "follow_id"
	FollowPos     = "follow_pos"
	ServerID      = "server_id"
	ReadOnly      = "read_only"
	RequirePass   = "requirepass"
	LeaderAuth    = "leaderauth"
	ProtectedMode = "protected-mode"
	MaxMemory     = "maxmemory"
	AutoGC        = "autogc"
	KeepAlive     = "keepalive"
)

Variables

This section is empty.

Functions

func ConvertToJSON

func ConvertToJSON(val lua.LValue) string

ConvertToJSON converts lua LValue to JSON string

func ConvertToLua

func ConvertToLua(L *lua.LState, val resp.Value) lua.LValue

ConvertToLua converts RESP value to lua LValue

func ConvertToRESP

func ConvertToRESP(val lua.LValue) resp.Value

ConvertToRESP convert lua LValue to RESP value

func FenceMatch

func FenceMatch(hookName string, sw *scanWriter, fence *liveFenceSwitches, metas []FenceMeta, details *commandDetailsT) [][]byte

FenceMatch executes a fence match returns back json messages for fence detection.

func ListenAndServe

func ListenAndServe(host string, port int, dir string, http bool) error

ListenAndServe starts a new tile38 server

func ListenAndServeEx

func ListenAndServeEx(host string, port int, dir string, ln *net.Listener, http bool) error

func Sha1Sum

func Sha1Sum(s string) string

Sha1Sum returns a string with hex representation of sha1 sum of a given string

Types

type Config

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

Config is a tile38 config

type Conn

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

Conn represents a simple resp connection.

func DialTimeout

func DialTimeout(address string, timeout time.Duration) (*Conn, error)

DialTimeout dials a resp server.

func (*Conn) Close

func (conn *Conn) Close() error

Close closes the connection.

func (*Conn) Do

func (conn *Conn) Do(commandName string, args ...interface{}) (val resp.Value, err error)

Do performs a command and returns a resp value.

type Controller

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

Controller is a tile38 controller

func (*Controller) NewPool

func (c *Controller) NewPool() *lStatePool

NewPool returns a new pool of lua states

func (*Controller) NewScriptMap

func (c *Controller) NewScriptMap() *lScriptMap

NewScriptMap returns a new map with lua scripts

type FenceMeta

type FenceMeta struct {
	Name, Value string
}

type Hook

type Hook struct {
	Key        string
	Name       string
	Endpoints  []string
	Message    *server.Message
	Fence      *liveFenceSwitches
	ScanWriter *scanWriter
	Metas      []FenceMeta
	// contains filtered or unexported fields
}

Hook represents a hook.

func (*Hook) Close

func (h *Hook) Close()

Close closed the hook and stop the manager function

func (*Hook) Equals

func (h *Hook) Equals(hook *Hook) bool

func (*Hook) Open

func (h *Hook) Open()

Open is called when a hook is first created. It calls the manager function in a goroutine

func (*Hook) Signal

func (h *Hook) Signal()

Signal can be called at any point to wake up the hook and notify the manager that there may be something new in the queue.

type LegacyAOFReader

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

LegacyAOFReader represents the older AOF file reader.

func NewLegacyAOFReader

func NewLegacyAOFReader(r io.Reader) *LegacyAOFReader

NewLegacyAOFReader creates a new LegacyAOFReader.

func (*LegacyAOFReader) ReadCommand

func (rd *LegacyAOFReader) ReadCommand() ([]byte, error)

ReadCommand reads an old command.

type ScanWriterParams

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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