authorization

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var None = Header{}

None is a fixed value for a missing or blank header that implies no credentials.

Functions

func WithHeader

func WithHeader(ctx context.Context, header Header) context.Context

WithHeader returns a new child context that contains the header value.

Types

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

Header wraps the raw string from the HTTP Authorization header.

func FromContext

func FromContext(ctx context.Context) Header

FromContext fetches the authorization Header value stored on this context (if any). If there is no header on this context, you'll simply get back a zero-value header.

func New

func New(value string) Header

New creates a Header based on the HTTP Authorization header value that can be used for RPC authorization.

func (Header) Empty

func (h Header) Empty() bool

Empty returns true when the fully qualified header value is blank.

func (Header) NotEmpty

func (h Header) NotEmpty() bool

NotEmpty returns true when the fully qualified header value has at least one character.

func (Header) String

func (h Header) String() string

Jump to

Keyboard shortcuts

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