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 Environment
- 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 SnapshotReason
- 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 Environment ¶ added in v0.2.0
type Environment int
const ( EnvNull Environment = iota EnvProduction EnvSandbox )
func ParseEnvironment ¶ added in v0.2.0
func ParseEnvironment(name string) (Environment, error)
func (Environment) MarshalJSON ¶ added in v0.2.0
func (x Environment) MarshalJSON() ([]byte, error)
func (*Environment) Scan ¶ added in v0.2.0
func (x *Environment) Scan(src interface{}) error
func (Environment) String ¶ added in v0.2.0
func (x Environment) String() string
func (*Environment) UnmarshalJSON ¶ added in v0.2.0
func (x *Environment) UnmarshalJSON(b []byte) error
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 ( LoginMethodNull 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 SnapshotReason ¶ added in v0.2.1
type SnapshotReason int
SnapshotReason tells why we take a snapshot of reader's membership
const ( SnapshotReasonNull SnapshotReason = iota SnapshotReasonRenew SnapshotReasonUpgrade SnapshotReasonDelete SnapshotReasonLink SnapshotReasonUnlink SnapshotReasonAppleIAP )
func ParseSnapshotReason ¶ added in v0.2.1
func ParseSnapshotReason(name string) (SnapshotReason, error)
func (SnapshotReason) MarshalJSON ¶ added in v0.2.1
func (x SnapshotReason) MarshalJSON() ([]byte, error)
func (*SnapshotReason) Scan ¶ added in v0.2.1
func (x *SnapshotReason) Scan(src interface{}) error
func (SnapshotReason) String ¶ added in v0.2.1
func (x SnapshotReason) String() string
func (*SnapshotReason) UnmarshalJSON ¶ added in v0.2.1
func (x *SnapshotReason) UnmarshalJSON(b []byte) error
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.