handler

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: ISC Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRLF = "\r\n"
	TAB  = byte('\t')
)

Variables

This section is empty.

Functions

func ServeConnHandlerCommonGetTextTemplatesFuncMap

func ServeConnHandlerCommonGetTextTemplatesFuncMap(c *ttconn.Connection) (map[string]interface{}, error)

func SimpleTextServeConnHandlerCustomProcess

func SimpleTextServeConnHandlerCustomProcess(
	h SimpleTextServeConnHandler,
	conn *ttconn.Connection,
	route string,
	extraData interface{},
	forceCacheUpdate bool,
	errCodeMap map[string][]byte) (output interface{}, err error)

func SimpleTextServeConnHandlerDefaultGetTemplatesFuncMap

func SimpleTextServeConnHandlerDefaultGetTemplatesFuncMap(conn *ttconn.Connection) (tplFunc map[string]interface{}, err error)

func SimpleTextServeConnHandlerDefaultParseData

func SimpleTextServeConnHandlerDefaultParseData(conn *ttconn.Connection, inbuf []byte) (route string, extraData interface{}, err error)

func SimpleTextServeConnHandlerDefaultProcess

func SimpleTextServeConnHandlerDefaultProcess(conn *ttconn.Connection, route string, routeExtraData interface{}, forceCacheUpdate bool) (output interface{}, err error)

func SimpleTextServeConnHandlerDefaultRead

func SimpleTextServeConnHandlerDefaultRead(conn *ttconn.Connection) (input []byte, err error)

func SimpleTextServeConnHandlerDefaultRegisterMetrics

func SimpleTextServeConnHandlerDefaultRegisterMetrics() error

func SimpleTextServeConnHandlerDefaultServeConn

func SimpleTextServeConnHandlerDefaultServeConn(h SimpleTextServeConnHandler, conn *ttconn.Connection) error

func SimpleTextServeConnHandlerDefaultServeCrontab

func SimpleTextServeConnHandlerDefaultServeCrontab(h SimpleTextServeConnHandler, conn *ttconn.Connection, route string, routeExtraData interface{}) error

func SimpleTextServeConnHandlerDefaultWrite

func SimpleTextServeConnHandlerDefaultWrite(conn *ttconn.Connection, output interface{}) (n int64, err error)

Types

type IServeConnHandler

type IServeConnHandler interface {
	// what to do with a new connection
	ServeConn(conn *ttconn.Connection) error

	// what to do with a new connection from the cron server
	ServeCrontab(conn *ttconn.Connection, route string, routeExtraData interface{}) error

	// retrieve a specifiv template functions map
	GetTemplatesFuncMap(conn *ttconn.Connection) (tplFunc map[string]interface{}, err error)

	// register new specific metrics
	RegisterPrometheusMetrics() error
}

type SimpleTextServeConnHandler

type SimpleTextServeConnHandler interface {
	// inherited from IServeConnHandler
	ServeConn(conn *ttconn.Connection) error

	ServeCrontab(conn *ttconn.Connection, route string, routeExtraData interface{}) error

	GetTemplatesFuncMap(conn *ttconn.Connection) (tplFunc map[string]interface{}, err error)
	RegisterPrometheusMetrics() error

	// specific
	Read(conn *ttconn.Connection) (input []byte, err error)
	ParseData(conn *ttconn.Connection, input []byte) (route string, routeExtraData interface{}, err error)

	Process(conn *ttconn.Connection, route string, routeExtraData interface{}, forceCacheUpdate bool) (output interface{}, err error)
	PostProcess(conn *ttconn.Connection, route string, routeExtraData interface{}, input interface{}) (output interface{}, err error)

	Write(conn *ttconn.Connection, output interface{}) (n int64, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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