fds

package
v0.13.15 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2019 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	Secrets v1.SecretList
}

type FunctionDiscovery

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

func NewFunctionDiscovery

func NewFunctionDiscovery(updater *Updater) *FunctionDiscovery

func (*FunctionDiscovery) Update

func (d *FunctionDiscovery) Update(upstreams v1.UpstreamList, secrets v1.SecretList) error

type FunctionDiscoveryFactory

type FunctionDiscoveryFactory interface {
	NewFunctionDiscovery(u *v1.Upstream) UpstreamFunctionDiscovery
}

upstreams can be obviously functional like AWS λ, fission,... or an upstream that was already detected and marked as such. or potentially like static upstreams.

detectors detect a specific type of functional service if they detect the service, they return service info and annotations (optional) for the service we want to bake sure that detect upstream for aws doesn't do anything perhaps we can do just that

type Resolver

type Resolver interface {
	/*
		tcp if not known
		http \ https if known or perhaps nats?
	*/
	Resolve(us *v1.Upstream) (*url.URL, error)
}

type Resolvers

type Resolvers []Resolver

func (Resolvers) Resolve

func (resolvers Resolvers) Resolve(us *v1.Upstream) (*url.URL, error)

type Updater

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

func NewUpdater

func NewUpdater(ctx context.Context, resolver Resolver, upstreamclient UpstreamWriterClient, maxconncurrency uint, functionalPlugins []FunctionDiscoveryFactory) *Updater

func (*Updater) GetSecrets

func (u *Updater) GetSecrets() v1.SecretList

func (*Updater) SetSecrets

func (u *Updater) SetSecrets(secretlist v1.SecretList)

func (*Updater) UpstreamAdded

func (u *Updater) UpstreamAdded(upstream *v1.Upstream)

func (*Updater) UpstreamRemoved

func (u *Updater) UpstreamRemoved(upstream *v1.Upstream)

func (*Updater) UpstreamUpdated

func (u *Updater) UpstreamUpdated(upstream *v1.Upstream)

type UpstreamFunctionDiscovery

type UpstreamFunctionDiscovery interface {
	// if this returns true we can skip DetectUpstreamType and go straight to DetectFunctions
	// if this returns false we should call detect upstream type.
	// if detect upstream type retrurns true, we have the type!
	// if it returns false and nil error, it means it was detected to not be of this type -
	// ideally this means that this detector will no longer be used with this upstream. in practice this can be logged\ignored.
	// if it returns false and some error, try again later with back-off \ timeout.
	IsFunctional() bool

	// Returns
	// err != nil temporary error. try again
	// err == nil spec == nil. no type detected, don't try again
	// url is never nil
	DetectType(ctx context.Context, url *url.URL) (*plugins.ServiceSpec, error)

	// url maybe nil if it couldnt be resolved
	DetectFunctions(ctx context.Context, url *url.URL, dependencies func() Dependencies, out func(UpstreamMutator) error) error
}

type UpstreamMutator

type UpstreamMutator func(*v1.Upstream) error

type UpstreamWriterClient

type UpstreamWriterClient interface {
	Write(resource *v1.Upstream, opts clients.WriteOpts) (*v1.Upstream, error)
	Read(namespace, name string, opts clients.ReadOpts) (*v1.Upstream, error)
}

Directories

Path Synopsis
discoveries
aws

Jump to

Keyboard shortcuts

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