events

package
v0.0.0-...-13c9a7e Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 3 Imported by: 31

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIGatewayQueryString

type APIGatewayQueryString map[string][]string

APIGatewayQueryString represents query string of an API gateway request

func (*APIGatewayQueryString) UnmarshalJSON

func (qs *APIGatewayQueryString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface, it handles the query string properly

type APIGatewayRequest

type APIGatewayRequest struct {
	Headers     map[string]string        `json:"headers"`
	Method      string                   `json:"httpMethod"`
	Path        string                   `json:"path"`
	QueryString APIGatewayQueryString    `json:"queryString"`
	Body        string                   `json:"body"`
	Context     APIGatewayRequestContext `json:"requestContext"`
}

APIGatewayRequest represents an API gateway request

type APIGatewayRequestContext

type APIGatewayRequestContext struct {
	ServiceID string `json:"serviceId"`
	RequestID string `json:"requestId"`
	Method    string `json:"httpMethod"`
	Path      string `json:"path"`
	SourceIP  string `json:"sourceIp"`
	Stage     string `json:"stage"`
	Identity  struct {
		SecretID *string `json:"secretId"`
	} `json:"identity"`
}

APIGatewayRequestContext represents a request context

type APIGatewayResponse

type APIGatewayResponse struct {
	IsBase64Encoded bool              `json:"isBase64Encoded"`
	StatusCode      int               `json:"statusCode"`
	Headers         map[string]string `json:"headers"`
	Body            string            `json:"body"`
}

APIGatewayResponse represents an API gateway response

type CMQEvent

type CMQEvent struct {
	Records []CMQRecord `json:"Records"`
}

CMQEvent represents a CMQ event which consists of multiple records

type CMQMessage

type CMQMessage struct {
	ID               string  `json:"msgId"`
	Body             string  `json:"msgBody"`
	Tags             CMQTags `json:"msgTag"`
	PublishTime      string  `json:"publishTime"`
	RequestID        string  `json:"requestId"`
	SubscriptionName string  `json:"subscriptionName"`
	TopicName        string  `json:"topicName"`
	TopicOwner       int64   `json:"topicOwner"`
	Type             string  `json:"type"`
}

CMQMessage represents a single CMQ message

type CMQRecord

type CMQRecord struct {
	Message CMQMessage `json:"CMQ"`
}

CMQRecord represents a CMQ record

type CMQTags

type CMQTags []string

CMQTags represents CMQ routing tags

func (*CMQTags) UnmarshalJSON

func (tags *CMQTags) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface, it handles the JSON String/Array properly

type COSBucket

type COSBucket struct {
	AppID  string `json:"appid"`
	Region string `json:"region"`
	Name   string `json:"name"`
}

COSBucket represents a COS bucket

type COSEntity

type COSEntity struct {
	NotificationID string    `json:"cosNotificationId"`
	SchemaVersion  string    `json:"cosSchemaVersion"`
	Bucket         COSBucket `json:"cosBucket"`
	Object         COSObject `json:"cosObject"`
}

COSEntity represents a COS object in a specific bucket

type COSEvent

type COSEvent struct {
	Records []COSRecord `json:"Records"`
}

COSEvent represents a COS event which consists of multiple records

type COSEventMetadata

type COSEventMetadata struct {
	RequestID  int64                `json:"reqid"`
	Name       string               `json:"eventName"`
	Queue      string               `json:"eventQueue"`
	Source     string               `json:"eventSource"`
	Timestamp  int64                `json:"eventTime"`
	Version    string               `json:"eventVersion"`
	Parameters COSRequestParameters `json:"requestParameters"`
	Reserved   string               `json:"reservedInfo"`
}

COSEventMetadata provides information about the event which creates a COS record

type COSObject

type COSObject struct {
	Name     string            `json:"key"`
	Size     int64             `json:"size"`
	URL      string            `json:"url"`
	Metadata map[string]string `json:"meta"`
	VID      string            `json:"vid"`
}

COSObject represents a COS object

type COSRecord

type COSRecord struct {
	Object COSEntity        `json:"cos"`
	Event  COSEventMetadata `json:"event"`
}

COSRecord represents a COS record

type COSRequestParameters

type COSRequestParameters struct {
	SourceIP string            `json:"requestSourceIP"`
	Headers  map[string]string `json:"requestHeaders"`
}

COSRequestParameters represents the request parameters

type CkafkaEvent

type CkafkaEvent struct {
	Records []CkafkaRecord `json:"Records"`
}

CkafkaEvent represents a Ckafka event which consists of multiple records

type CkafkaMessage

type CkafkaMessage struct {
	Topic     string `json:"topic"`
	Partition int64  `json:"partition"`
	Offset    int64  `json:"offset"`
	Key       string `json:"msgKey"`
	Body      string `json:"msgBody"`
}

CkafkaMessage represents a single Ckafka message

type CkafkaRecord

type CkafkaRecord struct {
	Message CkafkaMessage `json:"Ckafka"`
}

CkafkaRecord represents a Ckafka record

type TimerEvent

type TimerEvent struct {
	Message     string
	Time        string
	TriggerName string
	Type        string
}

TimerEvent represents a timer event

Jump to

Keyboard shortcuts

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