transport

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MimeTypeUnknown = MimeType(iota)
	MimeTypeJSON
	MimeTypeXML
	MimeTypeYAML
	MimeTypeProtobuf
	MimeTypeAvro
	MimeTypeThrift
	MimeTypeMsgPack
	MimeTypeForm
	MimeTypeMultipartForm
	MimeTypeOctetStream
	MimeTypeText
	MimeTypeHTML
	MimeTypeCSV
	MimeTypePNG
	MimeTypeJPEG
	MimeTypeGIF
	MimeTypeSVG
	MimeTypeBMP
	MimeTypeTIFF
	MimeTypeWebP
	MimeTypeHEIF
	MimeTypeICO
	MimeTypeAVIF
	MimeTypeWebM
	MimeTypeMP4
	MimeTypeMKV
	MimeTypeAVI
	MimeTypeWMV
	MimeTypeFLV
	MimeTypeMOV
	MimeTypeMPEG
	MimeTypeMP3
	MimeTypeWAV
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataContainer

type DataContainer[T any] struct {
	// Data the item to be tagged as data value.
	Data T `json:"data"`
}

DataContainer is a sentinel structure to hold a sole item as Data.

This structure helps APIs exposed to external system clients through transport protocols to create a definition of a returning values and thus, a clear separation of different return values (i.e. errors).

type MimeType

type MimeType uint16

MimeType represents a MIME type.

func NewMimeType

func NewMimeType(s string) MimeType

NewMimeType creates a new MimeType from a string value.

func (MimeType) MarshalText

func (m MimeType) MarshalText() (text []byte, err error)

MarshalText marshals the MIME type into text.

func (MimeType) String

func (m MimeType) String() string

String returns the string representation of the MIME type.

func (*MimeType) UnmarshalText

func (m *MimeType) UnmarshalText(text []byte) error

UnmarshalText unmarshals the MIME type from text.

type PageResponse

type PageResponse[T any] struct {
	TotalItems        int    `json:"total_items"`
	PreviousPageToken string `json:"previous_page_token"`
	NextPageToken     string `json:"next_page_token"`
	Items             []T    `json:"items"`
}

PageResponse is a structure to hold a paginated response.

This structure helps APIs exposed to external system clients through transport protocols to create a definition of a paginated response and thus, a clear separation of different return values.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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