config

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoTimeToTS added in v1.4.0

func GoTimeToTS(t time.Time) uint64

GoTimeToTS converts a Go time to uint64 timestamp. port from tidb.

func ParseTSString added in v1.4.0

func ParseTSString(ts string) (uint64, error)

ParseTSString supports TSO or datetime, e.g. '400036290571534337', '2006-01-02 15:04:05'

func ParseTSStringToGoTime added in v1.6.2

func ParseTSStringToGoTime(ts string) (time.Time, error)

ParseTSStringToGoTime supports TSO or datetime, e.g. '400036290571534337', '2006-01-02 15:04:05'

func TSOToTS added in v1.4.4

func TSOToTS(tso uint64) int64

func TSToGoTime added in v1.6.2

func TSToGoTime(ts uint64) time.Time

func TSToTSO added in v1.4.4

func TSToTSO(ts int64) uint64

Types

type GenericConfig

type GenericConfig struct {
	// Export this field to make "apiequality.Semantic.DeepEqual" happy now.
	// User of GenericConfig should not directly access this field.
	MP map[string]interface{}
}

func New

func New(o map[string]interface{}) *GenericConfig

func (*GenericConfig) DeepCopy

func (c *GenericConfig) DeepCopy() *GenericConfig

func (*GenericConfig) DeepCopyInto

func (c *GenericConfig) DeepCopyInto(out *GenericConfig)

func (*GenericConfig) DeepCopyJsonObject

func (c *GenericConfig) DeepCopyJsonObject() *GenericConfig

func (*GenericConfig) Del

func (c *GenericConfig) Del(key string)

func (*GenericConfig) Get

func (c *GenericConfig) Get(key string) (value *Value)

func (*GenericConfig) Inner

func (c *GenericConfig) Inner() map[string]interface{}

func (*GenericConfig) MarshalJSON

func (c *GenericConfig) MarshalJSON() ([]byte, error)

func (*GenericConfig) MarshalTOML

func (c *GenericConfig) MarshalTOML() ([]byte, error)

func (*GenericConfig) Merge added in v1.6.2

func (c *GenericConfig) Merge(other *GenericConfig) error

Merge merges the content in `other` to `c`.

When conflicting: Map values will be merged. Other values will be overwritten by `other`'s.

func (*GenericConfig) Set

func (c *GenericConfig) Set(key string, value interface{})

func (*GenericConfig) SetIfNil

func (c *GenericConfig) SetIfNil(key string, value interface{})

func (*GenericConfig) SetTable

func (c *GenericConfig) SetTable(table string, kvs ...interface{})

SetTable set multiple KV of a table

For example: c.SetTable("root", "key1", "val1", "key2", 10)

Invalid KV will will be ignored

func (*GenericConfig) UnmarshalJSON

func (c *GenericConfig) UnmarshalJSON(data []byte) error

func (*GenericConfig) UnmarshalTOML

func (c *GenericConfig) UnmarshalTOML(data []byte) error

type Value

type Value struct {
	// contains filtered or unexported fields
}

func (*Value) AsFloat

func (v *Value) AsFloat() (float64, error)

func (*Value) AsInt

func (v *Value) AsInt() (int64, error)

func (*Value) AsString

func (v *Value) AsString() (string, error)

func (*Value) AsStringSlice

func (v *Value) AsStringSlice() ([]string, error)

func (*Value) Interface

func (v *Value) Interface() interface{}

func (*Value) MustFloat

func (v *Value) MustFloat() float64

func (*Value) MustInt

func (v *Value) MustInt() int64

func (*Value) MustString

func (v *Value) MustString() string

func (*Value) MustStringSlice

func (v *Value) MustStringSlice() []string

Jump to

Keyboard shortcuts

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