types

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const NullableStr = "null"

Variables

View Source
var SalutationMap = map[int]string{
	int(MS):  "Miss",
	int(MRS): "Missus",
	int(DR):  "Doctor",
	int(MR):  "Mister",
}

Functions

func ConvertEnumToString

func ConvertEnumToString(mappedValues map[int]string, valueToConvert int) string

func ConvertInterfaceToEnum

func ConvertInterfaceToEnum(mappedValues map[int]string, valueToConvert interface{}, enumName string) (int, error)

func ConvertStringToEnum

func ConvertStringToEnum(mappedValues map[int]string, valueToConvert, enumName string) (int, error)

func GenerateEnumQueryPart

func GenerateEnumQueryPart(mappedValues map[int]string) string

Types

type Decimal

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

func NewDecimalFromFloat

func NewDecimalFromFloat(input float64) Decimal

func NewDecimalFromInt

func NewDecimalFromInt(input int64) Decimal

func NewDecimalFromString

func NewDecimalFromString(input string) Decimal

func (Decimal) Add

func (d Decimal) Add(dec Decimal) Decimal

func (Decimal) CeilToValue

func (d Decimal) CeilToValue(dec Decimal) Decimal

func (Decimal) DecrementByPercent

func (d Decimal) DecrementByPercent(dec Decimal) Decimal

func (Decimal) Div

func (d Decimal) Div(dec Decimal) Decimal

func (Decimal) Equal

func (d Decimal) Equal(dec Decimal) bool

func (Decimal) EqualInt

func (d Decimal) EqualInt(input int64) bool

func (Decimal) EqualZero

func (d Decimal) EqualZero() bool

func (Decimal) Floor

func (d Decimal) Floor() Decimal

func (Decimal) FloorToValue

func (d Decimal) FloorToValue(dec Decimal) Decimal

func (Decimal) Greater

func (d Decimal) Greater(dec Decimal) bool

func (Decimal) GreaterInt

func (d Decimal) GreaterInt(input int64) bool

func (Decimal) GreaterOrEqual

func (d Decimal) GreaterOrEqual(dec Decimal) bool

func (Decimal) GreaterOrEqualInt

func (d Decimal) GreaterOrEqualInt(input int64) bool

func (Decimal) GreaterOrEqualZero

func (d Decimal) GreaterOrEqualZero() bool

func (Decimal) GreaterZero

func (d Decimal) GreaterZero() bool

func (Decimal) IncrementByPercent

func (d Decimal) IncrementByPercent(dec Decimal) Decimal

func (Decimal) Less

func (d Decimal) Less(dec Decimal) bool

func (Decimal) LessOrEqual

func (d Decimal) LessOrEqual(dec Decimal) bool

func (Decimal) LessOrEqualZero

func (d Decimal) LessOrEqualZero() bool

func (Decimal) LessZero

func (d Decimal) LessZero() bool

func (Decimal) LowerOrEqualInt

func (d Decimal) LowerOrEqualInt(input int64) bool

func (Decimal) MarshalJSON

func (d Decimal) MarshalJSON() ([]byte, error)

func (Decimal) Mul

func (d Decimal) Mul(dec Decimal) Decimal

func (Decimal) Round

func (d Decimal) Round(places int64) Decimal

func (*Decimal) Scan

func (d *Decimal) Scan(value interface{}) error

Scan implements the Scanner interface.

func (Decimal) String

func (d Decimal) String() string

func (Decimal) Sub

func (d Decimal) Sub(dec Decimal) Decimal

func (Decimal) ToFloat

func (d Decimal) ToFloat() float64

func (Decimal) ToPercent

func (d Decimal) ToPercent(places int64) Decimal

func (*Decimal) UnmarshalJSON

func (d *Decimal) UnmarshalJSON(decimalBytes []byte) error

func (Decimal) Value

func (d Decimal) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type FlagSet

type FlagSet map[string]bool

FlagSet holds the info about certain keys to appear in tests

func NewFlagSet

func NewFlagSet() FlagSet

NewFlagSet contructor

func (FlagSet) AllTrue

func (fs FlagSet) AllTrue() bool

AllTrue useful for assertions if all expected values appeared e.g. in a stream

func (FlagSet) GetNotMatchedKeys

func (fs FlagSet) GetNotMatchedKeys() []string

GetNotMatchedKeys useful for giving failure texts

type KeyValueBool

type KeyValueBool struct {
	Key   string
	Value bool
}

KeyValueBool just handy implementation for map[string]bool

type KeyValueInt

type KeyValueInt struct {
	Key   string
	Value int
}

KeyValueInt just handy implementation for map[string]int

type KeyValueInt64

type KeyValueInt64 struct {
	Key   string
	Value int64
}

KeyValueInt64 just handy implementation for map[string]int64

type KeyValueInterface

type KeyValueInterface struct {
	Key   string
	Value interface{}
}

KeyValueInterface just handy implementation for map[string]interface{} as []KeyValueInterface

type KeyValueStr

type KeyValueStr struct {
	Key   string
	Value string
}

KeyValueStr just handy implementation for map[string]string

type NullDecimal

type NullDecimal struct {
	DecimalValue Decimal
	Valid        bool
}

func (NullDecimal) MarshalJSON

func (nd NullDecimal) MarshalJSON() ([]byte, error)

func (*NullDecimal) Scan

func (nd *NullDecimal) Scan(value interface{}) (err error)

func (*NullDecimal) UnmarshalJSON

func (nd *NullDecimal) UnmarshalJSON(input []byte) error

func (NullDecimal) Value

func (nd NullDecimal) Value() (driver.Value, error)

type NullFloat64

type NullFloat64 struct {
	sql.NullFloat64
}

func (NullFloat64) MarshalJSON

func (nf NullFloat64) MarshalJSON() ([]byte, error)

func (*NullFloat64) UnmarshalJSON

func (nf *NullFloat64) UnmarshalJSON(input []byte) error

type NullInt64

type NullInt64 struct {
	sql.NullInt64
}

func (NullInt64) MarshalJSON

func (ni NullInt64) MarshalJSON() ([]byte, error)

func (*NullInt64) UnmarshalJSON

func (ni *NullInt64) UnmarshalJSON(input []byte) error

type NullString

type NullString struct {
	sql.NullString
}

func (NullString) MarshalJSON

func (ns NullString) MarshalJSON() ([]byte, error)

func (*NullString) UnmarshalJSON

func (ns *NullString) UnmarshalJSON(input []byte) error

type Person

type Person struct {
	Salutation Salutation `json:"salutation"`
	Name       string     `json:"name"`
}

type Salutation

type Salutation int
const (
	MS Salutation = iota
	MRS
	DR
	MR
)

func (Salutation) MarshalJSON

func (s Salutation) MarshalJSON() ([]byte, error)

func (*Salutation) Scan

func (s *Salutation) Scan(value interface{}) error

func (*Salutation) SetFromName

func (s *Salutation) SetFromName(uidName string) error

func (Salutation) String

func (s Salutation) String() string

func (*Salutation) UnmarshalJSON

func (s *Salutation) UnmarshalJSON(jsonInput []byte) error

func (Salutation) Value

func (s Salutation) Value() (driver.Value, error)

type StringNumber

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

func (StringNumber) MarshalJSON

func (sn StringNumber) MarshalJSON() ([]byte, error)

func (StringNumber) String

func (sn StringNumber) String() string

func (*StringNumber) UnmarshalJSON

func (sn *StringNumber) UnmarshalJSON(input []byte) error

type StringSet

type StringSet []string

func (*StringSet) Add

func (vs *StringSet) Add(value string)

func (StringSet) Contains

func (vs StringSet) Contains(needle string) bool

func (*StringSet) MarshalJSON

func (vs *StringSet) MarshalJSON() ([]byte, error)

func (*StringSet) Scan

func (vs *StringSet) Scan(value interface{}) error

func (StringSet) String

func (vs StringSet) String() string

func (StringSet) ToStrings

func (vs StringSet) ToStrings() (result []string)

func (*StringSet) UnmarshalJSON

func (vs *StringSet) UnmarshalJSON(jsonInput []byte) error

func (StringSet) Value

func (vs StringSet) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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