logspout: github.com/rkorkosz/logspout/router Index | Files

package router

import "github.com/rkorkosz/logspout/router"

generated by go-extpoints -- DO NOT EDIT

go:generate go-extpoints . AdapterFactory HttpHandler AdapterTransport LogRouter Job

Index

Package Files

extpoints.go http.go persist.go pump.go routes.go types.go

Variables

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

func Register Uses

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

func Unregister Uses

func Unregister(name string) []string

type AdapterFactory Uses

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

Extension type for adding new log adapters

type AdapterTransport Uses

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

Extension type for connection transports used by adapters

type HttpHandler Uses

type HttpHandler func() http.Handler

Extension type for adding HTTP endpoints

type Job Uses

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

type LogAdapter Uses

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

LogAdapters are streamed logs

type LogRouter Uses

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

LogRouters send logs to LogAdapters via Routes

type LogsPump Uses

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

func (*LogsPump) Name Uses

func (p *LogsPump) Name() string

func (*LogsPump) Route Uses

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

func (*LogsPump) RoutingFrom Uses

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

func (*LogsPump) Run Uses

func (p *LogsPump) Run() error

func (*LogsPump) Setup Uses

func (p *LogsPump) Setup() error

type Message Uses

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

Messages are log messages

type Route Uses

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 Uses

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

func (*Route) AdapterType Uses

func (r *Route) AdapterType() string

func (*Route) Close Uses

func (r *Route) Close()

func (*Route) Closer Uses

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

func (*Route) MatchContainer Uses

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

func (*Route) MatchMessage Uses

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

func (*Route) MultiContainer Uses

func (r *Route) MultiContainer() bool

func (*Route) OverrideCloser Uses

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

type RouteFileStore Uses

type RouteFileStore string

func (RouteFileStore) Add Uses

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

func (RouteFileStore) Filename Uses

func (fs RouteFileStore) Filename(id string) string

func (RouteFileStore) Get Uses

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

func (RouteFileStore) GetAll Uses

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

func (RouteFileStore) Remove Uses

func (fs RouteFileStore) Remove(id string) bool

type RouteManager Uses

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

func (*RouteManager) Add Uses

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

func (*RouteManager) AddFromUri Uses

func (rm *RouteManager) AddFromUri(uri string) error

func (*RouteManager) Get Uses

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

func (*RouteManager) GetAll Uses

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

func (*RouteManager) Load Uses

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

func (*RouteManager) Name Uses

func (rm *RouteManager) Name() string

func (*RouteManager) Remove Uses

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

func (*RouteManager) Route Uses

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

func (*RouteManager) RoutingFrom Uses

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

func (*RouteManager) Run Uses

func (rm *RouteManager) Run() error

func (*RouteManager) Setup Uses

func (rm *RouteManager) Setup() error

type RouteStore Uses

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

RouteStores are collections of Routes

Package router imports 20 packages (graph) and is imported by 8 packages. Updated 2018-04-13. Refresh now. Tools for package owners. This is a quick bug-fix fork (has fewer than three commits, and only during the week it was created).