Documentation
¶
Overview ¶
Package yaml encoder/decoder
Index ¶
- Variables
- type CommentStyle
- type Encoder
- func (e *Encoder) Context() []byte
- func (e *Encoder) Elem() any
- func (e *Encoder) Instance() any
- func (e *Encoder) Marshal(v any) ([]byte, error)
- func (e *Encoder) Unmarshal(bs []byte, ret any) error
- func (e *Encoder) Validate(req any) error
- func (e *Encoder) WithCommentStyle(style CommentStyle) *Encoder
- type StreamEncoder
- func (e *StreamEncoder) Context() []byte
- func (e *StreamEncoder) Elem() any
- func (e *StreamEncoder) EnableValidate()
- func (e *StreamEncoder) Instance() any
- func (e *StreamEncoder) Marshal(req any) ([]byte, error)
- func (e *StreamEncoder) Read(ctx context.Context, ch <-chan string) <-chan any
- func (e *StreamEncoder) Validate(req any) error
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 (*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) Read ¶
func (e *StreamEncoder) Read(ctx context.Context, ch <-chan string) <-chan any
func (*StreamEncoder) Validate ¶
func (e *StreamEncoder) Validate(req any) error
Click to show internal directories.
Click to hide internal directories.