handler_socket2

package
v0.0.0-...-eecacf2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_COMPRESSION_THRESHOLD = 4096

Variables

View Source
var Config = new(cfg)

Functions

func CfgIsDebug

func CfgIsDebug() bool

func CfgIsVerbose

func CfgIsVerbose() bool

func GetStatus

func GetStatus() map[string]string

func GetStatusHTTP

func GetStatusHTTP() string

func GetStatusUDP

func GetStatusUDP() string

func ReadHSParams

func ReadHSParams(message []byte, out_params *HSParams) []byte

func RegisterHandler

func RegisterHandler(handlers ...ActionHandler)

func StartServer

func StartServer(bind_to []string)

func StatusPluginRegister

func StatusPluginRegister(f StatusPlugin)

Types

type ActionHandler

type ActionHandler interface {
	Initialize()
	Info() string
	GetActions() []string
	HandleAction(action string, data *HSParams) string
}

type HSParams

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

func CreateHSParams

func CreateHSParams() *HSParams

func CreateHSParamsFromMap

func CreateHSParamsFromMap(data map[string]string) *HSParams

func (*HSParams) Allocate

func (p *HSParams) Allocate(size int) []byte

func (*HSParams) Cleanup

func (p *HSParams) Cleanup()

func (*HSParams) FastReturnB

func (p *HSParams) FastReturnB(set []byte)

func (*HSParams) FastReturnBNocopy

func (p *HSParams) FastReturnBNocopy(set []byte)

func (*HSParams) FastReturnS

func (p *HSParams) FastReturnS(set string)

func (*HSParams) GetAllocator

func (p *HSParams) GetAllocator() *byteslabs.Allocator

func (*HSParams) GetParam

func (p *HSParams) GetParam(attr string, def string) string

func (*HSParams) GetParamA

func (p *HSParams) GetParamA(attr string, separator string) []string

func (*HSParams) GetParamBUnsafe

func (p *HSParams) GetParamBUnsafe(attr string, def []byte) []byte

this is not safe because it can use memory shared between requests, so we can't keep this after request is over!

func (*HSParams) GetParamI

func (p *HSParams) GetParamI(attr string, def int) int

func (*HSParams) GetParamIA

func (p *HSParams) GetParamIA(attr string) []int

func (*HSParams) GetParamsS

func (p *HSParams) GetParamsS() map[string]string

func (*HSParams) SetParam

func (p *HSParams) SetParam(attr string, val string)

func (*HSParams) SetRespHeader

func (p *HSParams) SetRespHeader(attr, val string)

type StatusPlugin

type StatusPlugin func() (string, string)

type TimeSpan

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

func NewTimeSpan

func NewTimeSpan() *TimeSpan

func (*TimeSpan) Get

func (ts *TimeSpan) Get() string

func (*TimeSpan) GetRaw

func (ts *TimeSpan) GetRaw() float64

Directories

Path Synopsis
snappy
Package snappy implements the Snappy compression format.
Package snappy implements the Snappy compression format.

Jump to

Keyboard shortcuts

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