coupler

package
v0.0.0-...-591a441 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

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

func NewBus

func NewBus() *Bus

func (*Bus) Close

func (b *Bus) Close()

func (*Bus) Open

func (b *Bus) Open()

func (*Bus) Pub

func (b *Bus) Pub(topic Topic, kind Kind, data interface{}, errCh chan error)

func (*Bus) Sub

func (b *Bus) Sub(topic Topic, eventCh chan<- Event)

func (*Bus) Teardown

func (b *Bus) Teardown()

type Config

type Config map[string]string

type Coupler

type Coupler struct {
	Finished bool
	Options  Options
	// contains filtered or unexported fields
}
var GlobalCoupler Coupler = CreateGlobalCoupler()

func CreateGlobalCoupler

func CreateGlobalCoupler() Coupler

func NewCoupler

func NewCoupler(options Options) *Coupler

func (*Coupler) BrokenPlug

func (c *Coupler) BrokenPlug(
	plug *integrationv1alpha2.Plug,
) error

func (*Coupler) BrokenSocket

func (c *Coupler) BrokenSocket(
	socket *integrationv1alpha2.Socket,
) error

func (*Coupler) Configure

func (c *Coupler) Configure(options Options)

func (*Coupler) Couple

func (c *Coupler) Couple(
	client *client.Client,
	ctx *context.Context,
	req *ctrl.Request,
	log *logr.Logger,
	plugNamespacedName *integrationv1alpha2.NamespacedName,
	plug *integrationv1alpha2.Plug,
) (ctrl.Result, error)

func (*Coupler) CoupledPlug

func (c *Coupler) CoupledPlug(
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig Config,
	socketConfig Config,
) error

func (*Coupler) CoupledSocket

func (c *Coupler) CoupledSocket(
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig Config,
	socketConfig Config,
) error

func (*Coupler) CreatedPlug

func (c *Coupler) CreatedPlug(plug *integrationv1alpha2.Plug) error

func (*Coupler) CreatedSocket

func (c *Coupler) CreatedSocket(
	socket *integrationv1alpha2.Socket,
) error

func (*Coupler) Decouple

func (c *Coupler) Decouple(
	client *client.Client,
	ctx *context.Context,
	req *ctrl.Request,
	log *logr.Logger,
	plugNamespacedName *integrationv1alpha2.NamespacedName,
	plug *integrationv1alpha2.Plug,
) (ctrl.Result, error)

func (*Coupler) DecoupledPlug

func (c *Coupler) DecoupledPlug(
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig Config,
	socketConfig Config,
) error

func (*Coupler) DecoupledSocket

func (c *Coupler) DecoupledSocket(
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig Config,
	socketConfig Config,
) error

func (*Coupler) DeletedPlug

func (c *Coupler) DeletedPlug(
	plug *integrationv1alpha2.Plug,
) error

func (*Coupler) DeletedSocket

func (c *Coupler) DeletedSocket(
	socket *integrationv1alpha2.Socket,
) error

func (*Coupler) RegisterEvents

func (c *Coupler) RegisterEvents(events *Events)

func (*Coupler) Start

func (c *Coupler) Start()

func (*Coupler) Stop

func (c *Coupler) Stop()

func (*Coupler) Update

func (c *Coupler) Update(
	client *client.Client,
	ctx *context.Context,
	req *ctrl.Request,
	log *logr.Logger,
	plugNamespacedName *integrationv1alpha2.NamespacedName,
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	socketInterface *integrationv1alpha2.Interface,
) (ctrl.Result, error)

func (*Coupler) UpdatedPlug

func (c *Coupler) UpdatedPlug(
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig Config,
	socketConfig Config,
) error

func (*Coupler) UpdatedSocket

func (c *Coupler) UpdatedSocket(
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig Config,
	socketConfig Config,
) error

func (*Coupler) Wait

func (c *Coupler) Wait()

type Event

type Event struct {
	Data  interface{}
	ErrCh *chan error
	Kind  Kind
	Topic Topic
}

type Events

type Events struct {
	OnPlugBroken      func(data interface{}) error
	OnPlugCoupled     func(data interface{}) error
	OnPlugCreated     func(data interface{}) error
	OnPlugDecoupled   func(data interface{}) error
	OnPlugDeleted     func(data interface{}) error
	OnPlugUpdated     func(data interface{}) error
	OnSocketBroken    func(data interface{}) error
	OnSocketCoupled   func(data interface{}) error
	OnSocketCreated   func(data interface{}) error
	OnSocketDecoupled func(data interface{}) error
	OnSocketDeleted   func(data interface{}) error
	OnSocketUpdated   func(data interface{}) error
}

type Handlers

type Handlers struct {
}

func NewHandlers

func NewHandlers() *Handlers

func (*Handlers) HandlePlugBroken

func (h *Handlers) HandlePlugBroken(
	ctx *context.Context,
	plug *integrationv1alpha2.Plug,
) error

func (*Handlers) HandlePlugCoupled

func (h *Handlers) HandlePlugCoupled(
	ctx *context.Context,
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig *map[string]string,
	socketConfig *map[string]string,
) error

func (*Handlers) HandlePlugCreated

func (h *Handlers) HandlePlugCreated(
	ctx *context.Context,
	plug *integrationv1alpha2.Plug,
) error

func (*Handlers) HandlePlugDecoupled

func (h *Handlers) HandlePlugDecoupled(
	ctx *context.Context,
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig *map[string]string,
	socketConfig *map[string]string,
) error

func (*Handlers) HandlePlugDeleted

func (h *Handlers) HandlePlugDeleted(
	ctx *context.Context,
	plug *integrationv1alpha2.Plug,
) error

func (*Handlers) HandlePlugUpdated

func (h *Handlers) HandlePlugUpdated(
	ctx *context.Context,
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig *map[string]string,
	socketConfig *map[string]string,
) error

func (*Handlers) HandleSocketBroken

func (h *Handlers) HandleSocketBroken(
	ctx *context.Context,
	socket *integrationv1alpha2.Socket,
) error

func (*Handlers) HandleSocketCoupled

func (h *Handlers) HandleSocketCoupled(
	ctx *context.Context,
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig *map[string]string,
	socketConfig *map[string]string,
) error

func (*Handlers) HandleSocketCreated

func (h *Handlers) HandleSocketCreated(
	ctx *context.Context,
	socket *integrationv1alpha2.Socket,
) error

func (*Handlers) HandleSocketDecoupled

func (h *Handlers) HandleSocketDecoupled(
	ctx *context.Context,
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig *map[string]string,
	socketConfig *map[string]string,
) error

func (*Handlers) HandleSocketDeleted

func (h *Handlers) HandleSocketDeleted(
	ctx *context.Context,
	socket *integrationv1alpha2.Socket,
) error

func (*Handlers) HandleSocketUpdated

func (h *Handlers) HandleSocketUpdated(
	ctx *context.Context,
	plug *integrationv1alpha2.Plug,
	socket *integrationv1alpha2.Socket,
	plugConfig *map[string]string,
	socketConfig *map[string]string,
) error

type Kind

type Kind int
const (
	PlugKind Kind = iota + 1
	SocketKind
)

type Options

type Options struct {
	MaxQueueSize int
	MaxWorkers   int
}

type Topic

type Topic int
const (
	CreatedTopic Topic = iota + 1
	CoupledTopic
	UpdatedTopic
	DecoupledTopic
	DeletedTopic
	BrokenTopic
)

Jump to

Keyboard shortcuts

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