Help us shape the future of Go! Take the 2026 Go Developer Survey

eventmanager

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

///////////////////////////////////////////////////////////////////// Copyright (c) 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 ///////////////////////////////////////////////////////////////////// Package gen contains generated code this code needs to be considered by go, so it can't be in a file that starts with _ or .

Code generated by mockery v1.0.0

Code generated by mockery v1.0.0

Index

Constants

View Source
const (
	DefaultResyncPeriod = 60 * time.Second
	DefaultWorkerNumber = 100
)
View Source
const (
	// FunctionSubscriber defines a function type of subscriber
	FunctionSubscriber = "function"
	// EventSubscriber defines an event type of subscriber
	EventSubscriber = "event"
)

Variables

View Source
var EventDriverTemplates = map[string]map[string]bool{
	"vcenter": map[string]bool{
		"vcenterurl": true,
	},
}
View Source
var EventManagerFlags = struct {
	Config           string `long:"config" description:"Path to Config file" default:"./config.dev.json"`
	DbFile           string `long:"db-file" description:"Path to BoltDB file" default:"./db.bolt"`
	FunctionManager  string `long:"function-manager" description:"Function manager endpoint" default:"localhost:8001"`
	AMQPURL          string `long:"amqpurl" description:"URL to AMQP broker"  default:"amqp://guest:guest@localhost:5672/"`
	OrgID            string `long:"organization" description:"(temporary) Static organization id" default:"dispatch"`
	ResyncPeriod     int    `long:"resync-period" description:"The time period (in seconds) to sync with underlying k8s" default:"60"`
	K8sConfig        string `long:"kubeconfig" description:"Path to kubernetes config file" default:""`
	K8sNamespace     string `long:"namespace" description:"Kubernetes namespace" default:"default"`
	EventDriverImage string `long:"event-driver-image" description:"Event driver image"`
}{}

EventManagerFlags are configuration flags for the function manager

Functions

func NewEventController

func NewEventController(manager SubscriptionManager, backend DriverBackend, store entitystore.EntityStore, config EventControllerConfig) controller.Controller

NewEventController creates a new controller to manage the reconciliation of event manager entities

Types

type Driver

type Driver struct {
	entitystore.BaseEntity
	Type   string            `json:"type"`
	Config map[string]string `json:"config, omitempty"`
}

Driver represents a event driver, (e.g. vCenter)

type DriverBackend

type DriverBackend interface {
	Deploy(*Driver) error
	Update(*Driver) error
	Delete(*Driver) error
}

func NewK8sBackend

func NewK8sBackend() (DriverBackend, error)

type DriverBackendMock

type DriverBackendMock struct {
	mock.Mock
}

DriverBackendMock is an autogenerated mock type for the DriverBackend type

func (*DriverBackendMock) Delete

func (_m *DriverBackendMock) Delete(_a0 *Driver) error

Delete provides a mock function with given fields: _a0

func (*DriverBackendMock) Deploy

func (_m *DriverBackendMock) Deploy(_a0 *Driver) error

Deploy provides a mock function with given fields: _a0

func (*DriverBackendMock) Update

func (_m *DriverBackendMock) Update(_a0 *Driver) error

Update provides a mock function with given fields: _a0

type EventControllerConfig

type EventControllerConfig struct {
	ResyncPeriod   time.Duration
	OrganizationID string
	WorkerNumber   int
}

EventControllerConfig defines configuration for controller

type Handlers

type Handlers struct {
	Store   entitystore.EntityStore
	EQ      events.Queue
	Watcher controller.Watcher
}

Handlers is a base struct for event manager API handlers.

func (*Handlers) ConfigureHandlers

func (h *Handlers) ConfigureHandlers(api middleware.RoutableAPI)

ConfigureHandlers registers the function manager handlers to the API

type K8sBackendConfig

type K8sBackendConfig struct {
	Replicas             int32
	EnableReadinessProbe bool
	Namespace            string
}

K8sBackendConfig specify options for Kubernetes driver backend

type Subscriber

type Subscriber struct {
	Type string `json:"type"`
	Name string `json:"name"`
}

Subscriber represents a subscriber

type Subscription

type Subscription struct {
	entitystore.BaseEntity
	Topic      string     `json:"topic"`
	Subscriber Subscriber `json:"subscriber"`
	Secrets    []string   `json:"secrets,omitempty"`
}

Subscription struct represents a single subscription of subscriber to publisher

type SubscriptionManager

type SubscriptionManager interface {
	Run([]*Subscription) error
	Create(*Subscription) error
	Delete(*Subscription) error
}

func NewSubscriptionManager

func NewSubscriptionManager(mq events.Queue, fnClient client.FunctionsClient) (SubscriptionManager, error)

type SubscriptionManagerMock

type SubscriptionManagerMock struct {
	mock.Mock
}

SubscriptionManagerMock is an autogenerated mock type for the SubscriptionManagerMock type

func (*SubscriptionManagerMock) Create

func (_m *SubscriptionManagerMock) Create(_a0 *Subscription) error

Create provides a mock function with given fields: _a0

func (*SubscriptionManagerMock) Delete

func (_m *SubscriptionManagerMock) Delete(_a0 *Subscription) error

Delete provides a mock function with given fields: _a0

func (*SubscriptionManagerMock) Run

func (_m *SubscriptionManagerMock) Run(_a0 []*Subscription) error

Run provides a mock function with given fields: _a0

Directories

Path Synopsis
gen
restapi
Package restapi Event Manager VMware Dispatch Event Manager
Package restapi Event Manager VMware Dispatch Event Manager

Jump to

Keyboard shortcuts

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