Documentation
¶
Index ¶
- Variables
- type AccountKind
- 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 OrderKind
- 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 SubsSource
- type SubsStatus
- func (x SubsStatus) IsValid() bool
- func (x SubsStatus) MarshalJSON() ([]byte, error)
- func (x *SubsStatus) Scan(src interface{}) error
- func (x SubsStatus) ShouldCreate() bool
- func (x SubsStatus) String() string
- func (x *SubsStatus) UnmarshalJSON(b []byte) error
- func (x SubsStatus) Value() (driver.Value, error)
- 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 AccountKind ¶ added in v0.5.0
type AccountKind int
AccountKind is an enumeration of login method.
const ( AccountKindNull AccountKind = iota AccountKindFtc AccountKindWx AccountKindLinked )
Allowed values for AccountKind
func ParseAccountKind ¶ added in v0.5.0
func ParseAccountKind(name string) (AccountKind, error)
func (AccountKind) MarshalJSON ¶ added in v0.5.0
func (x AccountKind) MarshalJSON() ([]byte, error)
MarshalJSON implements the Marshaler interface
func (AccountKind) String ¶ added in v0.5.0
func (x AccountKind) String() string
func (*AccountKind) UnmarshalJSON ¶ added in v0.5.0
func (x *AccountKind) UnmarshalJSON(b []byte) error
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 OrderKind ¶ added in v0.4.1
type OrderKind int
OrderKind describes what kind of subscription order a user is purchasing.
func ParseOrderKind ¶ added in v0.4.1
ParseOrderKind creates OrderKind from a string.
func (OrderKind) MarshalJSON ¶ added in v0.4.1
func (*OrderKind) UnmarshalJSON ¶ added in v0.4.1
type PayMethod ¶
type PayMethod int
PayMethod is an enum for payment methods
const ( PayMethodNull PayMethod = iota PayMethodAli PayMethodWx PayMethodStripe PayMethodApple PayMethodB2B )
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 Deprecated
const ( SnapshotReasonNull SnapshotReason = iota // Unknow reason. SnapshotReasonRenew // Backup before renewal SnapshotReasonUpgrade // Backup before upgrading. SnapshotReasonDelete // Backup before deletion. SnapshotReasonLink // Link FTC account to wechat account. SnapshotReasonUnlink // Unlink FTC account from wechat accout. SnapshotReasonAppleLink // Link FTC account to Apple IAP. SnapshotReasonAppleUnlink // Unlink FTC account from Apple IAP. SnapshotReasonB2B SnapshotReasonManual SnapshotReasonIapUpdate )
Enum of SnapshotReason.
func ParseSnapshotReason ¶ added in v0.2.1
func ParseSnapshotReason(name string) (SnapshotReason, error)
ParseSnapshotReason turns a string to an instance of SnapshotReason
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 SubsSource ¶ added in v0.4.2
type SubsSource int
const ( SubsSourceNull SubsSource = iota SubsSourceRetail SubsSourceB2B )
func ParseSubsSource ¶ added in v0.4.2
func ParseSubsSource(name string) (SubsSource, error)
ParseOrderKind creates OrderKind from a string.
func (SubsSource) MarshalJSON ¶ added in v0.4.2
func (x SubsSource) MarshalJSON() ([]byte, error)
func (*SubsSource) Scan ¶ added in v0.4.2
func (x *SubsSource) Scan(src interface{}) error
func (SubsSource) String ¶ added in v0.4.2
func (x SubsSource) String() string
func (*SubsSource) UnmarshalJSON ¶ added in v0.4.2
func (x *SubsSource) UnmarshalJSON(b []byte) error
type SubsStatus ¶ added in v0.4.3
type SubsStatus int
const ( SubsStatusNull SubsStatus = iota // Invalid SubsStatusActive SubsStatusCanceled // Invalid SubsStatusIncomplete SubsStatusIncompleteExpired // Invalid SubsStatusPastDue // INvalid SubsStatusTrialing SubsStatusUnpaid // Invalid )
func ParseSubsStatus ¶ added in v0.4.3
func ParseSubsStatus(name string) (SubsStatus, error)
ParseSubsStatus turns a string to SubsStatus.
func (SubsStatus) IsValid ¶ added in v0.5.2
func (x SubsStatus) IsValid() bool
IsValid check if subscription status is in a valid state.
func (SubsStatus) MarshalJSON ¶ added in v0.4.3
func (x SubsStatus) MarshalJSON() ([]byte, error)
func (*SubsStatus) Scan ¶ added in v0.4.3
func (x *SubsStatus) Scan(src interface{}) error
func (SubsStatus) ShouldCreate ¶ added in v0.4.3
func (x SubsStatus) ShouldCreate() bool
ShouldCreate checks whether membership's current status should allow creation of a new membership. Deprecated
func (SubsStatus) String ¶ added in v0.4.3
func (x SubsStatus) String() string
func (*SubsStatus) UnmarshalJSON ¶ added in v0.4.3
func (x *SubsStatus) 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.