Documentation
¶
Index ¶
- type Comparative
- func New(key string, comparison Comparison, value string, kind Kind) *Comparative
- func NewDate(key string, comparison Comparison, value time.Time) *Comparative
- func NewInt64(key string, comparison Comparison, value int64) *Comparative
- func NewString(key string, comparison Comparison, value string) *Comparative
- func (c *Comparative) Comparison() Comparison
- func (c *Comparative) Key() string
- func (c *Comparative) Kind() Kind
- func (c *Comparative) MustValue() interface{}
- func (c *Comparative) RawValue() string
- func (c *Comparative) SetComparison(comparison Comparison)
- func (c *Comparative) SetKind(k Kind)
- func (c *Comparative) String() string
- func (c *Comparative) Value() (interface{}, error)
- type Comparison
- type Kind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comparative ¶
type Comparative struct {
// contains filtered or unexported fields
}
Comparative represents a compare.
func New ¶
func New(key string, comparison Comparison, value string, kind Kind) *Comparative
New creates a Comparative.
func NewDate ¶
func NewDate(key string, comparison Comparison, value time.Time) *Comparative
NewDate creates a Comparative from time.Time.
func NewInt64 ¶
func NewInt64(key string, comparison Comparison, value int64) *Comparative
NewInt64 creates a Comparative from int64.
func NewString ¶
func NewString(key string, comparison Comparison, value string) *Comparative
NewString creates a Comparative from string.
func (*Comparative) Comparison ¶
func (c *Comparative) Comparison() Comparison
Comparison returns the Comparison.
func (*Comparative) MustValue ¶
func (c *Comparative) MustValue() interface{}
MustValue returns the value, panic if failed.
func (*Comparative) RawValue ¶
func (c *Comparative) RawValue() string
RawValue returns the raw value in string.
func (*Comparative) SetComparison ¶
func (c *Comparative) SetComparison(comparison Comparison)
func (*Comparative) String ¶
func (c *Comparative) String() string
func (*Comparative) Value ¶
func (c *Comparative) Value() (interface{}, error)
Value returns auto-converted value.
type Comparison ¶
type Comparison uint8
Comparison represents the comparisons.
const ( Ceq Comparison // == Cne // <> Cgt // > Cgte // >= Clt // < Clte // <= )
NOTICE: DO NOT change orders of following constants!!!
func ParseComparison ¶
func ParseComparison(s string) (c Comparison, ok bool)
ParseComparison parses the Comparison from a string.
func (Comparison) String ¶
func (c Comparison) String() string
Click to show internal directories.
Click to hide internal directories.