triggers

package
v0.14.1-rc.5 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID      string
	Topic   string
	Payload []byte
}

Event - A nitric event that has come from a trigger source

func (*Event) GetTriggerType

func (*Event) GetTriggerType() TriggerType

type HttpRequest

type HttpRequest struct {
	Header map[string][]string
	// The original body stream
	Body []byte
	// The original method
	Method string
	// The original path
	Path string
	// URL query parameters
	Query map[string][]string
	// Path parameters
	Params map[string]string
}

HttpRequest - Storage information that captures a HTTP Request

func FromHttpRequest

func FromHttpRequest(ctx *fasthttp.RequestCtx) *HttpRequest

FromHttpRequest (constructs a HttpRequest source type from a HttpRequest)

func (*HttpRequest) GetTriggerType

func (*HttpRequest) GetTriggerType() TriggerType

type HttpResponse

type HttpResponse struct {
	// The original Headers
	Header *fasthttp.ResponseHeader
	// The original body stream
	Body []byte
	// The original method
	StatusCode int
}

HttpRequest - Storage information that captures a HTTP Request

func FromHttpResponse

func FromHttpResponse(resp *fasthttp.Response) *HttpResponse

FromHttpRequest (constructs a HttpRequest source type from a HttpRequest)

func FromTriggerResponse

func FromTriggerResponse(triggerResponse *pb.TriggerResponse) (*HttpResponse, error)

FromTriggerResponse (constructs a HttpResponse from a FaaS TriggerResponse)

type Trigger

type Trigger interface {
	GetTriggerType() TriggerType
}

type TriggerType

type TriggerType int

SourceType enum

const (
	TriggerType_Subscription TriggerType = iota
	TriggerType_Request
	TriggerType_Custom
)

func (TriggerType) String

func (e TriggerType) String() string

Jump to

Keyboard shortcuts

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