Documentation ¶
Index ¶
- Variables
- func AreLettersLower(str string) bool
- func AreLettersUpper(str string) bool
- func IsBeginningLower(str string) bool
- func IsBeginningUpper(str string) bool
- func ToLowerBeginning(str string) string
- func ToUpperBeginning(str string) string
- func TryUnquote(s string) string
- type ArgumentParseError
- type ArgumentStruct
- func (a *ArgumentStruct) Fields(ifc interface{}) (ArgumentStructFields, error)
- func (a *ArgumentStruct) FieldsByValue(val reflect.Value) (ArgumentStructFields, error)
- func (a *ArgumentStruct) GetField(ifc interface{}, name string) (interface{}, string, error)
- func (a *ArgumentStruct) GetFieldByValue(val reflect.Value, name string) (reflect.Value, string, error)
- func (a *ArgumentStruct) SetField(ifc interface{}, name string, values ...string) (interface{}, string, error)
- func (a *ArgumentStruct) SetFieldByValue(val reflect.Value, name string, values ...string) (reflect.Value, string, error)
- func (a *ArgumentStruct) Unmarshal(ifc interface{}, args ...string) error
- func (a *ArgumentStruct) UnmarshalByValue(val reflect.Value, args ...string) error
- type ArgumentStructField
- type ArgumentStructFields
- type Arguments
- type FormatError
- type Marshaler
- type MissingArgumentError
- type ParseError
- type Unmarshaler
- func (u *Unmarshaler) Parse(str string, typ reflect.Type) (interface{}, error)
- func (u *Unmarshaler) ParseToValue(str string, typ reflect.Type) (reflect.Value, error)
- func (u *Unmarshaler) Unmarshal(str string, ifc interface{}) error
- func (u *Unmarshaler) UnmarshalByValue(str string, val reflect.Value) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultIntBase = 10 DefaultTimeLayout = time.RFC3339 DefaultFloatFmt = byte('f') DefaultFloatPrec = -1 DefaultComplexFmt = byte('f') DefaultComplexPrec = -1 DefaultIndent = "" DefaultMultiLinePrefix = "" )
View Source
var ( ErrCanNotGetAddr = errors.New("can not get address of value") ErrNilPointer = errors.New("nil pointer error") ErrValueMustBeStruct = errors.New("value must be struct") ErrArgumentCountExceeded = errors.New("argument count exceeded") ErrArgumentStructFieldNotFound = errors.New("argument struct field not found") )
Functions ¶
func AreLettersLower ¶ added in v0.9.0
func AreLettersUpper ¶ added in v0.9.0
func IsBeginningLower ¶ added in v0.8.0
func IsBeginningUpper ¶ added in v0.8.0
func ToLowerBeginning ¶
func ToUpperBeginning ¶
func TryUnquote ¶
Types ¶
type ArgumentParseError ¶ added in v0.4.0
type ArgumentParseError struct {
// contains filtered or unexported fields
}
func (*ArgumentParseError) Error ¶ added in v0.4.0
func (e *ArgumentParseError) Error() string
func (*ArgumentParseError) Name ¶ added in v0.10.0
func (e *ArgumentParseError) Name() string
func (*ArgumentParseError) Unwrap ¶ added in v0.4.0
func (e *ArgumentParseError) Unwrap() error
type ArgumentStruct ¶ added in v0.4.0
type ArgumentStruct struct { Unmarshaler *Unmarshaler FieldNameBeginsLowerCase bool FieldNameFold bool FieldTagKey string FieldOffset int ArgCountMin int ArgCountMax int }
func (*ArgumentStruct) Fields ¶ added in v0.4.0
func (a *ArgumentStruct) Fields(ifc interface{}) (ArgumentStructFields, error)
func (*ArgumentStruct) FieldsByValue ¶ added in v0.4.0
func (a *ArgumentStruct) FieldsByValue(val reflect.Value) (ArgumentStructFields, error)
func (*ArgumentStruct) GetField ¶ added in v0.4.1
func (a *ArgumentStruct) GetField(ifc interface{}, name string) (interface{}, string, error)
func (*ArgumentStruct) GetFieldByValue ¶ added in v0.4.1
func (*ArgumentStruct) SetField ¶ added in v0.4.0
func (a *ArgumentStruct) SetField(ifc interface{}, name string, values ...string) (interface{}, string, error)
func (*ArgumentStruct) SetFieldByValue ¶ added in v0.4.0
func (*ArgumentStruct) Unmarshal ¶ added in v0.4.0
func (a *ArgumentStruct) Unmarshal(ifc interface{}, args ...string) error
func (*ArgumentStruct) UnmarshalByValue ¶ added in v0.4.0
func (a *ArgumentStruct) UnmarshalByValue(val reflect.Value, args ...string) error
type ArgumentStructField ¶ added in v0.4.0
type ArgumentStructFields ¶ added in v0.4.0
type ArgumentStructFields []ArgumentStructField
func (ArgumentStructFields) String ¶ added in v0.4.0
func (a ArgumentStructFields) String() string
type Arguments ¶ added in v0.4.0
type Arguments struct {
Comment rune
}
type FormatError ¶
type FormatError struct {
// contains filtered or unexported fields
}
FormatError is type of error
type Marshaler ¶
type Marshaler struct { IntBase int TimeLayout string FloatFmt byte FloatPrec int ComplexFmt byte ComplexPrec int Indent string MultiLinePrefix string FuncFormatBool func(v bool) string FuncFormatInt func(v int64) string FuncFormatUint func(v uint64) string FuncFormatFloat func(v float64) string FuncFormatComplex func(v complex128) string FuncFormatTime func(v time.Time) string FuncFormatDuration func(v time.Duration) string FuncMarshalData func(v interface{}) (string, error) }
func NewMarshaler ¶
func NewMarshaler() *Marshaler
type MissingArgumentError ¶ added in v0.4.0
type MissingArgumentError struct {
// contains filtered or unexported fields
}
func (*MissingArgumentError) Error ¶ added in v0.4.0
func (e *MissingArgumentError) Error() string
func (*MissingArgumentError) Name ¶ added in v0.10.0
func (e *MissingArgumentError) Name() string
func (*MissingArgumentError) Unwrap ¶ added in v0.4.0
func (e *MissingArgumentError) Unwrap() error
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
ParseError is type of error
type Unmarshaler ¶
type Unmarshaler struct { IntBase int TimeLayout string FuncParseBool func(str string) (bool, error) FuncParseInt func(str string) (int64, error) FuncParseUint func(str string) (uint64, error) FuncParseFloat func(str string) (float64, error) FuncParseComplex func(str string) (complex128, error) FuncParseTime func(str string) (time.Time, error) FuncParseDuration func(str string) (time.Duration, error) FuncUnmarshalData func(str string, ifc interface{}) error }
func NewUnmarshaler ¶
func NewUnmarshaler() *Unmarshaler
func (*Unmarshaler) Parse ¶
func (u *Unmarshaler) Parse(str string, typ reflect.Type) (interface{}, error)
func (*Unmarshaler) ParseToValue ¶
func (*Unmarshaler) Unmarshal ¶
func (u *Unmarshaler) Unmarshal(str string, ifc interface{}) error
func (*Unmarshaler) UnmarshalByValue ¶
func (u *Unmarshaler) UnmarshalByValue(str string, val reflect.Value) (err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.