provider

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProviderNotFound = errors.New("the specified provider can't be found")

ErrProviderNotFound is an error which is used when we try to create a new client for a given provider which isn't registered with the factory.

Functions

This section is empty.

Types

type FactoryFunc

FactoryFunc is the interface used to allow creating a new provider. This shoud be used by provider wrappers to allow for creating new clients.

type FactoryInterface

type FactoryInterface interface {
	Register(string, FactoryFunc)
	From(v1alpha1.NamespacedProvider) (Interface, error)
}

FactoryInterface is the interface used for a ProviderFactory. It allows you to fetch providers from a local store and use them to configure monitors.

type Interface

type Interface interface {
	Create(v1alpha1.MonitorTemplateSpec) (string, error)
	Delete(string) error
	Update(string, v1alpha1.MonitorTemplateSpec) (string, error)
}

Interface reflects interface we'll use to speak with Monitoring Providers.

type SimpleFactory

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

SimpleFactory is a factory object that knows how to get providers.

func NewFactory

func NewFactory(client kubernetes.Interface) *SimpleFactory

NewFactory returns a new SimpleFactory which is able to register a set of Providers and create clients for them.

func (*SimpleFactory) From

From creates a new provider from the given configuration. This can then be used to register the provider within the

func (*SimpleFactory) Register

func (pf *SimpleFactory) Register(name string, ff FactoryFunc)

Register registers the given provider with the factory under the given name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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