content

package
v1.286.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypeKey = "Content-Type"

TypeKey for HTTP headers.

Functions

func NewHandler added in v1.286.0

func NewHandler(prefix string, enc *encoding.Map, handler Handler) func(res http.ResponseWriter, req *http.Request)

NewHandler for content.

Types

type Handler added in v1.286.0

type Handler func(ctx context.Context) any

Handler for content.

type Type

type Type struct {
	Media string
	Kind  string
}

Type for content.

func NewFromMedia

func NewFromMedia(mediaType string) *Type

NewFromMedia for content.

func NewFromRequest

func NewFromRequest(req *http.Request) *Type

NewFromRequest for content.

func (*Type) Encoder added in v1.282.0

func (t *Type) Encoder(enc *encoding.Map) encoding.Encoder

Marshaller for type.

func (*Type) IsText

func (t *Type) IsText() bool

IsText for type.

Jump to

Keyboard shortcuts

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