yaml

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package yaml encoder/decoder

Index

Constants

This section is empty.

Variables

View Source
var (
	IGNORE_PREFIX = []byte("```yaml")
	IGNORE_SUFFIX = []byte("```")
)

Functions

This section is empty.

Types

type CommentStyle added in v1.2.6

type CommentStyle int
const (
	NoComment CommentStyle = iota
	HeadComment
	LineComment
	FootComment
)

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

func NewEncoder

func NewEncoder(req any) *Encoder

func (*Encoder) Context

func (e *Encoder) Context() []byte

func (*Encoder) Elem added in v1.5.0

func (e *Encoder) Elem() any

func (*Encoder) Instance added in v1.5.0

func (e *Encoder) Instance() any

func (*Encoder) Marshal

func (e *Encoder) Marshal(v any) ([]byte, error)

func (*Encoder) Unmarshal

func (e *Encoder) Unmarshal(bs []byte, ret any) error

func (*Encoder) Validate

func (e *Encoder) Validate(req any) error

func (*Encoder) WithCommentStyle added in v1.2.6

func (e *Encoder) WithCommentStyle(style CommentStyle) *Encoder

type StreamEncoder

type StreamEncoder struct {
	// contains filtered or unexported fields
}

func NewStreamEncoder

func NewStreamEncoder(req any) (*StreamEncoder, error)

func (*StreamEncoder) Context

func (e *StreamEncoder) Context() []byte

func (*StreamEncoder) Elem added in v1.5.0

func (e *StreamEncoder) Elem() any

func (*StreamEncoder) EnableValidate

func (e *StreamEncoder) EnableValidate()

func (*StreamEncoder) Instance added in v1.5.0

func (e *StreamEncoder) Instance() any

func (*StreamEncoder) Marshal

func (e *StreamEncoder) Marshal(req any) ([]byte, error)

func (*StreamEncoder) Read

func (e *StreamEncoder) Read(ctx context.Context, ch <-chan string) <-chan any

func (*StreamEncoder) Validate

func (e *StreamEncoder) Validate(req any) error

Jump to

Keyboard shortcuts

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