resources

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CivicData

type CivicData struct {
	// The user's address
	Address string `json:"address"`
	// One of the available chain's name
	ChainName string `json:"chain_name"`
	// The signature of the requested nonce to validate if the user owns the address
	Signature string `json:"signature"`
}

Civic provider's data

type Details

type Details json.RawMessage

func (Details) MarshalJSON

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

MarshalJSON - casts Details to []byte

func (*Details) Scan

func (r *Details) Scan(src interface{}) error

Scan - implements db driver method for auto unmarshal

func (Details) String

func (d Details) String() string

func (*Details) UnmarshalJSON

func (d *Details) UnmarshalJSON(data []byte) error

UnmarshalJSON - casts data to Details

func (Details) Value

func (r Details) Value() (driver.Value, error)

Value - implements db driver method for auto marshal

type Flag

type Flag struct {
	Name  string `json:"name"`
	Value int32  `json:"value"`
}

type Flagger

type Flagger interface {
	IsFlag() bool
}

type Flags

type Flags struct {
	Mask   int32  `json:"mask"`
	Values []Flag `json:"flags"`
}

func FlagsFromMask

func FlagsFromMask(mask int32, allFlags map[int32]string) Flags

type GitcoinPassportData

type GitcoinPassportData struct {
	// The user's address
	Address string `json:"address"`
	// The signature of the requested nonce to validate if the user owns the address
	Signature string `json:"signature"`
}

Gitcoin passport provider's data

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) Add

func (c *Included) Add(includes ...Resource)

Add - adds new include into collection. If one already present - skips it

func (Included) MarshalJSON

func (c Included) MarshalJSON() ([]byte, error)

MarshalJSON - marshals include collection as array of json objects

func (*Included) MustNewNonce

func (c *Included) MustNewNonce(key Key) *NewNonce

MustNewNonce - returns NewNonce 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) MustNonce

func (c *Included) MustNonce(key Key) *Nonce

MustNonce - returns Nonce 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) MustVerify

func (c *Included) MustVerify(key Key) *Verify

MustVerify - returns Verify 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) MustVerifyStatus

func (c *Included) MustVerifyStatus(key Key) *VerifyStatus

MustVerifyStatus - returns VerifyStatus 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

func (c *Included) UnmarshalJSON(data []byte) error

UmarshalJSON - unmarshal array of json objects into include collection

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

func (r Key) AsRelation() *Relation

func (*Key) GetKey

func (r *Key) GetKey() Key

func (Key) GetKeyP

func (r Key) GetKeyP() *Key
type Links struct {
	First string `json:"first"`
	Last  string `json:"last"`
	Next  string `json:"next"`
	Prev  string `json:"prev"`
	Self  string `json:"self"`
}

type NewNonce

type NewNonce struct {
	Key
	Attributes NewNonceAttributes `json:"attributes"`
}

type NewNonceAttributes

type NewNonceAttributes struct {
	// Message to be signed with MetaMask's `personal_sign`. Contains some user-friendly text and a random nonce.
	Message string `json:"message"`
}

type NewNonceListResponse

type NewNonceListResponse struct {
	Data     []NewNonce `json:"data"`
	Included Included   `json:"included"`
	Links    *Links     `json:"links"`
}

type NewNonceResponse

type NewNonceResponse struct {
	Data     NewNonce `json:"data"`
	Included Included `json:"included"`
}

type Nonce

type Nonce struct {
	Key
	Attributes NonceAttributes `json:"attributes"`
}

type NonceAttributes

type NonceAttributes struct {
	// Account Address from MetaMask
	Address string `json:"address"`
}

type NonceListRequest

type NonceListRequest struct {
	Data     []Nonce  `json:"data"`
	Included Included `json:"included"`
	Links    *Links   `json:"links"`
}

type NonceRequest

type NonceRequest struct {
	Data     Nonce    `json:"data"`
	Included Included `json:"included"`
}

type Relation

type Relation struct {
	Data  *Key   `json:"data,omitempty"`
	Links *Links `json:"links,omitempty"`
}

type RelationCollection

type RelationCollection struct {
	Data  []Key  `json:"data"`
	Links *Links `json:"links,omitempty"`
}

func (RelationCollection) MarshalJSON

func (r RelationCollection) MarshalJSON() ([]byte, error)

type Resource

type Resource interface {
	//GetKey - returns key of the Resource
	GetKey() Key
}

type ResourceType

type ResourceType string
const (
	NONCE           ResourceType = "nonce"
	NONCE_REQUEST   ResourceType = "nonce_request"
	VERIFICATION_ID ResourceType = "verification_id"
	VERIFY          ResourceType = "verify"
	VERIFY_STATUS   ResourceType = "verify_status"
)

List of ResourceType

type UnauthorizedError

type UnauthorizedError struct {
	// Application-specific error code, expressed as a string value  - invalid_access_token error - 1 - invalid_signature - 2 - nonce_not_found - 3 - not_likely_human - 4 - score_too_low - 5 - invalid_gateway_token - 6
	Code string `json:"code"`
	// Human-readable explanation specific to this occurrence of the problem
	Detail *string `json:"detail,omitempty"`
	// Object containing non-standard meta-information about the error
	Meta *map[string]interface{} `json:"meta,omitempty"`
	// HTTP status code applicable to this problem
	Status int32 `json:"status"`
	// Short, human-readable summary of the problem
	Title string `json:"title"`
}

type UnstoppableDomainsData

type UnstoppableDomainsData struct {
	// The API access token provides the ability to retrieve the user's metadata. You can receive it by using AuthWithPopUp of Unstoppable Domain API.
	AccessToken string `json:"access_token"`
}

Unstoppable domain provider's data

type Verify

type Verify struct {
	Key
	Attributes VerifyAttributes `json:"attributes"`
}

type VerifyAttributes

type VerifyAttributes struct {
	// Iden3 identity's id
	IdentityId   string          `json:"identity_id"`
	ProviderData json.RawMessage `json:"provider_data"`
}

type VerifyListRequest

type VerifyListRequest struct {
	Data     []Verify `json:"data"`
	Included Included `json:"included"`
	Links    *Links   `json:"links"`
}

type VerifyRequest

type VerifyRequest struct {
	Data     Verify   `json:"data"`
	Included Included `json:"included"`
}

type VerifyStatus

type VerifyStatus struct {
	Key
	Attributes VerifyStatusAttributes `json:"attributes"`
}

type VerifyStatusAttributes

type VerifyStatusAttributes struct {
	// KYC claim ID.
	ClaimId string `json:"claim_id"`
	// Verification status of the account.
	Status string `json:"status"`
}

type VerifyStatusListRequest

type VerifyStatusListRequest struct {
	Data     []VerifyStatus `json:"data"`
	Included Included       `json:"included"`
	Links    *Links         `json:"links"`
}

type VerifyStatusRequest

type VerifyStatusRequest struct {
	Data     VerifyStatus `json:"data"`
	Included Included     `json:"included"`
}

type WorldcoinData

type WorldcoinData struct {
	// The API JWT provides the ability to retrieve the user's metadata. You can receive it after successful /authorize flow.
	IdToken string `json:"id_token"`
}

Worldcoin provider's data

Jump to

Keyboard shortcuts

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