appmanager

package
v1.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_BALANCE string = "round-robin"
View Source
var DEFAULT_MODE string = "tcp"

Functions

func NewEventHandler

func NewEventHandler(
	appMgr *Manager,
) *eventHandler

Types

type ChangedObject

type ChangedObject struct {
	Old interface{}
	New interface{}
}

type Manager

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

func NewManager

func NewManager(params *Params) *Manager

Create and return a new app manager that meets the Manager interface

func (*Manager) ConfigWriter

func (appMgr *Manager) ConfigWriter() writer.Writer

func (*Manager) IsNodePort

func (appMgr *Manager) IsNodePort() bool

func (*Manager) ProcessConfigMapUpdate

func (appMgr *Manager) ProcessConfigMapUpdate(
	changeType changeType,
	obj ChangedObject,
)

Process ConfigMap objects from the controller

func (*Manager) ProcessEndpointsUpdate

func (appMgr *Manager) ProcessEndpointsUpdate(
	changeType changeType,
	obj ChangedObject,
)

func (*Manager) ProcessNodeUpdate

func (appMgr *Manager) ProcessNodeUpdate(
	obj interface{}, err error,
)

Check for a change in Node state

func (*Manager) ProcessServiceUpdate

func (appMgr *Manager) ProcessServiceUpdate(
	changeType changeType,
	obj ChangedObject,
)

Process Service objects from the controller

func (*Manager) RemoveNamespace

func (appMgr *Manager) RemoveNamespace(ns string)

RemoveNamespace cleans up all virtual servers that reference a removed namespace

func (*Manager) UseNodeInternal

func (appMgr *Manager) UseNodeInternal() bool

func (*Manager) WatchManager

func (appMgr *Manager) WatchManager() watchmanager.Manager

type Params

type Params struct {
	KubeClient         kubernetes.Interface
	ConfigWriter       writer.Writer
	WatchManager       watchmanager.Manager
	UseNodeInternal    bool
	IsNodePort         bool
	WatchAllNamespaces bool
}

Struct to allow NewManager to receive all or only specific parameters.

type VirtualServerConfig

type VirtualServerConfig struct {
	MetaData      metaData `json:"-"`
	VirtualServer struct {
		Backend  virtualServerBackend  `json:"backend"`
		Frontend virtualServerFrontend `json:"frontend"`
	} `json:"virtualServer"`
}

main virtual server configuration

type VirtualServerConfigMap

type VirtualServerConfigMap map[string]*VirtualServerConfig

type VirtualServerConfigs

type VirtualServerConfigs []*VirtualServerConfig

func (VirtualServerConfigs) Len

func (slice VirtualServerConfigs) Len() int

func (VirtualServerConfigs) Less

func (slice VirtualServerConfigs) Less(i, j int) bool

func (VirtualServerConfigs) Swap

func (slice VirtualServerConfigs) Swap(i, j int)

type VirtualServerEnumFunc

type VirtualServerEnumFunc func(key serviceKey, cfg *VirtualServerConfig)

callback type for ForEach()

type VirtualServerInterface

type VirtualServerInterface interface {
	Init()
	Assign(key serviceKey, name string, cfg *VirtualServerConfig)
	Count() int
	CountOf(key serviceKey) int
	Get(key serviceKey, frontEndName string) (*VirtualServerConfig, bool)
	GetAll(key serviceKey) (VirtualServerConfigMap, bool)
	Delete(key serviceKey, frontEndName string) bool
	ForEach(f VirtualServerEnumFunc)
}

type VirtualServers

type VirtualServers struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Map of Virtual Server configs

func NewVirtualServers

func NewVirtualServers() *VirtualServers

Constructor for VirtualServers.

func (*VirtualServers) Assign

func (vss *VirtualServers) Assign(
	key serviceKey,
	name string,
	cfg *VirtualServerConfig,
)

Add or update cfg in VirtualServers, identified by key.

func (*VirtualServers) Count

func (vss *VirtualServers) Count() int

Count of all confiugrations currently stored.

func (*VirtualServers) CountOf

func (vss *VirtualServers) CountOf(key serviceKey) int

Count of all configurations for a specific backend.

func (*VirtualServers) Delete

func (vss *VirtualServers) Delete(key serviceKey, frontEndName string) bool

Remove a specific configuration.

func (*VirtualServers) ForEach

func (vss *VirtualServers) ForEach(f VirtualServerEnumFunc)

Iterate over all configurations, calling the supplied callback with each.

func (*VirtualServers) Get

func (vss *VirtualServers) Get(
	key serviceKey,
	frontEndName string,
) (*VirtualServerConfig, bool)

Get a specific configuration.

func (*VirtualServers) GetAll

func (vss *VirtualServers) GetAll(
	key serviceKey) (VirtualServerConfigMap, bool)

Get all configurations for a specific backend

func (*VirtualServers) Init

func (vss *VirtualServers) Init()

Receiver to initialize the object.

Jump to

Keyboard shortcuts

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