Documentation ¶
Index ¶
Constants ¶
View Source
const (
HandshakeTimeout = 5 * time.Second
)
Variables ¶
View Source
var ErrAlreadyStarted = errors.New("already started")
View Source
var ErrNoConnected = errors.New("websocket: not connected")
ErrNoConnected ... Reference: https://github.com/recws-org/recws/blob/master/recws.go
View Source
var ErrNotStarted = errors.New("not started yet")
View Source
var TypesSlice = []Type{ TypeMaster, TypeAddress, TypeAddresses, TypeSubMaster, TypeSubAddresses, TypeAccount, TypeAccountInitialTXS, TypeMessage, TypeMessageSent, TypeMessageThreadDelete, TypeTransfer, TypeTransferCancel, TypeTransferSent, TypeTransferReceiveDelete, TypeTransferInfo, TypeStorage, TypeStorageDelete, TypeBackup, TypeContact, TypeFileVirtual, TypeFileFs, TypeRfileVirtual, TypeRfileFs, TypeDfileVirtual, TypeDfileFs, TypePfileVirtual, TypeRequest, TypeRequestIn, TypeRequestUpload, TypeRequestCancel, TypeDataRoom, TypeDataRoomPolicy, TypeDataRoomF, TypeDataRoomData, TypeDataRoomDataDelete, TypeDataRoomDataPolicy, TypeMultiStorage, TypeMultiTransfer, TypeMultiTransferSent, TypeMultiBackup, TypeMultiDataRoom, TypePasswdData, TypePasswdRoom, TypePasswdRoomPolicy, TypePasswdRoomF, TypePasswdRoomData, TypePasswdRoomDataDelete, TypePasswdRoomDataPolicy, }
Functions ¶
This section is empty.
Types ¶
type Broadcast ¶ added in v1.2.0
type Broadcast struct { ID string `json:"id"` //Hash of the transaction Version uint32 `json:"version"` Type Type `json:"type"` SenderAddr string `json:"sender_addr"` RecipientAddr string `json:"recipient_addr"` Data []byte `json:"data"` Sign []byte `json:"sign"` Fee uint64 `json:"fee"` }
type BroadcastResponse ¶ added in v1.2.0
type Client ¶
type Client interface { Start() error Stop() error SetListenCallback(func(transaction *Transaction)) Subscribe(addresses []string, txTypes ...Type) error Unsubscribe() error Write(b []byte) error LastBlock() (*LastBlock, error) TxSummary(summary *Summary) (lastBlockHeight uint64, lastTransaction *Transaction, totalCount uint64, err error) TxSearch(search *Search) (txs []*Transaction, totalCount uint64, err error) Broadcast(id string, version uint32, typ Type, data []byte, senderAddress, recipientAddress string, sign []byte, fee uint64) (*BroadcastResponse, error) }
Client TCABCI Read Node Websocket Client
type HeightOperator ¶ added in v1.2.0
type HeightOperator string
const ( Equal HeightOperator = "=" Less HeightOperator = "<" Greater HeightOperator = ">" EqualOrLess HeightOperator = "<=" EqualOrGreater HeightOperator = ">=" )
func (HeightOperator) IsValid ¶ added in v1.2.0
func (ho HeightOperator) IsValid() bool
type LastBlock ¶ added in v1.2.0
type LastBlock struct { Blocks []*Transaction `json:"data"` TotalCount uint64 `json:"total_count"` }
type Message ¶
type Message struct { IsWeb bool `json:"is_web"` Type MessageType `json:"type"` Addrs []string `json:"addrs"` TXTypes []Type `json:"tx_types"` }
Message ..
type MessageType ¶
type MessageType string
MessageType ..
const ( // Subscribe message Subscribe MessageType = "subscribe" // Unsubscribe message Unsubscribe MessageType = "unsubscribe" )
type Search ¶ added in v1.2.0
type Search struct { Limit uint `json:"limit"` Height uint64 `json:"-"` Offset uint64 `json:"offset"` MaxHeight uint64 `json:"max_height"` LastOrder uint64 `json:"last_order"` Type Type `json:"typ,omitempty"` PHeight string `json:"height,omitempty"` OrderBy OrderBy `json:"order_by,omitempty"` OrderField string `json:"order_field,omitempty"` HeightOperator HeightOperator `json:"-"` RecipientAddresses []string `json:"recipient_addrs,omitempty"` SenderAddresses []string `json:"sender_addrs,omitempty"` Hashes []string `json:"hashes,omitempty"` }
type SearchResponse ¶ added in v1.2.0
type SearchResponse struct { TXS []*Transaction `json:"data"` TotalCount uint64 `json:"total_count"` }
type Summary ¶ added in v1.2.0
type SummaryResponse ¶ added in v1.2.0
type SummaryResponse struct { Data struct { LastBlockHeight uint64 `json:"last_block_height"` LastTransaction *Transaction `json:"last_transaction"` } `json:"data"` TotalCount uint64 `json:"total_count"` }
type Transaction ¶
type Transaction struct { Order *uint64 `json:"order,omitempty"` ID interface{} `json:"id"` BlockID uint64 `json:"block_id"` Height uint64 `json:"height"` Identifier string `json:"identifier"` Version uint `json:"version"` Typ Type `json:"typ"` SenderAddr string `json:"sender_addr"` RecipientAddr string `json:"recipient_addr"` Data Bytea `json:"data"` Sign Bytea `json:"sign"` Fee uint64 `json:"fee"` Hash string `json:"hash"` InsertedAt time.Time `json:"inserted_at"` }
Transaction read node transaction model
type Type ¶ added in v1.2.0
type Type string
const ( TypeMaster Type = "initial_storage" TypeAddress Type = "interim_storage" TypeAddresses Type = "interim_storages" TypeSubMaster Type = "initial_sub_storage" TypeSubAddresses Type = "interim_sub_storages" TypeAccount Type = "initial_account" TypeAccountInitialTXS Type = "initial_account_txs" TypeMessage Type = "message" TypeMessageSent Type = "inherit_message" TypeMessageThreadDelete Type = "inherit_message_recv" TypeTransfer Type = "transfer" TypeTransferCancel Type = "transfer_Cancel" TypeTransferSent Type = "transfer_sent" TypeTransferReceiveDelete Type = "transfer_receive_delete" TypeTransferInfo Type = "transfer_info" TypeStorage Type = "storage" TypeStorageDelete Type = "storage_delete" TypeBackup Type = "backup" TypeContact Type = "interim_message" TypeFileVirtual Type = "fs_virt" TypeFileFs Type = "fs_real" TypeRfileVirtual Type = "fs_rvirt" TypeRfileFs Type = "fs_rreal" TypeDfileVirtual Type = "fs_dvirt" TypeDfileFs Type = "fs_dreal" TypePfileVirtual Type = "fs_pvirt" TypeRequest Type = "request" TypeRequestIn Type = "request_in" TypeRequestUpload Type = "request_upload" TypeRequestCancel Type = "request_Cancel" TypeDataRoom Type = "data_room" TypeDataRoomPolicy Type = "data_room_policy" TypeDataRoomF Type = "data_roomF" TypeDataRoomData Type = "data_room_data" TypeDataRoomDataDelete Type = "data_room_data_delete" TypeDataRoomDataPolicy Type = "data_room_data_policy" TypeMultiStorage Type = "multi_storage" TypeMultiTransfer Type = "multi_transfer" TypeMultiTransferSent Type = "multi_transfer_sent" TypeMultiBackup Type = "multi_backup" TypeMultiDataRoom Type = "multi_data_room" TypePasswdData Type = "passwd_data" TypePasswdRoom Type = "passwd_room" TypePasswdRoomPolicy Type = "passwd_room_policy" TypePasswdRoomF Type = "passwd_roomF" TypePasswdRoomData Type = "passwd_room_data" TypePasswdRoomDataDelete Type = "passwd_room_data_delete" TypePasswdRoomDataPolicy Type = "passwd_room_data_policy" )
Click to show internal directories.
Click to hide internal directories.