content

package
v1.283.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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TypeKey for HTTP headers.
	TypeKey = "Content-Type"

	// ErrInvalidEncoder for content.
	ErrInvalidEncoder = errors.New("invalid encoder")
)

Functions

func AddJSONHeader added in v1.243.0

func AddJSONHeader(header http.Header)

AddJSONHeader for content.

Types

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, error)

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