Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertToJSON(val lua.LValue) string
- func ConvertToLua(L *lua.LState, val resp.Value) lua.LValue
- func ConvertToRESP(val lua.LValue) resp.Value
- func Default[T comparable](a, b T) T
- func FenceMatch(hookName string, sw *scanWriter, fence *liveFenceSwitches, metas []FenceMeta, ...) []string
- func Must[T any](a T, err error) T
- func OKMessage(msg *Message, start time.Time) resp.Value
- func Serve(opts Options) error
- func Sha1Sum(s string) string
- func WriteWebSocketMessage(w io.Writer, data []byte) error
- type BinaryOp
- type Client
- type Config
- type FenceMeta
- type Hook
- type InputStream
- type LegacyAOFReader
- type Message
- type Options
- type PipelineReader
- type RESPConn
- type ScanWriterParams
- type Server
- func (s *Server) Collect(ch chan<- prometheus.Metric)
- func (s *Server) Describe(ch chan<- *prometheus.Desc)
- func (s *Server) MetricsHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) MetricsIndexHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) Publish(channel string, message ...string) int
- type Type
Constants ¶
const ( FollowHost = "follow_host" FollowPort = "follow_port" FollowID = "follow_id" FollowPos = "follow_pos" ReplicaPriority = "replica-priority" ServerID = "server_id" ReadOnly = "read_only" RequirePass = "requirepass" LeaderAuth = "leaderauth" ProtectedMode = "protected-mode" MaxMemory = "maxmemory" AutoGC = "autogc" KeepAlive = "keepalive" LogConfig = "logconfig" AnnounceIP = "replica_announce_ip" AnnouncePort = "replica_announce_port" )
Config keys
Variables ¶
var NOMessage = resp.SimpleStringValue("")
NOMessage is no message
Functions ¶
func ConvertToJSON ¶
ConvertToJSON converts lua LValue to JSON string
func ConvertToLua ¶
ConvertToLua converts RESP value to lua LValue
func ConvertToRESP ¶
ConvertToRESP convert lua LValue to RESP value
func Default ¶
func Default[T comparable](a, b T) T
func FenceMatch ¶
func FenceMatch(hookName string, sw *scanWriter, fence *liveFenceSwitches, metas []FenceMeta, details *commandDetails) []string
FenceMatch executes a fence match returns back json messages for fence detection.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an remote connection into to Tile38
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is a tile38 config
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 *Message Fence *liveFenceSwitches ScanWriter *scanWriter Metas []FenceMeta // contains filtered or unexported fields }
Hook represents a hook.
func (*Hook) Expires ¶
Expires returns when the hook expires. Required by the expire.Item interface.
type InputStream ¶
type InputStream struct {
// contains filtered or unexported fields
}
InputStream is a helper type for managing input streams from inside the Data event.
func (*InputStream) Begin ¶
func (is *InputStream) Begin(packet []byte) (data []byte)
Begin accepts a new packet and returns a working sequence of unprocessed bytes.
func (*InputStream) End ¶
func (is *InputStream) End(data []byte)
End shifts the stream to match the unprocessed data.
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 Message ¶
type Message struct { Args []string ConnType Type OutputType Type Auth string Deadline *deadline.Deadline // contains filtered or unexported fields }
Message is a resp message
type Options ¶
type Options struct { Host string Port int Dir string UseHTTP bool MetricsAddr string UnixSocketPath string // path for unix socket // DevMode puts application in to dev mode DevMode bool // ShowDebugMessages allows for log.Debug to print to console. ShowDebugMessages bool // ProtectedMode forces Tile38 to default in protected mode. ProtectedMode string // AppendOnly allows for disabling the appendonly file. AppendOnly bool // AppendFileName allows for custom appendonly file path AppendFileName string // QueueFileName allows for custom queue.db file path QueueFileName string // Shutdown allows for shutting down the server. Shutdown <-chan bool }
Options for Serve()
type PipelineReader ¶
type PipelineReader struct {
// contains filtered or unexported fields
}
PipelineReader ...
func NewPipelineReader ¶
func NewPipelineReader(rd io.ReadWriter) *PipelineReader
NewPipelineReader ...
func (*PipelineReader) ReadMessages ¶
func (rd *PipelineReader) ReadMessages() ([]*Message, error)
ReadMessages ...
type RESPConn ¶
type RESPConn struct {
// contains filtered or unexported fields
}
RESPConn represents a simple resp connection.
func DialTimeout ¶
DialTimeout dials a resp
type ScanWriterParams ¶
type ScanWriterParams struct {
// contains filtered or unexported fields
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a tile38 controller
func (*Server) Collect ¶
func (s *Server) Collect(ch chan<- prometheus.Metric)
func (*Server) Describe ¶
func (s *Server) Describe(ch chan<- *prometheus.Desc)
func (*Server) MetricsHandler ¶
func (s *Server) MetricsHandler(w http.ResponseWriter, r *http.Request)
func (*Server) MetricsIndexHandler ¶
func (s *Server) MetricsIndexHandler(w http.ResponseWriter, r *http.Request)
Source Files ¶
- aof.go
- aofmigrate.go
- aofshrink.go
- bson.go
- checksum.go
- client.go
- config.go
- crud.go
- dev.go
- expire.go
- expr.go
- expression.go
- fence.go
- follow.go
- group.go
- hooks.go
- json.go
- keys.go
- live.go
- metrics.go
- monitor.go
- must.go
- output.go
- pubqueue.go
- pubsub.go
- readonly.go
- respconn.go
- scan.go
- scanner.go
- scripts.go
- search.go
- server.go
- stats.go
- stats_cpu_darlin.go
- test.go
- token.go