http

package
v0.30.113 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Feature

func Feature(config ...func(*Installer)) setup.Feature

Feature configures http client support

func Format

func Format(format string) miruken.Builder

Format returns a miruken.Builder requesting a specific format.

func Pipeline added in v0.28.0

func Pipeline(policies ...Policy) miruken.Builder

Pipeline returns a miruken.Builder that registers policies to apply during http request processing.

Types

type Installer

type Installer struct{}

Installer configure http client support.

func (*Installer) DependsOn

func (i *Installer) DependsOn() []setup.Feature

func (*Installer) Install

func (i *Installer) Install(b *setup.Builder) error

type Options

type Options struct {
	Format      string
	ProcessPath string
	PublishPath string
	Pipeline    []Policy
}

Options customize http operations.

type Policy added in v0.28.0

type Policy interface {
	Apply(
		req *http.Request,
		composer miruken.Handler,
		next func() (*http.Response, error),
	) (*http.Response, error)
}

Policy defines custom behavior for http requests.

func BasicAuth added in v0.30.42

func BasicAuth(username, password string) Policy

func Client added in v0.28.0

func Client(client *http.Client) Policy

Client returns a Policy to use the supplied http.Client. This should be the last Policy in the pipeline.

type PolicyFunc added in v0.30.43

type PolicyFunc func(
	req *http.Request,
	composer miruken.Handler,
	next func() (*http.Response, error),
) (*http.Response, error)

PolicyFunc promotes a function to Policy.

func (PolicyFunc) Apply added in v0.30.43

func (f PolicyFunc) Apply(
	req *http.Request,
	composer miruken.Handler,
	next func() (*http.Response, error),
) (*http.Response, error)

type Router

type Router struct{}

Router routes messages over a http transport.

func (*Router) Route

func (r *Router) Route(
	_ *struct {
		handles.It
		api.Routes `scheme:"http,https"`
	}, routed api.Routed,
	_ *struct {
		args.Optional
		args.FromOptions
	}, options Options,
	ctx miruken.HandleContext,
) *promise.Promise[any]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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