canyontest

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DummySQSMessage = events.SQSMessage{
	MessageId:     "00000000-0000-0000-0000-000000000000",
	ReceiptHandle: "00000000/0000000000=",
	Body:          "{}",
	Attributes: map[string]string{
		"ApproximateReceiveCount":          "1",
		"SentTimestamp":                    "0",
		"SenderId":                         "000000000000",
		"ApproximateFirstReceiveTimestamp": "0",
	},
	MessageAttributes: map[string]events.SQSMessageAttribute{
		"Value": {
			StringValue: aws.String("1"),
			DataType:    "Number",
		},
	},
	EventSourceARN: "arn:aws:sqs:ap-northeast-1:123456789012:canyon-test",
	EventSource:    "aws:sqs",
	AWSRegion:      "ap-northeast-1",
}

DummySQSMessage is a dummy sqs message for testing.

Functions

func AsLambdaFallback added in v0.4.0

func AsLambdaFallback(next lambda.Handler, sender canyon.WorkerSender) lambda.Handler

AsLambdaFallback returns lambda.Handler that embeds logger and sqs message sender in context.

func AsServer

func AsServer(next http.Handler, sender canyon.WorkerSender) http.Handler

AsServer returns http.Handler that embeds logger and sqs message sender in context.

func AsWebsocket added in v0.7.0

AsWebsocket returns http.Handler that embeds logger and sqs message sender in context.

func AsWorker

func AsWorker(next http.Handler) http.Handler

AsServer returns http.Handler that embeds dummy sqs message hader and worker flag in context.

Types

type Runner

type Runner struct {
	URL      string // base URL of form http://ipaddr:port with no trailing slash
	Listener net.Listener
	Stdin    io.WriteCloser
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(mux http.Handler, _opts ...canyon.Option) *Runner

func (*Runner) Close

func (r *Runner) Close() error

func (*Runner) DLQReader added in v0.6.0

func (r *Runner) DLQReader() io.Reader

func (*Runner) RunError

func (r *Runner) RunError() error

Jump to

Keyboard shortcuts

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