model

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0, BSD-2-Clause Imports: 11 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 ledgerstate.Address

func NewAddress

func NewAddress(address ledgerstate.Address) Address

func (Address) Address

func (a Address) Address() ledgerstate.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. It is intended to be a replacement for any []byte attribute in JSON models. Normally it shouldn't be necessary since the standard json package already handles []byte data, but this makes sure that the swagger documentation shows examples correctly (instead of as if a []byte was json-encoded as an array of ints).

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 iscp.ChainID

func NewChainID

func NewChainID(chainID *iscp.ChainID) ChainID

func (ChainID) ChainID

func (ch ChainID) ChainID() *iscp.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))"`
	Active  bool     `swagger:"desc(Whether or not the chain is active)"`
	Peers   []string `swagger:"desc(List of peers/access nodes (network IDs))"`
}

func NewChainRecord

func NewChainRecord(rec *registry.ChainRecord) *ChainRecord

func (*ChainRecord) Record added in v0.2.0

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

type Color

type Color string

Color is the base58 representation of ledgerstate.Color

func NewColor

func NewColor(color ledgerstate.Color) Color

func (Color) Color

func (c Color) Color() ledgerstate.Color

func (Color) MarshalJSON

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

func (*Color) UnmarshalJSON

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

type CommitteeRecord added in v0.2.0

type CommitteeRecord struct {
	Address Address  `swagger:"desc(Committee address (base58-encoded))"`
	Nodes   []string `swagger:"desc(List of committee nodes (network IDs))"`
}

func NewCommitteeRecord added in v0.2.0

func NewCommitteeRecord(bd *registry.CommitteeRecord) *CommitteeRecord

func (*CommitteeRecord) Record added in v0.2.0

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   uint32   `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)"`
	VersionHash   string `swagger:"desc(Wasp version hash)"`
	NetworkID     string `swagger:"desc('hostname:port'; uniquely identifies the node)"`
	PublisherPort int    `swagger:"desc(Nanomsg port that exposes publisher messages)"`
}

type OffLedgerRequestBody added in v0.2.0

type OffLedgerRequestBody struct {
	Request Bytes `swagger:"desc(Offledger Request (base64))"`
}

type PeeringNodeStatus added in v0.2.0

type PeeringNodeStatus struct {
	PubKey   string
	NetID    string
	IsAlive  bool
	NumUsers int
}

type PeeringTrustedNode added in v0.2.0

type PeeringTrustedNode struct {
	PubKey string `json:"pubKey" swagger:"desc(Public key of the NetID, base58.)"`
	NetID  string `json:"netID" swagger:"desc(NetID of a peer to trust.)"`
}

PeeringTrustedNode describes single node in the list of trusted peering nodes.

func NewPeeringTrustedNode added in v0.2.0

func NewPeeringTrustedNode(tp *peering.TrustedPeer) *PeeringTrustedNode

type RequestStatusResponse

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

type ValueTxID

type ValueTxID string

ValueTxID is the base58 representation of a transaction ID

func NewValueTxID

func NewValueTxID(id *ledgerstate.TransactionID) ValueTxID

func (ValueTxID) 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