docs

package
v3.65.6 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientFieldSpec

func ClientFieldSpec(forOutput bool, extraChildren ...docs.FieldSpec) docs.FieldSpec

ClientFieldSpec returns a field spec for an http client component.

func ServerCORSFieldSpec

func ServerCORSFieldSpec() docs.FieldSpec

ServerCORSFieldSpec returns a field spec for an http server CORS component.

Types

type ServerCORS

type ServerCORS struct {
	Enabled        bool     `json:"enabled" yaml:"enabled"`
	AllowedOrigins []string `json:"allowed_origins" yaml:"allowed_origins"`
}

ServerCORS contains configuration for allowing CORS headers.

func NewServerCORS

func NewServerCORS() ServerCORS

NewServerCORS returns a new server CORS config with default fields.

func (ServerCORS) WrapHandler

func (conf ServerCORS) WrapHandler(handler http.Handler) (http.Handler, error)

WrapHandler wraps a provided HTTP handler with middleware that enables CORS requests (when configured).

Jump to

Keyboard shortcuts

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