initial commit
This commit is contained in:
42
types.go
Normal file
42
types.go
Normal file
@ -0,0 +1,42 @@
|
||||
package sati
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type TokenReissueEvent struct{}
|
||||
|
||||
type TaskUpdateEvent TaskEntity
|
||||
|
||||
type CallMessageOutgoing struct {
|
||||
Method string `json:"method"`
|
||||
Data any `json:"data"`
|
||||
}
|
||||
|
||||
type CallMessageIncoming struct {
|
||||
Success bool `json:"success"`
|
||||
Data any `json:"data"`
|
||||
}
|
||||
|
||||
type CallError struct {
|
||||
Description string `json:"description"`
|
||||
Code uint32 `json:"code"`
|
||||
}
|
||||
|
||||
func (c *CallError) Error() string {
|
||||
return fmt.Sprintf("sati: api: #%d %s", c.Code, c.Description)
|
||||
}
|
||||
|
||||
type TaskEntity struct {
|
||||
Id uint32 `json:"id"`
|
||||
Type string `json:"type"`
|
||||
State string `json:"state"`
|
||||
Cost string `json:"cost"`
|
||||
Result any `json:"result"`
|
||||
}
|
||||
|
||||
type CreateTaskResult TaskEntity
|
||||
type GetBalanceRequest struct{}
|
||||
type GetBalanceResult struct {
|
||||
Balance string `json:"balance"`
|
||||
}
|
Reference in New Issue
Block a user