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
- Variables
- func NewEventController(manager SubscriptionManager, backend DriverBackend, ...) controller.Controller
- type Driver
- type DriverBackend
- type DriverBackendMock
- type EventControllerConfig
- type Handlers
- type K8sBackendConfig
- type Subscriber
- type Subscription
- type SubscriptionManager
- type SubscriptionManagerMock
Constants ¶
const ( DefaultResyncPeriod = 60 * time.Second DefaultWorkerNumber = 100 )
const ( // FunctionSubscriber defines a function type of subscriber FunctionSubscriber = "function" // EventSubscriber defines an event type of subscriber EventSubscriber = "event" )
Variables ¶
var EventDriverTemplates = map[string]map[string]bool{ "vcenter": map[string]bool{ "vcenterurl": true, }, }
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 ¶
func NewK8sBackend ¶
func NewK8sBackend() (DriverBackend, error)
type DriverBackendMock ¶
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 ¶
K8sBackendConfig specify options for Kubernetes driver backend
type Subscriber ¶
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 ¶
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