Documentation ¶
Index ¶
- type Balance
- type BalanceAttributes
- type BalanceListResponse
- type BalanceResponse
- type CountriesConfig
- type CountriesConfigAttributes
- type CountriesConfigListResponse
- type CountriesConfigResponse
- type CountryProperties
- type CreateBalance
- type CreateBalanceAttributes
- type CreateBalanceListRequest
- type CreateBalanceRelationships
- type CreateBalanceRequest
- type Details
- type Event
- type EventAttributes
- type EventListResponse
- type EventMeta
- type EventRelationships
- type EventResponse
- type EventStaticMeta
- type EventType
- type EventTypeListResponse
- type EventTypeResponse
- type Flag
- type Flagger
- type Flags
- type Included
- func (c *Included) Add(includes ...Resource)
- func (c Included) MarshalJSON() ([]byte, error)
- func (c *Included) MustBalance(key Key) *Balance
- func (c *Included) MustCountriesConfig(key Key) *CountriesConfig
- func (c *Included) MustCreateBalance(key Key) *CreateBalance
- func (c *Included) MustEvent(key Key) *Event
- func (c *Included) MustEventType(key Key) *EventType
- func (c *Included) MustJoinProgram(key Key) *JoinProgram
- func (c *Included) MustPassportEventState(key Key) *PassportEventState
- func (c *Included) MustPointPrice(key Key) *PointPrice
- func (c *Included) MustVerifyPassport(key Key) *VerifyPassport
- func (c *Included) MustWithdraw(key Key) *Withdraw
- func (c *Included) MustWithdrawal(key Key) *Withdrawal
- func (c *Included) UnmarshalJSON(data []byte) error
- type JoinProgram
- type JoinProgramAttributes
- type JoinProgramListRequest
- type JoinProgramRequest
- type Key
- type Links
- type PassportEventState
- type PassportEventStateAttributes
- type PassportEventStateListResponse
- type PassportEventStateResponse
- type PointPrice
- type PointPriceAttributes
- type PointPriceListResponse
- type PointPriceResponse
- type ReferralCode
- type Relation
- type RelationCollection
- type Resource
- type ResourceType
- type VerifyPassport
- type VerifyPassportAttributes
- type VerifyPassportListRequest
- type VerifyPassportRequest
- type Withdraw
- type WithdrawAttributes
- type WithdrawListRequest
- type WithdrawRequest
- type Withdrawal
- type WithdrawalAttributes
- type WithdrawalListResponse
- type WithdrawalRelationships
- type WithdrawalResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Balance ¶
type Balance struct { Key Attributes BalanceAttributes `json:"attributes"` }
type BalanceAttributes ¶
type BalanceAttributes struct { // Amount of points Amount int64 `json:"amount"` // Unix timestamp of balance creation CreatedAt int32 `json:"created_at"` // Whether the user was not referred by anybody, but the balance with some events was reserved. It happens when the user fulfills some event before the balance creation. IsDisabled *bool `json:"is_disabled,omitempty"` // Whether the user has scanned passport. Returned only for the single user. IsVerified *bool `json:"is_verified,omitempty"` // The level indicates user permissions and features Level int `json:"level"` // Rank of the user in the full leaderboard. Returned only for the single user. Rank *int `json:"rank,omitempty"` // Referral codes. Returned only for the single user. ReferralCodes *[]ReferralCode `json:"referral_codes,omitempty"` // Unix timestamp of the last points accruing UpdatedAt int32 `json:"updated_at"` }
type BalanceListResponse ¶
type BalanceListResponse struct { Data []Balance `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*BalanceListResponse) GetMeta ¶
func (r *BalanceListResponse) GetMeta(out interface{}) error
func (*BalanceListResponse) PutMeta ¶
func (r *BalanceListResponse) PutMeta(v interface{}) (err error)
type BalanceResponse ¶
type CountriesConfig ¶ added in v0.2.1
type CountriesConfig struct { Key Attributes CountriesConfigAttributes `json:"attributes"` }
type CountriesConfigAttributes ¶ added in v0.2.1
type CountriesConfigAttributes struct { // Array of codes and their properties. Each code is ISO 3166-1 alpha-3 code (3-letter uppercase). Countries []CountryProperties `json:"countries"` }
type CountriesConfigListResponse ¶ added in v0.2.1
type CountriesConfigListResponse struct { Data []CountriesConfig `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*CountriesConfigListResponse) GetMeta ¶ added in v0.2.1
func (r *CountriesConfigListResponse) GetMeta(out interface{}) error
func (*CountriesConfigListResponse) PutMeta ¶ added in v0.2.1
func (r *CountriesConfigListResponse) PutMeta(v interface{}) (err error)
type CountriesConfigResponse ¶ added in v0.2.1
type CountriesConfigResponse struct { Data CountriesConfig `json:"data"` Included Included `json:"included"` }
type CountryProperties ¶ added in v0.2.1
type CountryProperties struct { // ISO 3166-1 alpha-3 country code Code string `json:"code"` // Whether the users of country are allowed to reserve (claim) tokens ReserveAllowed bool `json:"reserve_allowed"` // Whether the users of country are allowed to withdraw tokens WithdrawalAllowed bool `json:"withdrawal_allowed"` }
type CreateBalance ¶
type CreateBalance struct { Key Attributes CreateBalanceAttributes `json:"attributes"` }
type CreateBalanceAttributes ¶
type CreateBalanceAttributes struct { // referrer code from the link ReferredBy string `json:"referred_by"` }
type CreateBalanceListRequest ¶
type CreateBalanceListRequest struct { Data []CreateBalance `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*CreateBalanceListRequest) GetMeta ¶
func (r *CreateBalanceListRequest) GetMeta(out interface{}) error
func (*CreateBalanceListRequest) PutMeta ¶
func (r *CreateBalanceListRequest) PutMeta(v interface{}) (err error)
type CreateBalanceRelationships ¶
type CreateBalanceRelationships struct {
ReferredBy Relation `json:"referred_by"`
}
type CreateBalanceRequest ¶
type CreateBalanceRequest struct { Data CreateBalance `json:"data"` Included Included `json:"included"` }
type Details ¶
type Details json.RawMessage
func (Details) MarshalJSON ¶
MarshalJSON - casts Details to []byte
func (*Details) UnmarshalJSON ¶
UnmarshalJSON - casts data to Details
type Event ¶
type Event struct { Key Attributes EventAttributes `json:"attributes"` Relationships *EventRelationships `json:"relationships,omitempty"` }
type EventAttributes ¶
type EventAttributes struct { // Unix timestamp of event creation CreatedAt int32 `json:"created_at"` // Whether this event may become expired. HasExpiration bool `json:"has_expiration"` Meta EventMeta `json:"meta"` // How many points were accrued. Required only for `claimed` events. This is necessary, as the reward might change over time, while the certain balance should be left intact. PointsAmount *int64 `json:"points_amount,omitempty"` // See `filter[status]` parameter for explanation Status string `json:"status"` // Unix timestamp of the event status change UpdatedAt int32 `json:"updated_at"` }
type EventListResponse ¶
type EventListResponse struct { Data []Event `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*EventListResponse) GetMeta ¶
func (r *EventListResponse) GetMeta(out interface{}) error
func (*EventListResponse) PutMeta ¶
func (r *EventListResponse) PutMeta(v interface{}) (err error)
type EventMeta ¶
type EventMeta struct { // Some events require dynamic data, which can be filled into `static` template. Dynamic *json.RawMessage `json:"dynamic,omitempty"` Static EventStaticMeta `json:"static"` }
type EventRelationships ¶
type EventRelationships struct {
Balance Relation `json:"balance"`
}
type EventResponse ¶
type EventStaticMeta ¶
type EventStaticMeta struct { // Page where you can fulfill the event ActionUrl *string `json:"action_url,omitempty"` Description string `json:"description"` // General event expiration date (UTC RFC3339) ExpiresAt *time.Time `json:"expires_at,omitempty"` // Event configuration flag: - active: Events can be opened, fulfilled, claimed - not_started: Event are not available yet, see `starts_at` - expired: Event is not available, as it has already expired, see `expires_at` - disabled: Event is disabled in the system If event is disabled, it doesn't matter if it's expired or not started: it has `disabled` flag. Flag string `json:"flag"` // Event frequency, which means how often you can fulfill certain task and claim the reward. Frequency string `json:"frequency"` // Event logo Logo *string `json:"logo,omitempty"` // Unique event code name Name string `json:"name"` // Reward amount in points Reward int64 `json:"reward"` ShortDescription string `json:"short_description"` // General event starting date (UTC RFC3339) StartsAt *time.Time `json:"starts_at,omitempty"` Title string `json:"title"` }
Primary event metadata in plain JSON. This is a template to be filled by `dynamic` when it's present.
type EventType ¶ added in v0.2.1
type EventType struct { Key Attributes EventStaticMeta `json:"attributes"` }
type EventTypeListResponse ¶ added in v0.2.1
type EventTypeListResponse struct { Data []EventType `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*EventTypeListResponse) GetMeta ¶ added in v0.2.1
func (r *EventTypeListResponse) GetMeta(out interface{}) error
func (*EventTypeListResponse) PutMeta ¶ added in v0.2.1
func (r *EventTypeListResponse) PutMeta(v interface{}) (err error)
type EventTypeResponse ¶ added in v0.2.1
type Included ¶
type Included struct {
// contains filtered or unexported fields
}
Included - an array of Resource objects that are related to the primary data and/or each other (“included resources”).
func (Included) MarshalJSON ¶
MarshalJSON - marshals include collection as array of json objects
func (*Included) MustBalance ¶
MustBalance - returns Balance from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustCountriesConfig ¶ added in v0.2.1
func (c *Included) MustCountriesConfig(key Key) *CountriesConfig
MustCountriesConfig - returns CountriesConfig from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustCreateBalance ¶
func (c *Included) MustCreateBalance(key Key) *CreateBalance
MustCreateBalance - returns CreateBalance from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustEvent ¶
MustEvent - returns Event from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustEventType ¶ added in v0.2.1
MustEventType - returns EventType from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustJoinProgram ¶ added in v1.1.0
func (c *Included) MustJoinProgram(key Key) *JoinProgram
MustJoinProgram - returns JoinProgram from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustPassportEventState ¶ added in v0.2.1
func (c *Included) MustPassportEventState(key Key) *PassportEventState
MustPassportEventState - returns PassportEventState from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustPointPrice ¶
func (c *Included) MustPointPrice(key Key) *PointPrice
MustPointPrice - returns PointPrice from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustVerifyPassport ¶
func (c *Included) MustVerifyPassport(key Key) *VerifyPassport
MustVerifyPassport - returns VerifyPassport from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustWithdraw ¶
MustWithdraw - returns Withdraw from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustWithdrawal ¶
func (c *Included) MustWithdrawal(key Key) *Withdrawal
MustWithdrawal - returns Withdrawal from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) UnmarshalJSON ¶
UmarshalJSON - unmarshal array of json objects into include collection
type JoinProgram ¶ added in v1.1.0
type JoinProgram struct { Key Attributes JoinProgramAttributes `json:"attributes"` }
type JoinProgramAttributes ¶ added in v1.1.0
type JoinProgramAttributes struct {
Country string `json:"country"`
}
type JoinProgramListRequest ¶ added in v1.1.0
type JoinProgramListRequest struct { Data []JoinProgram `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*JoinProgramListRequest) GetMeta ¶ added in v1.1.0
func (r *JoinProgramListRequest) GetMeta(out interface{}) error
func (*JoinProgramListRequest) PutMeta ¶ added in v1.1.0
func (r *JoinProgramListRequest) PutMeta(v interface{}) (err error)
type JoinProgramRequest ¶ added in v1.1.0
type JoinProgramRequest struct { Data JoinProgram `json:"data"` Included Included `json:"included"` }
type Key ¶
type Key struct { ID string `json:"id"` Type ResourceType `json:"type"` }
func NewKeyInt64 ¶
func NewKeyInt64(id int64, resourceType ResourceType) Key
func (Key) AsRelation ¶
type PassportEventState ¶ added in v0.2.1
type PassportEventState struct { Key Attributes PassportEventStateAttributes `json:"attributes"` }
type PassportEventStateAttributes ¶ added in v0.2.1
type PassportEventStateAttributes struct { // If passport scan event was automatically claimed Claimed bool `json:"claimed"` }
type PassportEventStateListResponse ¶ added in v0.2.1
type PassportEventStateListResponse struct { Data []PassportEventState `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*PassportEventStateListResponse) GetMeta ¶ added in v0.2.1
func (r *PassportEventStateListResponse) GetMeta(out interface{}) error
func (*PassportEventStateListResponse) PutMeta ¶ added in v0.2.1
func (r *PassportEventStateListResponse) PutMeta(v interface{}) (err error)
type PassportEventStateResponse ¶ added in v0.2.1
type PassportEventStateResponse struct { Data PassportEventState `json:"data"` Included Included `json:"included"` }
type PointPrice ¶
type PointPrice struct { Key Attributes PointPriceAttributes `json:"attributes"` }
type PointPriceAttributes ¶
type PointPriceListResponse ¶
type PointPriceListResponse struct { Data []PointPrice `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*PointPriceListResponse) GetMeta ¶
func (r *PointPriceListResponse) GetMeta(out interface{}) error
func (*PointPriceListResponse) PutMeta ¶
func (r *PointPriceListResponse) PutMeta(v interface{}) (err error)
type PointPriceResponse ¶
type PointPriceResponse struct { Data PointPrice `json:"data"` Included Included `json:"included"` }
type ReferralCode ¶ added in v0.2.1
type ReferralCode struct { // Referral code itself, unique identifier Id string `json:"id"` // Status of the code, belonging to this user (referrer): 1. active: the code is not used yet by another user (referee) 2. banned: the referrer's country (known after scanning passport) is not allowed to participate in the referral program 3. limited: the limit of reserved tokens in the referrer's country is reached 4. awaiting: the code is used by referee who has scanned passport, but the referrer hasn't yet 5. rewarded: the code is used, both referee and referrer have scanned passports 6. consumed: the code is used by referee who has not scanned passport yet The list is sorted by priority. E.g. if the referee has scanned passport, but referrer's country has limit reached, the status would be `limited`. Status string `json:"status"` }
type RelationCollection ¶
func (RelationCollection) MarshalJSON ¶
func (r RelationCollection) MarshalJSON() ([]byte, error)
type ResourceType ¶
type ResourceType string
const ( BALANCE ResourceType = "balance" CLAIM_EVENT ResourceType = "claim_event" COUNTRIES_CONFIG ResourceType = "countries_config" CREATE_BALANCE ResourceType = "create_balance" UPDATE_BALANCE ResourceType = "update_balance" EVENT ResourceType = "event" EVENT_TYPE ResourceType = "event_type" JOIN_PROGRAM ResourceType = "join_program" PASSPORT_EVENT_STATE ResourceType = "passport_event_state" POINT_PRICE ResourceType = "point_price" VERIFY_PASSPORT ResourceType = "verify_passport" WITHDRAW ResourceType = "withdraw" WITHDRAWAL ResourceType = "withdrawal" )
List of ResourceType
type VerifyPassport ¶
type VerifyPassport struct { Key Attributes VerifyPassportAttributes `json:"attributes"` }
type VerifyPassportAttributes ¶
type VerifyPassportAttributes struct { // Unique identifier of the passport. AnonymousId string `json:"anonymous_id"` // ISO 3166-1 alpha-3 country code, must match the one provided in `proof`. Country string `json:"country"` // Query ZK passport verification proof. Required for endpoint `/v2/balances/{nullifier}/verifypassport`. Proof *types.ZKProof `json:"proof,omitempty"` }
type VerifyPassportListRequest ¶
type VerifyPassportListRequest struct { Data []VerifyPassport `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*VerifyPassportListRequest) GetMeta ¶
func (r *VerifyPassportListRequest) GetMeta(out interface{}) error
func (*VerifyPassportListRequest) PutMeta ¶
func (r *VerifyPassportListRequest) PutMeta(v interface{}) (err error)
type VerifyPassportRequest ¶
type VerifyPassportRequest struct { Data VerifyPassport `json:"data"` Included Included `json:"included"` }
type Withdraw ¶
type Withdraw struct { Key Attributes WithdrawAttributes `json:"attributes"` }
type WithdrawAttributes ¶
type WithdrawListRequest ¶
type WithdrawListRequest struct { Data []Withdraw `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*WithdrawListRequest) GetMeta ¶
func (r *WithdrawListRequest) GetMeta(out interface{}) error
func (*WithdrawListRequest) PutMeta ¶
func (r *WithdrawListRequest) PutMeta(v interface{}) (err error)
type WithdrawRequest ¶
type Withdrawal ¶
type Withdrawal struct { Key Attributes WithdrawalAttributes `json:"attributes"` Relationships *WithdrawalRelationships `json:"relationships,omitempty"` }
type WithdrawalAttributes ¶
type WithdrawalListResponse ¶
type WithdrawalListResponse struct { Data []Withdrawal `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*WithdrawalListResponse) GetMeta ¶
func (r *WithdrawalListResponse) GetMeta(out interface{}) error
func (*WithdrawalListResponse) PutMeta ¶
func (r *WithdrawalListResponse) PutMeta(v interface{}) (err error)
type WithdrawalRelationships ¶
type WithdrawalRelationships struct {
Balance Relation `json:"balance"`
}
type WithdrawalResponse ¶
type WithdrawalResponse struct { Data Withdrawal `json:"data"` Included Included `json:"included"` }
Source Files ¶
- db.go
- flag.go
- included.go
- links.go
- model_balance.go
- model_balance_attributes.go
- model_countries_config.go
- model_countries_config_attributes.go
- model_country_properties.go
- model_create_balance.go
- model_create_balance_attributes.go
- model_create_balance_relationships.go
- model_details.go
- model_event.go
- model_event_attributes.go
- model_event_meta.go
- model_event_relationships.go
- model_event_static_meta.go
- model_event_type.go
- model_join_program.go
- model_join_program_attributes.go
- model_key.go
- model_passport_event_state.go
- model_passport_event_state_attributes.go
- model_point_price.go
- model_point_price_attributes.go
- model_referral_code.go
- model_relation.go
- model_relation_collection.go
- model_resource_type.go
- model_verify_passport.go
- model_verify_passport_attributes.go
- model_withdraw.go
- model_withdraw_attributes.go
- model_withdrawal.go
- model_withdrawal_attributes.go
- model_withdrawal_relationships.go