strdecode

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 10 Imported by: 3

README

go-strdecode

Very simply string unmarshaler, useful in CLI arg and environment variable unmarshaling.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitFunc

func SplitFunc(str string, fn func(string) error) error

SplitFunc ...

func Unmarshal

func Unmarshal(dst interface{}, src string) error

Unmarshal ...

Types

type Decoder

type Decoder struct{ Splitter }

Decoder ...

func (*Decoder) Unmarshal

func (d *Decoder) Unmarshal(dst interface{}, src string) error

Unmarshal ...

func (*Decoder) UnmarshalInto

func (d *Decoder) UnmarshalInto(dst reflect.Value, typ reflect.Type, src string) error

UnmarshalInto ...

type Splitter

type Splitter struct{ B []byte }

Splitter ...

func (*Splitter) SplitFunc

func (s *Splitter) SplitFunc(str string, fn func(string) error) error

SplitFunc ...

type Unmarshaler

type Unmarshaler interface {
	UnmarshalString(string) error
}

Unmarshaler represents a type capable of being unmarshaled from a simple string representation.

Jump to

Keyboard shortcuts

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