cors

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamServerInterceptor

func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor

StreamServerInterceptor returns a new streaming server interceptor for OpenTracing.

func UnaryServerInterceptor

func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor

UnaryServerInterceptor returns a new unary server interceptor for OpenTracing.

Types

type Handler

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

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin https://fetch.spec.whatwg.org/#cors-protocol-and-credentials For requests without credentials, the server may specify "*" as a wildcard, thereby allowing any origin to access the resource.

func NewHandler

func NewHandler(r PatternRegistry, opts ...Option) *Handler

func (*Handler) RegisterHandler

func (r *Handler) RegisterHandler(mux *runtime.ServeMux)

func (Handler) ServeHTTP

func (r Handler) ServeHTTP(w http.ResponseWriter, req *http.Request, _ map[string]string)

type Option

type Option func(*options)

func AllowSubdomain

func AllowSubdomain(allow bool) Option

func OriginHost

func OriginHost(host string) Option

type PatternRegistry

type PatternRegistry []runtime.Pattern

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin https://fetch.spec.whatwg.org/#cors-protocol-and-credentials For requests without credentials, the server may specify "*" as a wildcard, thereby allowing any origin to access the resource.

func (*PatternRegistry) Register

func (r *PatternRegistry) Register(f []runtime.Pattern)

Jump to

Keyboard shortcuts

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