sdk

package
v0.0.0-...-1d1d6d3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Common package for the VNFM and the Plugin SDK for Open Baton Managers. It provides common functions for registering, unregistering, starting the manager, etc.

Index

Constants

View Source
const (
	AmqpContentType       = "text/plain"
	OpenbatonExchangeName = "openbaton-exchange"
)

Variables

This section is empty.

Functions

func GetLogger

func GetLogger(name string, levelStr string) *logging.Logger

Obtain the Logger pre-formatted

func GetPluginCreds

func GetPluginCreds(username string, password string, brokerIp string, brokerPort, timeout int, pluginType string, logLevel string) (*catalogue.ManagerCredentials, error)

Function to retrieve the private amqp credentials for a Plugin

func GetVnfmCreds

func GetVnfmCreds(username string, password string, brokerIp string, brokerPort, timeout int, vnfmEndpoint *catalogue.Endpoint, logLevel string) (*catalogue.ManagerCredentials, error)

Function to retrieve the private amqp credentials for a VNFM

func Rpc

func Rpc(queue string, message interface{}, conn *amqp.Connection, l *logging.Logger) ([]byte, error)

Execute a AMQP RPC call to a specific queue

func SendMsg

func SendMsg(queue string, message []byte, channel *amqp.Channel, logger *logging.Logger) error

Send message to a specific queue

Types

type DriverError

type DriverError struct {
	Message           string `json:"detailMessage"`
	*catalogue.Server `json:"server"`
}

Vim Driver Error

func (DriverError) Error

func (e DriverError) Error() string

Error returns a description of the error.

type Handler

type Handler interface{}

The plugin or vnfm Handler interface

type Manager

type Manager struct {
	Connection *amqp.Connection
	Channel    *amqp.Channel
	// contains filtered or unexported fields
}

The generic Manager struct

func NewManager

func NewManager(h Handler,
	username string,
	password string,
	brokerIp string,
	brokerPort int,
	exchange string,
	queueName string,
	workers int,
	allocate bool,
	managerName string,
	handleFunction handlerFunction,
	logLevel string,
	net catalogue.BaseNetworkInt,
	img catalogue.BaseImageInt) (*Manager, error)

Instantiate a new Manager struct

func (*Manager) Serve

func (manager *Manager) Serve()

Serve function for Manager. Start consuming.

func (*Manager) Shutdown

func (manager *Manager) Shutdown() error

Shutdown the manager

func (*Manager) Unregister

func (manager *Manager) Unregister(typ, username, password string, vnfmEndpoint *catalogue.Endpoint)

Unregister function for Managers

type SdkError

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

func NewSdkError

func NewSdkError(msg string) *SdkError

func (*SdkError) Error

func (e *SdkError) Error() string

Jump to

Keyboard shortcuts

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