resource

package
v0.0.0-...-8aa4d74 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2019 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	APIVersionV1 = "/v1"
	APIPrefix    = "/api"

	URLAccounts              = APIPrefix + APIVersionV1 + "/accounts/{id}"
	URLAccountTransactions   = APIPrefix + APIVersionV1 + "/accounts/{id}/transactions"
	URLAccountOperations     = APIPrefix + APIVersionV1 + "/accounts/{id}/operations"
	URLAccountFrozenAccounts = APIPrefix + APIVersionV1 + "/accounts/{id}/frozen-accounts"
	URLFrozenAccounts        = APIPrefix + APIVersionV1 + "/frozen-accounts"
	URLTransactions          = APIPrefix + APIVersionV1 + "/transactions"
	URLTransactionByHash     = APIPrefix + APIVersionV1 + "/transactions/{id}"
	URLTransactionOperations = APIPrefix + APIVersionV1 + "/transactions/{id}/operations"
	URLTransactionOperation  = APIPrefix + APIVersionV1 + "/transactions/{id}/operations/{opindex}"
	URLTransactionStatus     = APIPrefix + APIVersionV1 + "/transactions/{id}/status"
	URLOperations            = APIPrefix + APIVersionV1 + "/operations/{id}"
	URLBlocks                = APIPrefix + APIVersionV1 + "/blocks/{id}"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

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

func NewAccount

func NewAccount(ba *block.BlockAccount) *Account

func (Account) GetMap

func (a Account) GetMap() hal.Entry

func (Account) LinkSelf

func (a Account) LinkSelf() string

func (Account) Resource

func (a Account) Resource() *hal.Resource

type Block

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

func NewBlock

func NewBlock(b *block.Block) *Block

func (Block) GetMap

func (blk Block) GetMap() hal.Entry

func (Block) LinkSelf

func (blk Block) LinkSelf() string

func (Block) Resource

func (blk Block) Resource() *hal.Resource

type FrozenAccount

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

func NewFrozenAccount

func NewFrozenAccount(ba *block.BlockAccount, info FrozenAccountInfo) *FrozenAccount

func (FrozenAccount) GetMap

func (fa FrozenAccount) GetMap() hal.Entry

func (FrozenAccount) LinkSelf

func (fa FrozenAccount) LinkSelf() string

func (FrozenAccount) Resource

func (fa FrozenAccount) Resource() *hal.Resource

type FrozenAccountInfo

type FrozenAccountInfo struct {
	CreatedBlockHeight           uint64
	CreatedOpHash                string
	CreatedSequenceId            uint64
	InitialAmount                common.Amount
	FreezingState                FrozenAccountState
	UnfreezingRequestBlockHeight uint64
	UnfreezingRequestOpHash      string
	UnfreezingRemainingBlocks    uint64
	PaymentOpHash                string
}

type FrozenAccountState

type FrozenAccountState string
const (
	FrozenState   FrozenAccountState = "frozen"
	MeltingState  FrozenAccountState = "melting"
	UnfrozenState FrozenAccountState = "unfrozen"
	ReturnedState FrozenAccountState = "returned"
)

type Operation

type Operation struct {
	Block *block.Block
	// contains filtered or unexported fields
}

func NewOperation

func NewOperation(bo *block.BlockOperation, opIndex int) *Operation

func (Operation) BlockOperation

func (o Operation) BlockOperation() *block.BlockOperation

func (Operation) GetMap

func (o Operation) GetMap() hal.Entry

func (Operation) LinkSelf

func (o Operation) LinkSelf() string

func (Operation) Resource

func (o Operation) Resource() *hal.Resource

type Resource

type Resource interface {
	LinkSelf() string
	Resource() *hal.Resource
	GetMap() hal.Entry
}

type ResourceList

type ResourceList struct {
	Resources []Resource
	SelfLink  string
	NextLink  string
	PrevLink  string
}

func NewResourceList

func NewResourceList(list []Resource, selfLink, nextLink, prevLink string) *ResourceList

func (ResourceList) GetMap

func (l ResourceList) GetMap() hal.Entry

func (ResourceList) LinkNext

func (l ResourceList) LinkNext() string

func (ResourceList) LinkPrev

func (l ResourceList) LinkPrev() string

func (ResourceList) LinkSelf

func (l ResourceList) LinkSelf() string

func (ResourceList) Resource

func (l ResourceList) Resource() *hal.Resource

type Transaction

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

func (Transaction) GetMap

func (t Transaction) GetMap() hal.Entry

func (Transaction) LinkSelf

func (t Transaction) LinkSelf() string

func (Transaction) Resource

func (t Transaction) Resource() *hal.Resource

type TransactionStatus

type TransactionStatus struct {
	Hash   string
	Status string
}

func NewTransactionStatus

func NewTransactionStatus(hash, status string) *TransactionStatus

func (TransactionStatus) GetMap

func (t TransactionStatus) GetMap() hal.Entry

func (TransactionStatus) LinkSelf

func (t TransactionStatus) LinkSelf() string

func (TransactionStatus) Resource

func (t TransactionStatus) Resource() *hal.Resource

Jump to

Keyboard shortcuts

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