router

package
v0.0.0-...-83a2926 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2015 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpStreamer

func HttpStreamer(w http.ResponseWriter, req *http.Request, logstream chan *Log, multi bool)

func WebsocketStreamer

func WebsocketStreamer(w http.ResponseWriter, req *http.Request, logstream chan *Log, closer chan bool)

Types

type AttachEvent

type AttachEvent struct {
	Type string
	ID   string
	Name string
}

type AttachManager

type AttachManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}
var Attacher *AttachManager

func NewAttachManager

func NewAttachManager(client *docker.Client) *AttachManager

func (*AttachManager) Get

func (m *AttachManager) Get(id string) *LogPump

func (*AttachManager) Listen

func (m *AttachManager) Listen(source *Source, logstream chan *Log, closer <-chan bool)

type Colorizer

type Colorizer map[string]int

func (Colorizer) Get

func (c Colorizer) Get(key string) string

returns up to 14 color escape codes (then repeats) for each unique key

type IgnorantWriter

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

func (IgnorantWriter) Write

func (w IgnorantWriter) Write(p []byte) (int, error)

type Log

type Log struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
	Data string `json:"data"`
}

type LogPump

type LogPump struct {
	sync.Mutex
	ID   string
	Name string
	// contains filtered or unexported fields
}

func NewLogPump

func NewLogPump(stdout, stderr io.Reader, id, name string) *LogPump

func (*LogPump) AddListener

func (o *LogPump) AddListener(ch chan *Log)

func (*LogPump) RemoveListener

func (o *LogPump) RemoveListener(ch chan *Log)

type Route

type Route struct {
	ID     string  `json:"id"`
	Source *Source `json:"source,omitempty"`
	Target Target  `json:"target"`
	// contains filtered or unexported fields
}

type RouteFileStore

type RouteFileStore string

func (RouteFileStore) Add

func (fs RouteFileStore) Add(route *Route) error

func (RouteFileStore) Filename

func (fs RouteFileStore) Filename(id string) string

func (RouteFileStore) Get

func (fs RouteFileStore) Get(id string) (*Route, error)

func (RouteFileStore) GetAll

func (fs RouteFileStore) GetAll() ([]*Route, error)

func (RouteFileStore) Remove

func (fs RouteFileStore) Remove(id string) bool

type RouteManager

type RouteManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}
var Router *RouteManager

func NewRouteManager

func NewRouteManager(attacher *AttachManager) *RouteManager

func (*RouteManager) Add

func (rm *RouteManager) Add(route *Route) error

func (*RouteManager) Get

func (rm *RouteManager) Get(id string) (*Route, error)

func (*RouteManager) GetAll

func (rm *RouteManager) GetAll() ([]*Route, error)

func (*RouteManager) Load

func (rm *RouteManager) Load(persistor RouteStore) error

func (*RouteManager) Remove

func (rm *RouteManager) Remove(id string) bool

type RouteStore

type RouteStore interface {
	Get(id string) (*Route, error)
	GetAll() ([]*Route, error)
	Add(route *Route) error
	Remove(id string) bool
}

type Source

type Source struct {
	ID     string   `json:"id,omitempty"`
	Name   string   `json:"name,omitempty"`
	Prefix string   `json:"prefix,omitempty"`
	Filter string   `json:"filter,omitempty"`
	Types  []string `json:"types,omitempty"`
}

func (*Source) All

func (s *Source) All() bool

type Target

type Target struct {
	Type           string `json:"type"`
	Addr           string `json:"addr"`
	AppendTag      string `json:"append_tag,omitempty"`
	StructuredData string `json:"structured_data,omitempty"`
}

Jump to

Keyboard shortcuts

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