httpapp

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoInput

type DoInput struct {
	JSON    interface{}       `json:"json"`
	Method  string            `json:"method" validate:"required,oneof=GET HEAD POST PUT DELETE OPTIONS PATCH"`
	Params  map[string]string `json:"params"`
	Data    []byte            `json:"data"`
	Retries int               `json:"retries" validate:"gte=0,lte=3"`
	Headers map[string]string `json:"headers"`
	URL     string            `json:"url" validate:"required,http_url"`
}

func NewDoInput

func NewDoInput(data []byte) (*DoInput, error)

NewDoInput creates a DoInput object from a json object given as bytes

func (*DoInput) HTTPRequest

func (d *DoInput) HTTPRequest() (*retryablehttp.Request, error)

type HTTPHandler

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

func NewHTTPHandler

func NewHTTPHandler(ctx context.Context, natsClient *nats.Client, logger zerolog.Logger) (*HTTPHandler, error)

func (*HTTPHandler) AppName

func (h *HTTPHandler) AppName() string

func (*HTTPHandler) Do

func (h *HTTPHandler) Do(ctx context.Context, msg jetstream.Msg) error

func (*HTTPHandler) Handlers

func (h *HTTPHandler) Handlers() map[string]worker.Handler

Jump to

Keyboard shortcuts

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