content

package
v1.269.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 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"

	// ErrInvalidMarshaller for content.
	ErrInvalidMarshaller = errors.New("invalid marshaller")
)

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) IsText

func (t *Type) IsText() bool

IsText for type.

func (*Type) Marshaller

func (t *Type) Marshaller(enc *encoding.Map) (encoding.Marshaller, error)

Marshaller for type.

Jump to

Keyboard shortcuts

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