manager

package
v0.0.0-...-fe2ccbf Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2016 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Overview

The Manager reacts to messages send to it by Notifiers. It calls all ServiceGenerators to generate new Services and passes these to ConfigGenerators which generate configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAnnotator

func AddAnnotator(a types.Annotator)

Add an Annotator

func AddConfigGenerator

func AddConfigGenerator(cg types.ConfigGenerator)

Add a ConfigGenerator.

func AddNotifier

func AddNotifier(n types.Notifier)

Add a Notifier.

func AddServiceGenerator

func AddServiceGenerator(sg types.ServiceGenerator)

Add a ServiceGenerator

func Quit

func Quit()

func RegisterHttpHandleFunc

func RegisterHttpHandleFunc(method, path string, handle func(w http.ResponseWriter, r *http.Request))

func RegisterHttpHandler

func RegisterHttpHandler(method string, path string, handle http.Handler)

func Run

func Run()

Start the default manager.

Types

type Config

type Config struct {
	ListenAddress string `envconfig:"listen_address",default:":5678"`
}

type Manager

type Manager struct {
	Config *Config
	// contains filtered or unexported fields
}

Manager orchestrates Notifiers, ServiceGenerators and ConfigGenerators.

var DefaultManager *Manager = New()

func New

func New() *Manager

Creates and returns a new Manager.

func (*Manager) AddAnnotator

func (m *Manager) AddAnnotator(a types.Annotator) *Manager

Add an Annotator

func (*Manager) AddConfigGenerator

func (m *Manager) AddConfigGenerator(cg types.ConfigGenerator) *Manager

Add a ConfigGenerator.

func (*Manager) AddNotifier

func (m *Manager) AddNotifier(notifier types.Notifier) *Manager

Add a Notifier.

func (*Manager) AddServiceGenerator

func (m *Manager) AddServiceGenerator(sg types.ServiceGenerator) *Manager

Add a ServiceGenerator

func (*Manager) Quit

func (m *Manager) Quit()

func (*Manager) RegisterHttpHandleFunc

func (m *Manager) RegisterHttpHandleFunc(method, path string, handle func(w http.ResponseWriter, r *http.Request))

func (*Manager) RegisterHttpHandler

func (m *Manager) RegisterHttpHandler(method string, path string, handle http.Handler) *Manager

Register an endpoint with the HTTP server

func (*Manager) Run

func (m *Manager) Run()

Starts every notifier and listens for messages that trigger a refresh. When a refresh is triggered it calls all ServiceGenerators and then all ConfigGenerators.

Jump to

Keyboard shortcuts

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