types

package
v0.0.0-...-2db6a80 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2018 License: MIT Imports: 1 Imported by: 3

Documentation

Overview

Package Types is a way to rationalise the various types used within this project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition int
const (
	NoOp          Condition = iota
	Shutdown      Condition = iota
	ForceShutdown Condition = iota
	Restart       Condition = iota
)

type Coordinator

type Coordinator interface {
	// Configure will load a config and prepare the Coordinator
	// ready to be used later on.
	Configure(path string) error

	// Register will load the given module and make it ready for
	// for the user at runtime.
	// This function should only be used to in each module's init function.
	Register(name string, loader func() Module) error

	// LoadedModules returns all the currently loaded modules within the Coordinator
	LoadedModules() []Module

	// Start causes the Coordinator to become aware of the events around it
	// and start running all of its sub processes
	Start() error
}

Coordinator managers are the various parts of KubeAware

type Module

type Module interface {
	ExitWithCondition(cond Condition)

	// ParseConfig takes a loaded yaml file as a bytes array
	// ready to marshal the content into the module if it requires it.
	ParseConfig(info []byte) error

	// Start simply starts the module
	Start() error
}

Module is a simple unit of defined functionality that is used within kubeAware

type Polymorph

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

Polymorph creates an object that satisfies the expvar.Var interface with more flexibility of what is stored inside it. The value stored inside should be a reference to value so that it can be used without updating

func (*Polymorph) Set

func (p *Polymorph) Set(v interface{})

Set should only except values that are pointers to references

func (Polymorph) String

func (p Polymorph) String() string

String needs to satisfy the expvar.Var string's conversion

Jump to

Keyboard shortcuts

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