functions

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2019 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Module is responsible for functions

func Init

func Init() *Module

Init returns a new instance of the Functions module

func (*Module) Call

func (m *Module) Call(service, function string, auth map[string]interface{}, params interface{}, timeout int) (interface{}, error)

Call simply calls a function on a service

func (*Module) HandleServiceResponse

func (m *Module) HandleServiceResponse(res *model.FunctionsPayload)

HandleServiceResponse handles the service response

func (*Module) IsEnabled

func (m *Module) IsEnabled() bool

IsEnabled checks if the Functions module is enabled

func (*Module) RegisterService

func (m *Module) RegisterService(clientID string, req *model.ServiceRegisterRequest, sendPayload SendPayload)

RegisterService registers a new service with the functions module

func (*Module) SetConfig

func (m *Module) SetConfig(functions *config.Functions) error

SetConfig set the config required by the Functions module

func (*Module) UnregisterService

func (m *Module) UnregisterService(clientID string)

UnregisterService removes a service from the functions module

type SendPayload

type SendPayload func(*model.FunctionsPayload)

SendPayload is the function called whenever a data point (payload) is to be sent

Jump to

Keyboard shortcuts

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