broker

package module
v0.0.0-...-fda3a3b Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2018 License: MIT Imports: 14 Imported by: 0

README

broker-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	AssetId  string `json:"assetId"`
	AssetKey string `json:"assetKey,omitempty"`
	ChainId  string `json:"chainId"`
	Icon     string `json:"icon"`
	Name     string `json:"name"`
	Symbol   string `json:"symbol"`
	CoinId   uint   `json:"coinId,omitempty"`
}

type Broker

type Broker struct {
	// contains filtered or unexported fields
}

func New

func New(c Config) (Broker, error)

func (Broker) GetSnapshot

func (b Broker) GetSnapshot(ctx context.Context, snapshotID string) (*Snapshot, error)

func (Broker) IsDebug

func (b Broker) IsDebug() bool

func (Broker) Login

func (b Broker) Login(ctx context.Context, foxId string) (*UserResponse, error)

func (Broker) PullSnapshots

func (b Broker) PullSnapshots(ctx context.Context, userId, assetId, cursor string, asc bool, limit int) (*SnapshotResponse, error)

func (Broker) Register

func (b Broker) Register(ctx context.Context, traceId, name, avatar string) (*UserResponse, error)

func (Broker) Signature

func (b Broker) Signature(ts int64, nonce string) string

type Config

type Config struct {
	AppId     string
	AppSecret string
	Develop   bool
}

type Err

type Err struct {
	// contains filtered or unexported fields
}

func (Err) Error

func (e Err) Error() string

type OffsetPagination

type OffsetPagination struct {
	NextCursor string `json:"nextCursor,omitempty"`
	HasNext    bool   `json:"hasNext"`
}

type SingleSnapshotResponse

type SingleSnapshotResponse struct {
	Snapshot Snapshot `json:"snapshot"`
}

type Snapshot

type Snapshot struct {
	SnapshotId  string `json:"snapshotId"`
	TraceId     string `json:"traceId"`
	UserId      string `json:"userId"`
	CreatedAt   int64  `json:"createdAt"`
	Source      string `json:"source"`
	Amount      string `json:"amount"`
	InsideMixin bool   `json:"insideMixin"`
	Memo        string `json:"memo"`

	Sender          string `json:"sender,omitempty"`
	Receiver        string `json:"receiver,omitempty"`
	TransactionHash string `json:"transactionHash,omitempty"`

	Asset    Asset        `json:"asset,omitempty"`
	User     SnapshotUser `json:"user,omitempty"`
	Opponent SnapshotUser `json:"opponent,omitempty"`

	ExtraData map[string]interface{} `json:"extraData,omitempty"`
}

type SnapshotResponse

type SnapshotResponse struct {
	Pagination OffsetPagination `json:"pagination"`
	Snapshots  Snapshots        `json:"snapshots"`
}

type SnapshotUser

type SnapshotUser struct {
	FoxId    uint   `json:"foxId,omitempty"`
	MixinId  string `json:"mixinId,omitempty"`
	Avatar   string `json:"avatar,omitempty"`
	Fullname string `json:"fullname,omitempty"`
}

type Snapshots

type Snapshots []Snapshot

type User

type User struct {
	Id     string `json:"fox_id"`
	Name   string `json:"name"`
	Avatar string `json:"avatar"`
}

type UserResponse

type UserResponse struct {
	User   User   `json:"user"`
	Token  string `json:"token"`
	Expire int64  `json:"expires_in"`
}

Jump to

Keyboard shortcuts

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