adapter

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionKey = actionKeyType("experimentAction")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Refresh() bool
	Resume() bool
}

Action specifies desired actions to be performed by controller to the experiment

type Catcher

type Catcher interface {
	MarkTargetDetected(name string, kind string)
	MarkTargetDeleted(name string, kind string)
}

Catcher defines functions can be invoked by Adapter It catches creation/deletion of experiment targets

type Impl

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

Impl is the implementation of Iter8Cache

func (*Impl) DeploymentToExperiment

func (c *Impl) DeploymentToExperiment(targetName, targetNamespace string) (string, string, bool)

DeploymentToExperiment returns the experiment key given name and namespace of target deployment

func (*Impl) Inspect

func (c *Impl) Inspect()

Inspect prints details of adapter into log

func (*Impl) MarkDeploymentDeleted

func (c *Impl) MarkDeploymentDeleted(targetName, targetNamespace string) bool

MarkDeploymentDeleted marks the event that a target deployment is deleted

func (*Impl) MarkDeploymentDetected

func (c *Impl) MarkDeploymentDetected(targetName, targetNamespace string) bool

MarkDeploymentDetected marks the event that a target deployment is detected

func (*Impl) MarkServiceDeleted

func (c *Impl) MarkServiceDeleted(targetName, targetNamespace string) bool

MarkServiceDeleted marks the event that a target service is deleted

func (*Impl) MarkServiceDetected

func (c *Impl) MarkServiceDetected(targetName, targetNamespace string) bool

MarkServiceDetected marks the event that a target service is detected

func (*Impl) RegisterExperiment

func (c *Impl) RegisterExperiment(ctx context.Context, instance *iter8v1alpha2.Experiment) (context.Context, error)

RegisterExperiment creates new abstracts into the cache and snapshot the abstract into context

func (*Impl) RemoveExperiment

func (c *Impl) RemoveExperiment(instance *iter8v1alpha2.Experiment)

RemoveExperiment removes the experiment abstract from the cache

func (*Impl) ServiceToExperiment

func (c *Impl) ServiceToExperiment(targetName, targetNamespace string) (string, string, bool)

ServiceToExperiment returns the experiment key given name and namespace of target service

type Interface

type Interface interface {
	// Given name and namespace of the target deployment, return the experiment key
	DeploymentToExperiment(name, namespace string) (experiment, experimentNamespace string, exist bool)
	// Given name and namespace of the target service, return the experiment key
	ServiceToExperiment(name, namespace string) (experiment, experimentNamespace string, exist bool)
	RegisterExperiment(context context.Context, instance *iter8v1alpha2.Experiment) (context.Context, error)
	RemoveExperiment(instance *iter8v1alpha2.Experiment)

	MarkDeploymentDetected(name, namespace string) bool
	MarkServiceDetected(name, namespace string) bool

	MarkDeploymentDeleted(name, namespace string) bool
	MarkServiceDeleted(name, namespace string) bool

	Inspect()
}

Interface defines the interface for iter8cache

func New

func New(logger logr.Logger) Interface

New returns a new iter8cache implementation

Jump to

Keyboard shortcuts

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