handler

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoderSort

type CoderSort int
const (
	SortASC CoderSort = iota
	SortDESC
)

type Container

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

func NewContainer

func NewContainer() (container *Container)

func (*Container) FirstHandler

func (c *Container) FirstHandler(sort CoderSort) (handler Handler, meta Meta, ctx *Context, err error)

func (*Container) Get

func (c *Container) Get(name string) (handler Handler, meta Meta, ctx *Context, err error)

func (Container) HasNext

func (c Container) HasNext(meta Meta, sort CoderSort) bool

func (*Container) Next

func (c *Container) Next(currentMeta Meta, sort CoderSort) (handler Handler, meta Meta, ctx *Context, err error)

func (*Container) Register

func (c *Container) Register(handler Handler, meta ...Meta) (err error)

func (*Container) RegisterHandlers

func (c *Container) RegisterHandlers(handlers ...Handler) (err error)

type Context

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

func NewContext

func NewContext(rxCapacity int, txCapacity int) *Context

func (*Context) RxLen

func (ccb *Context) RxLen() int

func (*Context) RxRead

func (ccb *Context) RxRead() (data interface{}, err error)

func (*Context) RxWrite

func (ccb *Context) RxWrite(data interface{})

func (*Context) TxLen

func (ccb *Context) TxLen() int

func (*Context) TxRead

func (ccb *Context) TxRead() (data interface{}, err error)

func (*Context) TxWrite

func (ccb *Context) TxWrite(data interface{})

type Handler

type Handler interface {
	Rx(input interface{}, ctx *Context) (err error)
	Tx(input interface{}, ctx *Context) (err error)
}

type Meta

type Meta struct {
	DisableTx bool
	DisableRx bool
	// contains filtered or unexported fields
}

define

func (Meta) Index

func (c Meta) Index() int

type RxContainer

type RxContainer struct {
	Container
}

func (*RxContainer) NextHandler

func (c *RxContainer) NextHandler(currentMeta Meta) (handler Handler, meta Meta, ctx *Context, err error)

type TxContainer

type TxContainer struct {
	Container
}

func (*TxContainer) NextHandler

func (c *TxContainer) NextHandler(currentMeta Meta) (handler Handler, meta Meta, ctx *Context, err error)

Jump to

Keyboard shortcuts

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