model

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0, BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const WaitRequestProcessedDefaultTimeout = 30 * time.Second

Variables

This section is empty.

Functions

func IsHTTPNotFound

func IsHTTPNotFound(e error) bool

IsHTTPNotFound returns true if the error is an HTTPError with status code http.StatusNotFound

Types

type Address

type Address string

Address is the base58-encoded representation of address.Address

func NewAddress

func NewAddress(address *address.Address) Address

func (Address) Address

func (a Address) Address() address.Address

func (Address) MarshalJSON

func (a Address) MarshalJSON() ([]byte, error)

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(b []byte) error

type BlobData

type BlobData struct {
	Data Bytes `swagger:"desc(Blob content (base64))"`
}

func NewBlobData

func NewBlobData(data []byte) *BlobData

type BlobInfo

type BlobInfo struct {
	Exists bool      `swagger:"desc(Whether or not the blob exists in the registry)"`
	Hash   HashValue `swagger:"desc(Hash of the blob)"`
}

func NewBlobInfo

func NewBlobInfo(exists bool, hash hashing.HashValue) *BlobInfo

type Bytes

type Bytes string

Bytes is the base64 representation of a byte slice

func NewBytes

func NewBytes(data []byte) Bytes

func (Bytes) Bytes

func (b Bytes) Bytes() []byte

func (Bytes) MarshalJSON

func (b Bytes) MarshalJSON() ([]byte, error)

func (*Bytes) UnmarshalJSON

func (b *Bytes) UnmarshalJSON(data []byte) error

type ChainID

type ChainID string

ChainID is the base58 representation of coretypes.ChainID

func NewChainID

func NewChainID(chainID *coretypes.ChainID) ChainID

func (ChainID) ChainID

func (ch ChainID) ChainID() coretypes.ChainID

func (ChainID) MarshalJSON

func (ch ChainID) MarshalJSON() ([]byte, error)

func (*ChainID) UnmarshalJSON

func (ch *ChainID) UnmarshalJSON(b []byte) error

type ChainRecord

type ChainRecord struct {
	ChainID        ChainID  `swagger:"desc(ChainID (base58-encoded))"`
	Color          Color    `swagger:"desc(Chain color (base58-encoded))"`
	CommitteeNodes []string `swagger:"desc(List of committee nodes (network IDs))"`
	Active         bool     `swagger:"desc(Whether or not the chain is active)"`
}

func NewChainRecord

func NewChainRecord(bd *registry.ChainRecord) *ChainRecord

func (*ChainRecord) ChainRecord

func (bd *ChainRecord) ChainRecord() *registry.ChainRecord

type Color

type Color string

Color is the base58 representation of balance.Color

func NewColor

func NewColor(color *balance.Color) Color

func (Color) Color

func (c Color) Color() balance.Color

func (Color) MarshalJSON

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

func (*Color) UnmarshalJSON

func (c *Color) UnmarshalJSON(b []byte) error

type DKSharesInfo

type DKSharesInfo struct {
	Address      string   `json:"address" swagger:"desc(New generated shared address.)"`
	SharedPubKey string   `json:"sharedPubKey" swagger:"desc(Shared public key (base64-encoded).)"`
	PubKeyShares []string `json:"pubKeyShares" swagger:"desc(Public key shares for all the peers (base64-encoded).)"`
	Threshold    uint16   `json:"threshold"`
	PeerIndex    *uint16  `json:"peerIndex" swagger:"desc(Index of the node returning the share, if it is a member of the sharing group.)"`
}

DKSharesInfo stands for the DKShare representation, returned by the GET and POST methods.

type DKSharesPostRequest

type DKSharesPostRequest struct {
	PeerNetIDs  []string `json:"peerNetIDs" swagger:"desc(NetIDs of the nodes sharing the key.)"`
	PeerPubKeys []string `json:"peerPubKeys" swagger:"desc(Optional, base64 encoded public keys of the peers generating the DKS.)"`
	Threshold   uint16   `json:"threshold" swagger:"desc(Should be =< len(PeerPubKeys))"`
	TimeoutMS   uint16   `json:"timeoutMS" swagger:"desc(Timeout in milliseconds.)"`
}

DKSharesPostRequest is a POST request for creating new DKShare.

type HTTPError

type HTTPError struct {
	// StatusCode is the associated HTTP status code (default: htttp.StatusInternalServerError)
	StatusCode int

	// Message is the error message
	Message string
}

HTTPError is the standard error response for all webapi endpoints, and also implements the Go error interface.

func NewHTTPError

func NewHTTPError(statusCode int, message string) *HTTPError

NewHTTPError creates a new HTTPError

func (*HTTPError) Error

func (e *HTTPError) Error() string

Error implements the Go error interface

type HashValue

type HashValue string

HashValue is the base58 representation of a hashing.HashValue

func NewHashValue

func NewHashValue(h hashing.HashValue) HashValue

func (HashValue) HashValue

func (h HashValue) HashValue() hashing.HashValue

func (HashValue) MarshalJSON

func (h HashValue) MarshalJSON() ([]byte, error)

func (*HashValue) UnmarshalJSON

func (h *HashValue) UnmarshalJSON(b []byte) error

type InfoResponse

type InfoResponse struct {
	Version       string `swagger:"desc(Wasp version)"`
	NetworkId     string `swagger:"desc('hostname:port'; uniquely identifies the node)"`
	PublisherPort int    `swagger:"desc(Nanomsg port that exposes publisher messages)"`
}

type RequestStatusResponse

type RequestStatusResponse struct {
	IsProcessed bool `swagger:"desc(True if the request has been processed)"`
}

type SCStateDump

type SCStateDump struct {
	Index     uint32    `json:"index"`
	Variables dict.Dict `json:"variables"`
}

type ValueTxID

type ValueTxID string

ValueTxID is the base58 representation of a transaction ID

func NewValueTxID

func NewValueTxID(id *valuetransaction.ID) ValueTxID

func (ValueTxID) ID

func (id ValueTxID) ID() valuetransaction.ID

func (ValueTxID) MarshalJSON

func (id ValueTxID) MarshalJSON() ([]byte, error)

func (*ValueTxID) UnmarshalJSON

func (id *ValueTxID) UnmarshalJSON(b []byte) error

type WaitRequestProcessedParams

type WaitRequestProcessedParams struct {
	Timeout time.Duration `swagger:"desc(Timeout in nanoseconds),default(30 seconds)"`
}

Jump to

Keyboard shortcuts

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