Documentation ¶
Index ¶
- Variables
- func Guess(path string) (tdl.MediaType, error)
- func Marshal(m proto.Message, media tdl.MediaType) ([]byte, error)
- func Match[T any](media tdl.MediaType, match Matcher[T]) (T, error)
- func Parse(value string) (tdl.MediaType, error)
- func ProtoReader(message proto.Message, media tdl.MediaType) io.Reader
- func Supported(media tdl.MediaType) bool
- func Unmarshal(data []byte, m proto.Message, media tdl.MediaType) error
- func UnsupportedErr[M string | tdl.MediaType](media M) error
- type MatchFunc
- type Matcher
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ApplicationGoogleProtobuf tdl.MediaType = "application/vnd.google.protobuf" ApplicationJson tdl.MediaType = "application/json" ApplicationProtobuf tdl.MediaType = "application/protobuf" ApplicationXProtobuf tdl.MediaType = "application/x-protobuf" ApplicationXYaml tdl.MediaType = "application/x-yaml" ApplicationYaml tdl.MediaType = "application/yaml" TextJson tdl.MediaType = "text/json" TextYaml tdl.MediaType = "text/yaml" )
View Source
var Unmatched = errors.New("no match for mediatype")
Error returned by Match when no match was found
Functions ¶
func ProtoReader ¶ added in v0.0.32
Types ¶
Click to show internal directories.
Click to hide internal directories.