Documentation ¶
Index ¶
- Variables
- func Check(c ContentType) bool
- func Marshal(t ContentType, writer io.Writer, value interface{}) error
- func MarshalJSON(w io.Writer, v interface{}) error
- func MarshalProtobuf(w io.Writer, any interface{}) error
- func MarshalString(w io.Writer, value interface{}) error
- func MarshalYAML(w io.Writer, v interface{}) error
- func Unmarshal(t ContentType, reader io.Reader, value interface{}) error
- func UnmarshalJSON(r io.Reader, v interface{}) error
- func UnmarshalProtobuf(r io.Reader, any interface{}) error
- func UnmarshalString(r io.Reader, v interface{}) error
- func UnmarshalYAML(r io.Reader, v interface{}) error
- type ContentType
- type Duration
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Check ¶
func Check(c ContentType) bool
func MarshalJSON ¶
func MarshalProtobuf ¶
func MarshalString ¶
func MarshalYAML ¶
func UnmarshalJSON ¶
func UnmarshalProtobuf ¶
func UnmarshalString ¶
func UnmarshalYAML ¶
Types ¶
type ContentType ¶
type ContentType string
const ( ContentTypeDefault ContentType = ContentType("") ContentTypeAny ContentType = ContentType("*/*") ContentTypeJSON ContentType = ContentType("application/json") ContentTypeYAML ContentType = ContentType("application/yaml") ContentTypeProtobuf ContentType = ContentType("application/protobuf") ContentTypeHTML ContentType = ContentType("text/html") ContentTypePlain ContentType = ContentType("text/plain") )
func ContentTypeFromString ¶
func ContentTypeFromString(t string) (ContentType, error)
Returns the ContentType given the string.
func (ContentType) String ¶
func (this ContentType) String() string
type Duration ¶
func (Duration) MarshalJSON ¶
func (Duration) MarshalYAML ¶
func (*Duration) UnmarshalJSON ¶
func (*Duration) UnmarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.