yaml

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 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) Decode

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

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

func (*Yaml) Decodes

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

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

func (*Yaml) Encode

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

Encode encodes any pointer into yaml byte.

func (*Yaml) Encodes

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

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

func (*Yaml) Exts

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

Exts is a list of file extensions this encoder supports.

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

func (j *Yaml) String() string

String returns the plugin implementation of the marshaler.

Jump to

Keyboard shortcuts

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