controller

package
v0.0.0-...-652815c Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: MIT Imports: 47 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) []string

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

func (*Controller) Publish

func (c *Controller) Publish(channel string, message ...string) int

Publish a message to subscribers

type FenceMeta

type FenceMeta struct {
	Name, Value string
}

FenceMeta is a meta key/value pair for fences

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

Equals returns true if two hooks are equal

func (*Hook) Expires

func (h *Hook) Expires() time.Time

Expires returns when the hook expires. Required by the expire.Item interface.

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
}

Jump to

Keyboard shortcuts

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