dync

package
v1.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProperty added in v1.1.3

func GetProperty(prop *conf.Properties, param conf.BindParam) (string, error)

func Validate added in v1.1.3

func Validate(val interface{}, param conf.BindParam) error

Types

type Bool

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

func (*Bool) MarshalJSON

func (x *Bool) MarshalJSON() ([]byte, error)

func (*Bool) Refresh added in v1.1.3

func (x *Bool) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*Bool) Validate added in v1.1.3

func (x *Bool) Validate(prop *conf.Properties, param conf.BindParam) error

func (*Bool) Value

func (x *Bool) Value() bool

type Duration

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

func (*Duration) MarshalJSON

func (x *Duration) MarshalJSON() ([]byte, error)

func (*Duration) OnValidate

func (x *Duration) OnValidate(f DurationValidateFunc)

func (*Duration) Refresh added in v1.1.3

func (x *Duration) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*Duration) Validate added in v1.1.3

func (x *Duration) Validate(prop *conf.Properties, param conf.BindParam) error

func (*Duration) Value

func (x *Duration) Value() time.Duration

type DurationValidateFunc

type DurationValidateFunc func(v time.Duration) error

type Event

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

func (*Event) MarshalJSON

func (e *Event) MarshalJSON() ([]byte, error)

func (*Event) OnEvent

func (e *Event) OnEvent(f EventFunc) error

func (*Event) OnValidate

func (e *Event) OnValidate(h EventValidateFunc)

func (*Event) Refresh added in v1.1.3

func (e *Event) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*Event) Validate added in v1.1.3

func (e *Event) Validate(prop *conf.Properties, param conf.BindParam) error

type EventFunc

type EventFunc func(prop *conf.Properties, param conf.BindParam) error

type EventValidateFunc

type EventValidateFunc func(prop *conf.Properties, param conf.BindParam) error

type Field added in v1.1.3

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

type Float32

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

func (*Float32) MarshalJSON

func (x *Float32) MarshalJSON() ([]byte, error)

func (*Float32) OnValidate

func (x *Float32) OnValidate(f Float32ValidateFunc)

func (*Float32) Refresh added in v1.1.3

func (x *Float32) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*Float32) Validate added in v1.1.3

func (x *Float32) Validate(prop *conf.Properties, param conf.BindParam) error

func (*Float32) Value

func (x *Float32) Value() float32

type Float32ValidateFunc

type Float32ValidateFunc func(v float32) error

type Float64

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

func (*Float64) MarshalJSON

func (x *Float64) MarshalJSON() ([]byte, error)

func (*Float64) OnValidate

func (x *Float64) OnValidate(f Float64ValidateFunc)

func (*Float64) Refresh added in v1.1.3

func (x *Float64) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*Float64) Validate added in v1.1.3

func (x *Float64) Validate(prop *conf.Properties, param conf.BindParam) error

func (*Float64) Value

func (x *Float64) Value() float64

type Float64ValidateFunc

type Float64ValidateFunc func(v float64) error

type Int32

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

func (*Int32) MarshalJSON

func (x *Int32) MarshalJSON() ([]byte, error)

func (*Int32) OnValidate

func (x *Int32) OnValidate(f Int32ValidateFunc)

func (*Int32) Refresh added in v1.1.3

func (x *Int32) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*Int32) Validate added in v1.1.3

func (x *Int32) Validate(prop *conf.Properties, param conf.BindParam) error

func (*Int32) Value

func (x *Int32) Value() int32

type Int32ValidateFunc

type Int32ValidateFunc func(v int32) error

type Int64

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

func (*Int64) MarshalJSON

func (x *Int64) MarshalJSON() ([]byte, error)

func (*Int64) OnValidate

func (x *Int64) OnValidate(f Int64ValidateFunc)

func (*Int64) Refresh added in v1.1.3

func (x *Int64) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*Int64) Validate added in v1.1.3

func (x *Int64) Validate(prop *conf.Properties, param conf.BindParam) error

func (*Int64) Value

func (x *Int64) Value() int64

type Int64ValidateFunc

type Int64ValidateFunc func(v int64) error

type Properties

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

Properties 动态属性

func New

func New() *Properties

func (*Properties) Bind

func (p *Properties) Bind(i interface{}, opts ...conf.BindOption) error

func (*Properties) BindValue

func (p *Properties) BindValue(v reflect.Value, param conf.BindParam) error

func (*Properties) Get

func (p *Properties) Get(key string, opts ...conf.GetOption) string

func (*Properties) Has

func (p *Properties) Has(key string) bool

func (*Properties) Keys

func (p *Properties) Keys() []string

func (*Properties) Refresh

func (p *Properties) Refresh(prop *conf.Properties) (err error)

func (*Properties) Resolve

func (p *Properties) Resolve(s string) (string, error)

func (*Properties) Update added in v1.1.3

func (p *Properties) Update(m map[string]interface{}) error

type Ref

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

func (*Ref) Init

func (r *Ref) Init(i interface{}) error

func (*Ref) MarshalJSON

func (r *Ref) MarshalJSON() ([]byte, error)

func (*Ref) OnValidate

func (r *Ref) OnValidate(f RefValidateFunc)

func (*Ref) Refresh added in v1.1.3

func (r *Ref) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*Ref) Validate added in v1.1.3

func (r *Ref) Validate(prop *conf.Properties, param conf.BindParam) error

func (*Ref) Value

func (r *Ref) Value() interface{}

type RefValidateFunc

type RefValidateFunc func(v interface{}) error

type String

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

func (*String) MarshalJSON

func (x *String) MarshalJSON() ([]byte, error)

func (*String) OnValidate

func (x *String) OnValidate(f StringValidateFunc)

func (*String) Refresh added in v1.1.3

func (x *String) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*String) Validate added in v1.1.3

func (x *String) Validate(prop *conf.Properties, param conf.BindParam) error

func (*String) Value

func (x *String) Value() string

type StringValidateFunc

type StringValidateFunc func(v string) error

type Time

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

func (*Time) MarshalJSON

func (x *Time) MarshalJSON() ([]byte, error)

func (*Time) OnValidate

func (x *Time) OnValidate(f TimeValidateFunc)

func (*Time) Refresh added in v1.1.3

func (x *Time) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*Time) Validate added in v1.1.3

func (x *Time) Validate(prop *conf.Properties, param conf.BindParam) error

func (*Time) Value

func (x *Time) Value() time.Time

type TimeValidateFunc

type TimeValidateFunc func(v time.Time) error

type Uint32

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

func (*Uint32) MarshalJSON

func (x *Uint32) MarshalJSON() ([]byte, error)

func (*Uint32) OnValidate

func (x *Uint32) OnValidate(f Uint32ValidateFunc)

func (*Uint32) Refresh added in v1.1.3

func (x *Uint32) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*Uint32) Validate added in v1.1.3

func (x *Uint32) Validate(prop *conf.Properties, param conf.BindParam) error

func (*Uint32) Value

func (x *Uint32) Value() uint32

type Uint32ValidateFunc

type Uint32ValidateFunc func(v uint32) error

type Uint64

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

func (*Uint64) MarshalJSON

func (x *Uint64) MarshalJSON() ([]byte, error)

func (*Uint64) OnValidate

func (x *Uint64) OnValidate(f Uint64ValidateFunc)

func (*Uint64) Refresh added in v1.1.3

func (x *Uint64) Refresh(prop *conf.Properties, param conf.BindParam) error

func (*Uint64) Validate added in v1.1.3

func (x *Uint64) Validate(prop *conf.Properties, param conf.BindParam) error

func (*Uint64) Value

func (x *Uint64) Value() uint64

type Uint64ValidateFunc

type Uint64ValidateFunc func(v uint64) error

type Value

type Value interface {
	Refresh(prop *conf.Properties, param conf.BindParam) error
	Validate(prop *conf.Properties, param conf.BindParam) error
}

Value 可动态刷新的对象

Jump to

Keyboard shortcuts

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