routing

package
v0.0.0-...-18cb903 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2014 License: BSD-2-Clause-Views Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datapoint

type Datapoint struct {
	Name string
	Val  float64
	Time uint32
}

type Route

type Route struct {
	// basic properties in init and copy
	Key  string // to identify in stats/logs
	Patt string // regex string
	Addr string // tcp dest

	Spool  bool // spool metrics to disk while endpoint down?
	Pickle bool // send in pickle format?
	Online bool // state of connection online/offline

	// set automatically in init, passed on in copy
	Reg *regexp.Regexp // compiled version of patt
	// contains filtered or unexported fields
}

func NewRoute

func NewRoute(key, patt, addr, spoolDir string, spool, pickle bool, instrument *statsd.Client) (*Route, error)

after creating, run Run()!

func (*Route) Copy

func (route *Route) Copy() *Route

a "basic" static copy of the route, not actually running

func (*Route) Run

func (route *Route) Run() (err error)

func (*Route) Shutdown

func (route *Route) Shutdown() error

type Routes

type Routes struct {
	Map map[string]*Route

	SpoolDir string
	// contains filtered or unexported fields
}

func NewRoutes

func NewRoutes(routeDefsMap map[string]*Route, spoolDir string, instrument *statsd.Client) (routes *Routes, err error)

func (*Routes) Add

func (routes *Routes) Add(key, patt, addr string, spool, pickle bool, instrument *statsd.Client) error

func (*Routes) Del

func (routes *Routes) Del(key string) error

func (*Routes) Dispatch

func (routes *Routes) Dispatch(buf []byte, first_only bool) (routed bool)

func (*Routes) List

func (routes *Routes) List() map[string]Route

func (*Routes) Run

func (routes *Routes) Run() error

not thread safe, run this once only

func (*Routes) Update

func (routes *Routes) Update(key string, addr, patt *string) error

Jump to

Keyboard shortcuts

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