yaml

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 3 Imported by: 19

Documentation

Overview

Package yaml implements a YAML Marshaler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Yaml

type Yaml struct{}

Yaml implements the codecs.Marshaler interface. It can be used to encode/decode yaml files, or web requests.

func (*Yaml) ContentTypes

func (j *Yaml) ContentTypes() []string

ContentTypes returns the content types the marshaller can handle.

func (*Yaml) Exts

func (j *Yaml) Exts() []string

Exts is a list of file extensions this marshaler supports.

func (*Yaml) Marshal added in v0.2.0

func (j *Yaml) Marshal(v any) ([]byte, error)

Marshal encodes any pointer into yaml byte.

func (*Yaml) Marshals added in v0.2.0

func (j *Yaml) Marshals(v any) bool

Marshals returns if this is able to encode the given type.

func (*Yaml) Name added in v0.2.0

func (j *Yaml) Name() string

Name returns the codec name.

func (*Yaml) NewDecoder

func (j *Yaml) NewDecoder(r io.Reader) codecs.Decoder

NewDecoder returns a new JSON/ProtocolBuffer decoder.

func (*Yaml) NewEncoder

func (j *Yaml) NewEncoder(w io.Writer) codecs.Encoder

NewEncoder returns a new JSON/ProtocolBuffer encoder.

func (*Yaml) Unmarshal added in v0.2.0

func (j *Yaml) Unmarshal(data []byte, v any) error

Unmarshal decodes yaml bytes into object v. Param v should be a pointer type.

func (*Yaml) Unmarshals added in v0.2.0

func (j *Yaml) Unmarshals(v any) bool

Unmarshals returns if this is able to decode the given type.

Jump to

Keyboard shortcuts

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