appfunction

package
v2.0.0-dev.37 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

Context contains the data functions that implement the interfaces.AppFunctionContext

func NewContext

func NewContext(correlationID string, dic *di.Container, inputContentType string) *Context

NewContext creates, initializes and return a new Context with implements the interfaces.AppFunctionContext interface

func (*Context) CommandClient

func (appContext *Context) CommandClient() command.CommandClient

CommandClient returns the Command client, which may be nil, from the dependency injection container

func (*Context) CorrelationID

func (appContext *Context) CorrelationID() string

CorrelationID returns context's the correlation ID

func (*Context) EventClient

func (appContext *Context) EventClient() coredata.EventClient

EventClient returns the Event client, which may be nil, from the dependency injection container

func (*Context) GetSecret

func (appContext *Context) GetSecret(path string, keys ...string) (map[string]string, error)

GetSecret returns the secret data from the secret store (secure or insecure) for the specified path.

func (*Context) InputContentType

func (appContext *Context) InputContentType() string

InputContentType returns the context's inputContentType

func (*Context) LoggingClient

func (appContext *Context) LoggingClient() logger.LoggingClient

LoggingClient returns the Logging client from the dependency injection container

func (*Context) NotificationsClient

func (appContext *Context) NotificationsClient() notifications.NotificationsClient

NotificationsClient returns the Notifications client, which may be nil, from the dependency injection container

func (*Context) PushToCoreData

func (appContext *Context) PushToCoreData(deviceName string, readingName string, value interface{}) (*dtos.Event, error)

PushToCoreData pushes the provided value as an event to CoreData using the device name and reading name that have been set. TODO: This function must be reworked for the new V2 Event Client

func (*Context) ResponseContentType

func (appContext *Context) ResponseContentType() string

ResponseContentType returns the context's responseContentType

func (*Context) ResponseData

func (appContext *Context) ResponseData() []byte

ResponseData returns the context's responseData.

func (*Context) RetryData

func (appContext *Context) RetryData() []byte

RetryData returns the context's retryData. This function is not part of the AppFunctionContext interface, so it is internal SDK use only

func (*Context) SecretsLastUpdated

func (appContext *Context) SecretsLastUpdated() time.Time

SecretsLastUpdated returns that timestamp for when the secrets in the SecretStore where last updated.

func (*Context) SetCorrelationID

func (appContext *Context) SetCorrelationID(id string)

SetCorrelationID sets the correlationID. This function is not part of the AppFunctionContext interface, so it is internal SDK use only

func (*Context) SetInputContentType

func (appContext *Context) SetInputContentType(contentType string)

SetInputContentType sets the inputContentType. This function is not part of the AppFunctionContext interface, so it is internal SDK use only

func (*Context) SetResponseContentType

func (appContext *Context) SetResponseContentType(contentType string)

SetResponseContentType sets the context's responseContentType

func (*Context) SetResponseData

func (appContext *Context) SetResponseData(output []byte)

SetResponseData provides a way to return the specified data as a response to the trigger that initiated the execution of the function pipeline. In the case of an HTTP Trigger, the data will be returned as the http response. In the case of a message bus trigger, the data will be published to the configured message bus publish topic.

func (*Context) SetRetryData

func (appContext *Context) SetRetryData(payload []byte)

SetRetryData sets the context's retryData to the specified payload to be stored for later retry when the pipeline function returns an error.

Jump to

Keyboard shortcuts

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