Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RootApiPath For developers, every customized Writing and Read of tripods // will base on '/api'. RootApiPath = "/api" WrCallType = "writing" RdCallType = "reading" AdminType = "admin" TripodNameKey = "tripod_name" FuncNameKey = "func_name" BlockHashKey = "block_hash" )
Variables ¶
View Source
var ( Success = 0 BlockFailure = 10001 TxnFailure = 10002 ReceiptFailure = 10003 )
View Source
var ( WrApiPath = filepath.Join(RootApiPath, WrCallType) RdApiPath = filepath.Join(RootApiPath, RdCallType) AdminApiPath = filepath.Join(RootApiPath, AdminType) SubResultsPath = "/subscribe/results" )
Functions ¶
func RenderSuccess ¶
Types ¶
type APIResponse ¶
type APIResponse struct { Code int `json:"code"` ErrMsg string `json:"err_msg"` Data any `json:"data"` }
func (*APIResponse) Error ¶
func (a *APIResponse) Error() error
func (*APIResponse) IsSuccess ¶
func (a *APIResponse) IsSuccess() bool
type SignedWrCall ¶
type SignedWrCall struct { Pubkey []byte `json:"pubkey"` Address []byte `json:"address"` Signature []byte `json:"signature"` Call *WrCall `json:"call"` }
func GetSignedWrCall ¶
func GetSignedWrCall(ctx *gin.Context) (*SignedWrCall, error)
func (*SignedWrCall) GetFuncName ¶
func (s *SignedWrCall) GetFuncName() string
func (*SignedWrCall) GetTripod ¶
func (s *SignedWrCall) GetTripod() string
type WritingPostBody ¶
Click to show internal directories.
Click to hide internal directories.