Documentation ¶
Overview ¶
nolint: exhaustruct
Index ¶
- Variables
- func AppendString(dst []byte, in string) []byte
- func WithAppendString(fn func(dst []byte, in string) []byte) func(*BaseEncoder)
- func WithDefaultValue(fn func(dst []byte, e Encoder, val Value) []byte) func(*BaseEncoder)
- func WithDelimeter(in byte) func(*BaseEncoder)
- func WithGropuConfig(start, end, deli byte) func(*BaseEncoder)
- func WithNullValue(in string) func(*BaseEncoder)
- type BaseEncoder
- func (b BaseEncoder) AppendArray(dst []byte, in []Value) []byte
- func (b BaseEncoder) AppendBool(dst []byte, val bool) []byte
- func (b BaseEncoder) AppendBytes(dst, in []byte) []byte
- func (b BaseEncoder) AppendComplex(dst []byte, c complex128) []byte
- func (b BaseEncoder) AppendDelimiter(dst []byte, deli byte) []byte
- func (b BaseEncoder) AppendDuration(dst []byte, d time.Duration) []byte
- func (b BaseEncoder) AppendField(dst []byte, field Field) []byte
- func (b BaseEncoder) AppendFloat(dst []byte, f float64, bitSize int) []byte
- func (b BaseEncoder) AppendGroup(dst []byte, fields []Field) []byte
- func (b BaseEncoder) AppendInt(dst []byte, val int64) []byte
- func (b BaseEncoder) AppendKey(dst []byte, key string, prefix string) []byte
- func (b BaseEncoder) AppendNull(dst []byte) []byte
- func (b BaseEncoder) AppendTime(dst []byte, t time.Time) []byte
- func (b BaseEncoder) AppendUint(dst []byte, u uint64) []byte
- func (b BaseEncoder) AppendValue(dst []byte, val Value) []byte
- type ClosureFn
- type Encoder
- type Field
- func Any(key string, value any) Field
- func Bool(key string, value bool) Field
- func Boolp(key string, value *bool) Field
- func Bools(key string, value ...bool) Field
- func Bytes(key string, value []byte) Field
- func Complex128(key string, value complex128) Field
- func Complex128p(key string, value *complex128) Field
- func Complex128s(key string, value ...complex128) Field
- func Complex64(key string, value complex64) Field
- func Complex64p(key string, value *complex64) Field
- func Complex64s(key string, value ...complex64) Field
- func Duration(key string, value time.Duration) Field
- func Durationp(key string, value *time.Duration) Field
- func Durations(key string, value ...time.Duration) Field
- func Error(key string, value error) Field
- func Errors(key string, value ...error) Field
- func Float32(key string, value float32) Field
- func Float32p(key string, value *float32) Field
- func Float32s(key string, value ...float32) Field
- func Float64(key string, value float64) Field
- func Float64p(key string, value *float64) Field
- func Float64s(key string, value ...float64) Field
- func FormatTime(key, format string, value time.Time) Field
- func FormatTimep(key, format string, value *time.Time) Field
- func FormatTimes(key, format string, value ...time.Time) Field
- func Groups(key string, value ...Field) Field
- func Int(key string, value int) Field
- func Int16(key string, value int16) Field
- func Int16p(key string, value *int16) Field
- func Int16s(key string, value ...int16) Field
- func Int32(key string, value int32) Field
- func Int32p(key string, value *int32) Field
- func Int32s(key string, value ...int32) Field
- func Int64(key string, value int64) Field
- func Int64p(key string, value *int64) Field
- func Int64s(key string, value ...int64) Field
- func Int8(key string, value int8) Field
- func Int8p(key string, value *int8) Field
- func Int8s(key string, value ...int8) Field
- func Intp(key string, value *int) Field
- func Ints(key string, value ...int) Field
- func String(key, value string) Field
- func Stringp(key string, value *string) Field
- func Strings(key string, value ...string) Field
- func Time(key string, value time.Time) Field
- func Timep(key string, value *time.Time) Field
- func Times(key string, value ...time.Time) Field
- func Uint(key string, value uint) Field
- func Uint16(key string, value uint16) Field
- func Uint16p(key string, value *uint16) Field
- func Uint16s(key string, value ...uint16) Field
- func Uint32(key string, value uint32) Field
- func Uint32p(key string, value *uint32) Field
- func Uint32s(key string, value ...uint32) Field
- func Uint64(key string, value uint64) Field
- func Uint64p(key string, value *uint64) Field
- func Uint64s(key string, value ...uint64) Field
- func Uint8(key string, value uint8) Field
- func Uint8p(key string, value *uint8) Field
- func Uint8s(key string, value ...uint8) Field
- func Uintp(key string, value *uint) Field
- func Uintptr(key string, value uintptr) Field
- func Uintptrp(key string, value *uintptr) Field
- func Uintptrs(key string, value ...uintptr) Field
- func Uints(key string, value ...uint) Field
- func Valuer(key string, value LogValuer) Field
- func ValuerFn(key string, value ClosureFn) Field
- type Fields
- type Kind
- func (l Kind) MarshalBinary() ([]byte, error)
- func (l Kind) MarshalJSON() ([]byte, error)
- func (l Kind) MarshalText() ([]byte, error)
- func (i Kind) String() string
- func (l *Kind) UnmarshalBinary(in []byte) error
- func (l *Kind) UnmarshalJSON(in []byte) error
- func (l *Kind) UnmarshalText(in []byte) error
- type LogValuer
- type Value
- func AnyValue(v any) Value
- func BoolValue(v bool) Value
- func BoolpValue(value *bool) Value
- func BoolsValue(values []bool) Value
- func BytesValue(value []byte) Value
- func ClosureValue(fn ClosureFn) Value
- func Complex128Value(v complex128) Value
- func Complex128pValue(v *complex128) Value
- func Complex128sValue(values []complex128) Value
- func Complex64sValue(values []complex64) Value
- func DurationValue(v time.Duration) Value
- func DurationpValue(v *time.Duration) Value
- func DurationsValue(values []time.Duration) Value
- func ErrorValue(value error) Value
- func ErrorsValue(value []error) Value
- func Float64Value(v float64) Value
- func Float64pValue(v *float64) Value
- func Float64sValue(values []float64) Value
- func GroupValue(as ...Field) Value
- func Int64Value(value int64) Value
- func Int64pValue(value *int64) Value
- func Int64sValue(value []int64) Value
- func NilValue() Value
- func StringValue(value string) Value
- func StringpValue(value *string) Value
- func StringsValue(value []string) Value
- func TimeValue(v time.Time) Value
- func TimepValue(v *time.Time) Value
- func TimesValue(values []time.Time) Value
- func Uint64Value(v uint64) Value
- func Uint64pValue(v *uint64) Value
- func Uint64sValue(values []uint64) Value
- func Uint8sValue(values []uint8) Value
- func (v Value) Any() any
- func (v Value) AsArray() Values
- func (v Value) AsBinary() []byte
- func (v Value) AsBool() bool
- func (v Value) AsComplex128() complex128
- func (v Value) AsDuration() time.Duration
- func (v Value) AsError() error
- func (v Value) AsFloat32() float32
- func (v Value) AsFloat64() float64
- func (v Value) AsGroup() Fields
- func (v Value) AsInt64() int64
- func (v Value) AsString() string
- func (v Value) AsTime() time.Time
- func (v Value) AsUint() uint
- func (v Value) AsUint64() uint64
- func (v Value) AsUintptr() uintptr
- func (v Value) Resolve() any
- func (v Value) String() string
- type Values
Constants ¶
This section is empty.
Variables ¶
var ErrUndefined = errors.New("indefined")
Functions ¶
func AppendString ¶ added in v0.5.0
func WithAppendString ¶ added in v0.5.0
func WithAppendString(fn func(dst []byte, in string) []byte) func(*BaseEncoder)
func WithDefaultValue ¶ added in v0.5.0
func WithDefaultValue(fn func(dst []byte, e Encoder, val Value) []byte) func(*BaseEncoder)
func WithDelimeter ¶ added in v0.5.0
func WithDelimeter(in byte) func(*BaseEncoder)
func WithGropuConfig ¶ added in v0.5.0
func WithGropuConfig(start, end, deli byte) func(*BaseEncoder)
func WithNullValue ¶ added in v0.5.0
func WithNullValue(in string) func(*BaseEncoder)
Types ¶
type BaseEncoder ¶ added in v0.5.0
type BaseEncoder struct { AppendString func(dst []byte, in string) []byte DefaultValue func(dst []byte, e Encoder, val Value) []byte // contains filtered or unexported fields }
func NewEncoder ¶ added in v0.5.0
func NewEncoder(opts ...func(*BaseEncoder)) BaseEncoder
func NewEncoderJSON ¶ added in v0.5.0
func NewEncoderJSON(opts ...func(*BaseEncoder)) BaseEncoder
func NewEncoderText ¶ added in v0.5.0
func NewEncoderText(opts ...func(*BaseEncoder)) BaseEncoder
func (BaseEncoder) AppendArray ¶ added in v0.5.0
func (b BaseEncoder) AppendArray(dst []byte, in []Value) []byte
func (BaseEncoder) AppendBool ¶ added in v0.5.0
func (b BaseEncoder) AppendBool(dst []byte, val bool) []byte
func (BaseEncoder) AppendBytes ¶ added in v0.5.0
func (b BaseEncoder) AppendBytes(dst, in []byte) []byte
func (BaseEncoder) AppendComplex ¶ added in v0.5.0
func (b BaseEncoder) AppendComplex(dst []byte, c complex128) []byte
func (BaseEncoder) AppendDelimiter ¶ added in v0.5.0
func (b BaseEncoder) AppendDelimiter(dst []byte, deli byte) []byte
func (BaseEncoder) AppendDuration ¶ added in v0.5.0
func (b BaseEncoder) AppendDuration(dst []byte, d time.Duration) []byte
func (BaseEncoder) AppendField ¶ added in v0.5.0
func (b BaseEncoder) AppendField(dst []byte, field Field) []byte
func (BaseEncoder) AppendFloat ¶ added in v0.5.0
func (b BaseEncoder) AppendFloat(dst []byte, f float64, bitSize int) []byte
func (BaseEncoder) AppendGroup ¶ added in v0.5.0
func (b BaseEncoder) AppendGroup(dst []byte, fields []Field) []byte
func (BaseEncoder) AppendInt ¶ added in v0.5.0
func (b BaseEncoder) AppendInt(dst []byte, val int64) []byte
func (BaseEncoder) AppendKey ¶ added in v0.5.0
func (b BaseEncoder) AppendKey(dst []byte, key string, prefix string) []byte
func (BaseEncoder) AppendNull ¶ added in v0.5.0
func (b BaseEncoder) AppendNull(dst []byte) []byte
func (BaseEncoder) AppendTime ¶ added in v0.5.0
func (b BaseEncoder) AppendTime(dst []byte, t time.Time) []byte
func (BaseEncoder) AppendUint ¶ added in v0.5.0
func (b BaseEncoder) AppendUint(dst []byte, u uint64) []byte
func (BaseEncoder) AppendValue ¶ added in v0.5.0
func (b BaseEncoder) AppendValue(dst []byte, val Value) []byte
type Field ¶
Field struct.
func Complex128 ¶ added in v0.5.0
func Complex128(key string, value complex128) Field
func Complex128p ¶ added in v0.5.0
func Complex128p(key string, value *complex128) Field
func Complex128s ¶ added in v0.5.0
func Complex128s(key string, value ...complex128) Field
func Complex64p ¶
func Complex64s ¶
type Kind ¶ added in v0.5.0
type Kind int
const ( KindAny Kind = iota // any KindArray // array KindNil // nil KindString // string KindBool // bool KindInt64 // int64 KindUint64 // uint64 KindFloat32 // float32 KindFloat64 // float64 KindComplex128 // complex128 KindBinary // bytes KindDuration // duration KindTime // time KindError // error KindGroup // group KindClosure // closure )
func (Kind) MarshalBinary ¶ added in v0.5.0
func (Kind) MarshalJSON ¶ added in v0.5.0
func (Kind) MarshalText ¶ added in v0.5.0
func (*Kind) UnmarshalBinary ¶ added in v0.5.0
func (*Kind) UnmarshalJSON ¶ added in v0.5.0
func (*Kind) UnmarshalText ¶ added in v0.5.0
type Value ¶
type Value struct { Kind Kind // contains filtered or unexported fields }
func BoolpValue ¶ added in v0.5.0
BoolpValue returns a new Value for a *bool.
func BoolsValue ¶ added in v0.5.0
BoolsValue returns a Value for a []bool.
func BytesValue ¶ added in v0.5.0
func ClosureValue ¶ added in v0.5.0
func Complex128Value ¶ added in v0.5.0
func Complex128Value(v complex128) Value
Complex128Value returns a Value for a complex128.
func Complex128pValue ¶ added in v0.5.0
func Complex128pValue(v *complex128) Value
Complex128Value returns a Value for a *complex128.
func Complex128sValue ¶ added in v0.5.0
func Complex128sValue(values []complex128) Value
Complex128Value returns a Value for a []complex128.
func Complex64sValue ¶ added in v0.5.0
Complex64sValue returns a Value for a []complex64.
func DurationValue ¶ added in v0.5.0
DurationValue returns a Value for a time.Duration.
func DurationpValue ¶ added in v0.5.0
DurationValue returns a Value for a *time.Duration.
func DurationsValue ¶ added in v0.5.0
DurationValue returns a Value for a *time.Duration.
func ErrorValue ¶ added in v0.5.0
func ErrorsValue ¶ added in v0.5.0
func Float64Value ¶ added in v0.5.0
Float64Value returns a Value for a floating-point number.
func Float64pValue ¶ added in v0.5.0
Float64Value returns a Value for a floating-points number.
func Float64sValue ¶ added in v0.5.0
Float64Value returns a Value for a floating-points number.
func GroupValue ¶ added in v0.5.0
GroupValue returns a new Value for a list of Fields.
func Int64Value ¶ added in v0.5.0
Int64Value returns a Value for an int64.
func Int64pValue ¶ added in v0.5.0
Int64sValue returns a Value for an *int64.
func Int64sValue ¶ added in v0.5.0
Int64sValue returns a Value for an []int64.
func StringValue ¶ added in v0.5.0
StringValue returns a new Value for a string.
func StringpValue ¶ added in v0.5.0
StringpValue returns a new Value for a *string.
func StringsValue ¶ added in v0.5.0
StringpValue returns a new Value for a string.
func TimepValue ¶ added in v0.5.0
TimepValue returns a Value for a *time.Time.
func TimesValue ¶ added in v0.5.0
TimesValue returns a Value for a []time.Time.
func Uint64Value ¶ added in v0.5.0
Uint64Value returns a Value for a uint64.
func Uint64pValue ¶ added in v0.5.0
Uint64sValue returns a Value for a []uint64.
func Uint64sValue ¶ added in v0.5.0
Uint64sValue returns a Value for a []uint64.
func Uint8sValue ¶ added in v0.5.0
Uint8sValue returns a Value for a []uint8.
func (Value) AsComplex128 ¶ added in v0.5.0
func (v Value) AsComplex128() complex128