router

package
v0.0.0-...-95fdf26 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2016 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

generated by go-extpoints -- DO NOT EDIT

Index

Constants

This section is empty.

Variables

View Source
var AdapterFactories = &adapterFactoryExt{
	newExtensionPoint(new(AdapterFactory)),
}
View Source
var AdapterTransports = &adapterTransportExt{
	newExtensionPoint(new(AdapterTransport)),
}
View Source
var HttpHandlers = &httpHandlerExt{
	newExtensionPoint(new(HttpHandler)),
}
View Source
var Jobs = &jobExt{
	newExtensionPoint(new(Job)),
}
View Source
var LogRouters = &logRouterExt{
	newExtensionPoint(new(LogRouter)),
}

Functions

func Register

func Register(component interface{}, name string) []string

func Unregister

func Unregister(name string) []string

Types

type AdapterFactory

type AdapterFactory func(route *Route) (LogAdapter, error)

Extension type for adding new log adapters

type AdapterTransport

type AdapterTransport interface {
	Dial(addr string, options map[string]string) (net.Conn, error)
}

Extension type for connection transports used by adapters

type HttpHandler

type HttpHandler func() http.Handler

Extension type for adding HTTP endpoints

type Job

type Job interface {
	Run() error
	Setup() error
	Name() string
}

type LogAdapter

type LogAdapter interface {
	Stream(logstream chan *Message)
}

LogAdapters are streamed logs

type LogRouter

type LogRouter interface {
	RoutingFrom(containerID string) bool
	Route(route *Route, logstream chan *Message)
}

LogRouters send logs to LogAdapters via Routes

type LogsPump

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

func (*LogsPump) Name

func (p *LogsPump) Name() string

func (*LogsPump) Route

func (p *LogsPump) Route(route *Route, logstream chan *Message)

func (*LogsPump) RoutingFrom

func (p *LogsPump) RoutingFrom(id string) bool

func (*LogsPump) Run

func (p *LogsPump) Run() error

func (*LogsPump) Setup

func (p *LogsPump) Setup() error

type Message

type Message struct {
	Container *docker.Container
	Source    string
	Data      string
	Time      time.Time
}

Messages are log messages

type Route

type Route struct {
	ID            string            `json:"id"`
	FilterID      string            `json:"filter_id,omitempty"`
	FilterName    string            `json:"filter_name,omitempty"`
	FilterSources []string          `json:"filter_sources,omitempty"`
	Adapter       string            `json:"adapter"`
	Address       string            `json:"address"`
	Options       map[string]string `json:"options,omitempty"`
	// contains filtered or unexported fields
}

Routes represent what subset of logs should go where

func (*Route) AdapterTransport

func (r *Route) AdapterTransport(dfault string) string

func (*Route) AdapterType

func (r *Route) AdapterType() string

func (*Route) Close

func (r *Route) Close()

func (*Route) Closer

func (r *Route) Closer() <-chan bool

func (*Route) MatchContainer

func (r *Route) MatchContainer(id, name string) bool

func (*Route) MatchMessage

func (r *Route) MatchMessage(message *Message) bool

func (*Route) MultiContainer

func (r *Route) MultiContainer() bool

func (*Route) OverrideCloser

func (r *Route) OverrideCloser(closer <-chan bool)

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 Routes *RouteManager

func (*RouteManager) Add

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

func (*RouteManager) AddFromUri

func (rm *RouteManager) AddFromUri(uri string) 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) Name

func (rm *RouteManager) Name() string

func (*RouteManager) Remove

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

func (*RouteManager) Route

func (rm *RouteManager) Route(route *Route, logstream chan *Message)

func (*RouteManager) RoutingFrom

func (rm *RouteManager) RoutingFrom(containerID string) bool

func (*RouteManager) Run

func (rm *RouteManager) Run() error

func (*RouteManager) Setup

func (rm *RouteManager) Setup() error

type RouteStore

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

RouteStores are collections of Routes

Jump to

Keyboard shortcuts

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