operators

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelOperatorInterface

type ChannelOperatorInterface interface {
	Get(ctx context.Context, scope string, name string) (*meta.Channel, error)
	Create(ctx context.Context, scope string, channel *meta.Channel) error
	Update(ctx context.Context, scope string, channel *meta.Channel) error
	Delete(ctx context.Context, scope string, name string) error
}

ChannelOperatorInterface is responsible for handling the following methods

  • `Get`: returns a channel from the DApp of the given context
  • `GetAll`: return all channels from the DApp of the given context
  • `Create`: creates a channel in the DApp of the given context
  • `Update`: updates a channel in the DApp of the given context
  • `Delete`: deletes a channel of the specified name in DApp of the given context

type GenOp

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

GenOp is a general channel operator for dinamically selecting required operator

func NewGeneralOperator

func NewGeneralOperator(brokers brokers.Manager, memory tree.Manager) *GenOp

NewGeneralOperator creates an instance of GenOp for a given broker and memory manager

func (GenOp) Create

func (g GenOp) Create(ctx context.Context, scope string, channel *meta.Channel) error

Create executes Create method of correct operator given the desired channel's broker

func (GenOp) Delete

func (g GenOp) Delete(ctx context.Context, scope, name string) error

Delete executes Delete method of correct operator given the desired channel's broker

func (GenOp) Get

func (g GenOp) Get(ctx context.Context, scope, name string) (*meta.Channel, error)

Get executes Get method of correct operator given the desired channel's broker

func (GenOp) Update

func (g GenOp) Update(ctx context.Context, scope string, channel *meta.Channel) error

Update executes Update method of correct operator given the desired channel's broker

type NodeOperatorInterface

type NodeOperatorInterface interface {
	CreateNode(ctx context.Context, app *meta.App) (*meta.Node, error)
	UpdateNode(ctx context.Context, app *meta.App) (*meta.Node, error)
	DeleteNode(ctx context.Context, scope string, name string) error
}

NodeOperatorInterface is the interface that allows to obtain or change node information inside a deployment

type Operator

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

Operator is an operator for creating channels and nodes inside kubernetes that communicate via Sidecars. The operators need two environment variables

func (*Operator) Channels

func (op *Operator) Channels() ChannelOperatorInterface

Channels returns the Channels Operator Interface for a given node

func (*Operator) Nodes

func (op *Operator) Nodes() NodeOperatorInterface

Nodes returns the nodes that communicate via sidecars inside kubernetes

type OperatorInterface

type OperatorInterface interface {
	Nodes() NodeOperatorInterface
	Channels() ChannelOperatorInterface
}

OperatorInterface is an interface for inspr runtime operators

To implement the interface you need to create two implementations, a node implementation, that creates nodes from inspr in the given runtime and a channel implementation, that creates channels from inspr in the given runtime.

func NewOperator

func NewOperator(memory memory.Manager, authenticator auth.Auth) (OperatorInterface, error)

NewOperator creates a node operator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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