Documentation
¶
Index ¶
- Variables
- type Cycle
- func (c Cycle) MarshalJSON() ([]byte, error)
- func (c *Cycle) Scan(src interface{}) error
- func (c Cycle) String() string
- func (c Cycle) StringCN() string
- func (c Cycle) StringEN() string
- func (c Cycle) TimeAfterACycle(t time.Time) (time.Time, error)
- func (c *Cycle) UnmarshalJSON(b []byte) error
- func (c Cycle) Value() (driver.Value, error)
- type Gender
- type LoginMethod
- type PayMethod
- func (x PayMethod) MarshalJSON() ([]byte, error)
- func (x *PayMethod) Scan(src interface{}) error
- func (x PayMethod) String() string
- func (x PayMethod) StringCN() string
- func (x PayMethod) StringEN() string
- func (x *PayMethod) UnmarshalJSON(b []byte) error
- func (x PayMethod) Value() (driver.Value, error)
- type Platform
- type Tier
Constants ¶
This section is empty.
Variables ¶
var (
ErrIncompatible = errors.New("incompatible type to scan")
)
Enum errors
Functions ¶
This section is empty.
Types ¶
type Cycle ¶
type Cycle int
Cycle is an enum for billing cycles.
func ParseCycle ¶
ParseCycle parses a string into Cycle type.
func (Cycle) MarshalJSON ¶
MarshalJSON implements the Marshaler interface
func (*Cycle) Scan ¶
Scan implements sql.Scanner interface to retrieve value from SQL. SQL null will be turned into zero value CycleInvalid
func (Cycle) TimeAfterACycle ¶
TimeAfterACycle adds one cycle to a time instance and returns the new time.
func (*Cycle) UnmarshalJSON ¶
UnmarshalJSON implements the Unmarshaler interface.
type Gender ¶
type Gender int
Gender is an enum for gender.
func ParseGender ¶
ParseGender parsed a string into Gender type.
func (Gender) MarshalJSON ¶
MarshalJSON implements the Marshaler interface
func (*Gender) UnmarshalJSON ¶
UnmarshalJSON implements the Unmarshaler interface.
type LoginMethod ¶
type LoginMethod int
LoginMethod is an enumeration of login method.
const ( InvalidLogin LoginMethod = iota LoginMethodEmail LoginMethodWx LoginMethodMobile )
Allowed values for LoginMethod
func ParseLoginMethod ¶
func ParseLoginMethod(name string) (LoginMethod, error)
ParseLoginMethod creates a new LoginMethod from a string: email or wechat.
func (LoginMethod) MarshalJSON ¶ added in v0.0.10
func (x LoginMethod) MarshalJSON() ([]byte, error)
MarshalJSON implements the Marshaler interface
func (*LoginMethod) Scan ¶
func (x *LoginMethod) Scan(value interface{}) error
Scan implements the Scanner interface
func (LoginMethod) String ¶
func (x LoginMethod) String() string
func (*LoginMethod) UnmarshalJSON ¶ added in v0.0.10
func (x *LoginMethod) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the Unmarshaler interface.
type PayMethod ¶
type PayMethod int
PayMethod is an enum for payment methods
Supported payment methods
func ParsePayMethod ¶
ParsePayMethod parses a string into a PayMethod value.
func (PayMethod) MarshalJSON ¶
MarshalJSON implements the Marshaler interface
func (*PayMethod) Scan ¶
Scan implements sql.Scanner interface to retrieve value from SQL. SQL null will be turned into zero value InvalidPay.
func (*PayMethod) UnmarshalJSON ¶
UnmarshalJSON implements the Unmarshaler interface.
type Platform ¶
type Platform int
Platform is used to record on which platform user is visiting the API.
Allowed values for ClientPlatforms
func ParsePlatform ¶
ParsePlatform parses a string into a Platform value.
func (Platform) MarshalJSON ¶ added in v0.0.10
MarshalJSON implements the Marshaler interface
func (*Platform) Scan ¶
Scan implements sql.Scanner interface to retrieve value from SQL. SQL null will be turned into InvalidPlatform.
func (*Platform) UnmarshalJSON ¶ added in v0.0.10
UnmarshalJSON implements the Unmarshaler interface.
type Tier ¶
type Tier int
Tier is an enum for membership tiers.
func (Tier) MarshalJSON ¶
MarshalJSON implements the Marshaler interface
func (*Tier) Scan ¶
Scan implements sql.Scanner interface to retrieve value from SQL. SQL null will be turned into zero value TierFree.
func (*Tier) UnmarshalJSON ¶
UnmarshalJSON implements the Unmarshaler interface.