initial commit

This commit is contained in:
2023-06-28 13:56:39 +03:00
commit 1bbbda5385
8 changed files with 552 additions and 0 deletions

42
types.go Normal file
View 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"`
}