mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-17 04:30:03 +02:00
rename transport to api
This commit is contained in:
parent
044ed4e891
commit
102045e47e
15 changed files with 40 additions and 40 deletions
13
api/message/encoding.go
Normal file
13
api/message/encoding.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package message
|
||||
|
||||
// Encoder is a function that can encode a object to the encoded format.
|
||||
type Encoder func(any) ([]byte, error)
|
||||
|
||||
// Decoder is a function that can decode a format into an object
|
||||
type Decoder func([]byte, any) error
|
||||
|
||||
// Codec is a type that can has a matching Encoder and Decoder function.
|
||||
type Codec struct {
|
||||
Encoder Encoder
|
||||
Decoder Decoder
|
||||
}
|
||||
21
api/message/types.go
Normal file
21
api/message/types.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package message
|
||||
|
||||
type HearthBeat struct {
|
||||
BlockNum uint32 `json:"blocknum"`
|
||||
HeadBlockNum uint32 `json:"head_blocknum"`
|
||||
LastIrreversibleBlockNum uint32 `json:"last_irreversible_blocknum"`
|
||||
}
|
||||
|
||||
type ActionTrace struct {
|
||||
TxID string `json:"tx_id"`
|
||||
|
||||
// Action name
|
||||
Name string `json:"name"`
|
||||
|
||||
// Contract account.
|
||||
Contract string `json:"contract"`
|
||||
|
||||
Receiver string `json:"receiver"`
|
||||
Data interface{} `json:"data"`
|
||||
HexData string `json:"hex_data"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue