encoding

package
v0.0.0-...-d47e5ee Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonOption

type CommonOption func(*CommonOptions)

CommonOption represents an option common to all encoders and decoders in boa.

type CommonOptions

type CommonOptions struct {
	NamingConvention NamingConvention
}

CommonOptions represents the base set of configurations that may be set on any boa encoder or decoder.

You should not be using this type directly -- instead, set relevant options via one of the options in the boa package, or package-specific options in the package of the relevant encoder or decoder.

type Decoder

type Decoder interface {
	Decode(v interface{}) error
	Option(...interface{}) Decoder
}

type DecoderOption

type DecoderOption func(*DecoderOptions)

DecoderOption represents an option common to all decoders in boa.

type DecoderOptions

type DecoderOptions struct {
	Indent       string
	AutomaticEnv bool
	EnvPrefix    string
	LookupEnv    func(string) (string, bool)
}

DecoderOptions represents the base set of configurations that may be set on any boa decoder.

You should not be using this type directly -- instead, set relevant options via one of the options in the boa package, or decoder-specific options in the package of the relevant decoder.

type Encoder

type Encoder interface {
	Encode(v interface{}) error
	Option(...interface{}) Encoder
}

type EncoderOption

type EncoderOption func(*EncoderOptions)

EncoderOption represents an option common to all encoders in boa.

type EncoderOptions

type EncoderOptions struct {
	Indent    string
	LineBreak string
}

EncoderOptions represents the base set of configurations that may be set on any boa encoder.

You should not be using this type directly -- instead, set relevant options via one of the options in the boa package, or encoder-specific options in the package of the relevant encoder.

type LoadError

type LoadError struct {
	Filename string
	syntax.Cursor
	Target string
	Err    error
}

func (*LoadError) Error

func (e *LoadError) Error() string

func (*LoadError) Unwrap

func (e *LoadError) Unwrap() error

type NamingConvention

type NamingConvention interface {
	Format(string) string
}

A NamingConvention formats a string that follows the Go naming convention into another naming convention.

var (
	CamelCase          NamingConvention = camelCase("camelCase", 0, false)
	PascalCase         NamingConvention = camelCase("PascalCase", 0, true)
	SnakeCase          NamingConvention = constantCase("snake_case", '_', false)
	ScreamingSnakeCase NamingConvention = constantCase("SCREAMING_SNAKE_CASE", '_', true)
	KebabCase          NamingConvention = constantCase("kebab-case", '-', false)
	ScreamingKebabCase NamingConvention = constantCase("SCREAMING-KEBAB-CASE", '-', true)
	CamelSnakeCase     NamingConvention = camelCase("camel_Snake_Case", '_', false)
	PascalSnakeCase    NamingConvention = camelCase("Pascal_Snake_Case", '_', true)
	TrainCase          NamingConvention = camelCase("Train-Case", '-', true)
	FlatCase           NamingConvention = constantCase("flatcase", 0, false)
	UpperFlatCase      NamingConvention = constantCase("UPPERFLATCASE", 0, true)
)

func NamingConventionByName

func NamingConventionByName(name string) NamingConvention

type StatableReader

type StatableReader interface {
	io.Reader
	Stat() (fs.FileInfo, error)
}

StatableReader is a reader that can be Stat()-ed.

type StatableWriter

type StatableWriter interface {
	io.Writer
	Stat() (fs.FileInfo, error)
}

StatableWriter is a writer that can be Stat()-ed.

type TextMarshaler

type TextMarshaler = encoding.TextMarshaler

type TextUnmarshaler

type TextUnmarshaler = encoding.TextUnmarshaler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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