handle

package
v0.0.0-...-28fadcf Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package handle deals with the commands(get/set ...)

Index

Constants

View Source
const (
	ADD_STRING = iota + 1
	ADD_STRING_RES
	DEL_KEY
	DEL_KEY_RES
	QUERY_KEY
	QUERY_KEY_RES
	KEEPALIVE
	KEEPALIVE_RES
	HELLO
	HELLO_RES
	ADD_DB
	ADD_DB_RES
)

for access request msg format

View Source
const (
	KEYHASHMAX = 1024 * 8
)

Variables

View Source
var (
	// Caches to store k/v
	Caches *hashmap.Dbs
	//GstartTime saves app's start time
	GstartTime = time.Now().Unix()
)

Functions

func Init

func Init()

Init get the default caches which has been initialised.

func Read

func Read(conn *net.TCPConn, data []byte) error

Read Wrapper conn.Read

func SessionHash

func SessionHash(data []byte) int

func Start

func Start(port int)

Start run a tcp server

func Write

func Write(conn *net.TCPConn, data []byte) error

Write wrapper conn.Write

Types

type FusionError

type FusionError string

func (FusionError) Error

func (err FusionError) Error() string

Jump to

Keyboard shortcuts

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