encoder

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder[P ecs.EcsTarget] interface {
	Encode(in []byte, format Format) (*P, error)
}

func NewEncoder

func NewEncoder[P ecs.EcsTarget](logger *zap.Logger) Encoder[P]

type EncoderImpl

type EncoderImpl[P ecs.EcsTarget] struct {
	// contains filtered or unexported fields
}

func (EncoderImpl[P]) Encode

func (e EncoderImpl[P]) Encode(in []byte, format Format) (*P, error)

func (EncoderImpl[P]) EncodeJson

func (e EncoderImpl[P]) EncodeJson(in []byte) (*P, error)

func (EncoderImpl[P]) EncodeYaml

func (e EncoderImpl[P]) EncodeYaml(in []byte) (*P, error)

type Format

type Format int
const (
	Json Format = iota
	Yaml
	Unknow
)

func GetFormat

func GetFormat(ext string) Format

Jump to

Keyboard shortcuts

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