redix

package
v1.2.1-0...-88aa64f Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

View Source
var (
	Commands = map[string]CommandHandler{

		"set":    setCommand,
		"mset":   msetCommand,
		"get":    getCommand,
		"mget":   mgetCommand,
		"del":    delCommand,
		"exists": existsCommand,
		"incr":   incrCommand,
		"ttl":    ttlCommand,
		"keys":   keysCommand,

		"lpush":      lpushCommand,
		"lpushu":     lpushuCommand,
		"lrange":     lrangeCommand,
		"lrem":       lremCommand,
		"lcount":     lcountCommand,
		"lcard":      lcountCommand,
		"lsum":       lsumCommand,
		"lavg":       lavgCommand,
		"lmin":       lminCommand,
		"lmax":       lmaxCommand,
		"lsrch":      lsearchCommand,
		"lsrchcount": lsearchcountCommand,

		"sadd":     lpushuCommand,
		"smembers": lrangeCommand,
		"srem":     lremCommand,
		"scard":    lcountCommand,
		"sscan":    lrangeCommand,

		"hset":    hsetCommand,
		"hget":    hgetCommand,
		"hdel":    hdelCommand,
		"hgetall": hgetallCommand,
		"hkeys":   hkeysCommand,
		"hmset":   hmsetCommand,
		"hexists": hexistsCommand,
		"hincr":   hincrCommand,
		"httl":    httlCommand,
		"hlen":    hlenCommand,

		"publish":        publishCommand,
		"subscribe":      subscribeCommand,
		"webhookset":     webhooksetCommand,
		"webhookdel":     webhookdelCommand,
		"websocketopen":  websocketopenCommand,
		"websocketclose": websocketcloseCommand,

		"encode":   encodeCommand,
		"uuidv4":   uuid4Command,
		"uniqid":   uniqidCommand,
		"randstr":  randstrCommand,
		"randint":  randintCommand,
		"time":     timeCommand,
		"dbsize":   dbsizeCommand,
		"gc":       gcCommand,
		"info":     infoCommand,
		"echo":     echoCommand,
		"flushdb":  flushdbCommand,
		"flushall": flushallCommand,

		"ratelimitset":  ratelimitsetCommand,
		"ratelimittake": ratelimittakeCommand,
		"ratelimitget":  ratelimitgetCommand,
	}
)

Functions

func Engine

func Engine() string

func FlushDB

func FlushDB(n string)

FlushDB clear the specified database

func Flushall

func Flushall()

Flushall clear all databases

func GetEngineDirectory

func GetEngineDirectory() string

func GetUniqueInt

func GetUniqueInt() int64

returns a unique int

func GetUniqueString

func GetUniqueString() string

returns a unique string

func HttpAddr

func HttpAddr() string

func InitHTTPServer

func InitHTTPServer() error

func InitRespServer

func InitRespServer(listenAddr, dbpath string) error

func OpenDB

func OpenDB(n string) (kvstore.DB, error)

OpenDB - initialize a db in the specified path and engine

func RESPAddr

func RESPAddr() string

func RemoveTag

func RemoveTag(k string) string

func Rmdir

func Rmdir(dir string) error

func SelectDB

func SelectDB(n string) (db kvstore.DB, err error)

SelectDB - load/fetches the requested db

func SetBadgerMemory

func SetBadgerMemory(size int64)

func SetEngine

func SetEngine(engine string)

func SetStorageDir

func SetStorageDir(dir string)

func StorageDir

func StorageDir() string

func Worker

func Worker() int

Types

type Change

type Change struct {
	Namespace string   `json:"namespace"`
	Command   string   `json:"command"`
	Arguments []string `json:"arguments"`
}

Change - a change feed

type CommandHandler

type CommandHandler func(c Context)

CommandHandler - represents a handler for a command

type Context

type Context struct {
	redcon.Conn
	// contains filtered or unexported fields
}

Context - represents a handler context

Jump to

Keyboard shortcuts

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