apiworker

package
v0.0.65 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequestFromMessage

func NewRequestFromMessage(msg *nats.Msg, subscribePath, handlerPath string) (*http.Request, error)

func NewStdResponseWriter

func NewStdResponseWriter(w io.Writer) *stdResponseWriter

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithContextName

func WithContextName(contextName string) Option

func WithCreds

func WithCreds(creds string) Option

func WithMetricsAddress

func WithMetricsAddress(address string) Option

func WithNKey

func WithNKey(nkey string) Option

func WithPassword

func WithPassword(password string) Option

func WithTLSCA

func WithTLSCA(tlsca string) Option

func WithTLSCert

func WithTLSCert(tlscert string) Option

func WithTLSKey

func WithTLSKey(tlskey string) Option

func WithURL

func WithURL(url string) Option

func WithUser

func WithUser(user string) Option

type Worker

type Worker interface {
	ListenAndServe(ctx context.Context) error
	Shutdown(ctx context.Context) error
}

func NewWorker

func NewWorker(ctx context.Context, serverURL string, routes []apiserv.Route, options ...Option) (Worker, error)

Jump to

Keyboard shortcuts

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