functions

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 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, error)

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) CallWithContext added in v0.12.0

func (m *Module) CallWithContext(ctx context.Context, service, function string, auth map[string]interface{}, params interface{}) (interface{}, error)

CallWithContext invokes function on a service. The response from the function is returned back along with any errors if they occurred.

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) 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