watt

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CLOSE interface{} = &struct{}{}
)
View Source
var Version = "(unknown version)"

Version holds the version of the code. This is intended to be overridden at build time.

Functions

func Main added in v1.3.0

func Main()

func NewAggregator

func NewAggregator(snapshots chan<- string, k8sWatches chan<- []KubernetesWatchSpec, consulWatches chan<- []ConsulWatchSpec,
	requiredKinds []string, watchHook WatchHook, limiter limiter.Limiter) *aggregator

func NewInvoker

func NewInvoker(port int, notify []string) *invoker

Types

type ConsulWatchMaker

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

func (*ConsulWatchMaker) MakeConsulWatch

func (m *ConsulWatchMaker) MakeConsulWatch(spec ConsulWatchSpec) (*supervisor.Worker, error)

type ConsulWatchSpec

type ConsulWatchSpec struct {
	Id            string `json:"id"`
	ConsulAddress string `json:"consul-address"`
	Datacenter    string `json:"datacenter"`
	ServiceName   string `json:"service-name"`
}

func (ConsulWatchSpec) WatchId

func (c ConsulWatchSpec) WatchId() string

type IConsulWatchMaker

type IConsulWatchMaker interface {
	MakeConsulWatch(spec ConsulWatchSpec) (*supervisor.Worker, error)
}

IConsulWatchMaker is an interface for ConsulWatchMaker implementations. It mostly exists to facilitate the creation of testing mocks.

type IKubernetesWatchMaker

type IKubernetesWatchMaker interface {
	MakeKubernetesWatch(spec KubernetesWatchSpec) (*supervisor.Worker, error)
}

IKubernetesWatchMaker is an interface for KubernetesWatchMaker implementations. It mostly exists to facilitate the creation of testing mocks.

type KubernetesWatchMaker

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

func (*KubernetesWatchMaker) MakeKubernetesWatch

func (m *KubernetesWatchMaker) MakeKubernetesWatch(spec KubernetesWatchSpec) (*supervisor.Worker, error)

type KubernetesWatchSpec

type KubernetesWatchSpec struct {
	Kind          string `json:"kind"`
	Namespace     string `json:"namespace"`
	FieldSelector string `json:"field-selector"`
	LabelSelector string `json:"label-selector"`
}

func (KubernetesWatchSpec) WatchId

func (k KubernetesWatchSpec) WatchId() string

type MockWatchMaker

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

func (*MockWatchMaker) MakeConsulWatch

func (m *MockWatchMaker) MakeConsulWatch(spec ConsulWatchSpec) (*supervisor.Worker, error)

func (*MockWatchMaker) MakeKubernetesWatch

func (m *MockWatchMaker) MakeKubernetesWatch(spec KubernetesWatchSpec) (*supervisor.Worker, error)

type Timeout

type Timeout time.Duration

type WatchHook

type WatchHook func(p *supervisor.Process, snapshot string) WatchSet

func ExecWatchHook

func ExecWatchHook(watchHooks []string) WatchHook

type WatchSet

type WatchSet struct {
	KubernetesWatches []KubernetesWatchSpec `json:"kubernetes-watches"`
	ConsulWatches     []ConsulWatchSpec     `json:"consul-watches"`
}

Jump to

Keyboard shortcuts

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