Documentation
¶
Index ¶
Constants ¶
View Source
const ( ExitGeneral = 1 ExitInvalidInput = 2 ExitAuthOrConfig = 3 ExitNotFound = 4 ExitTelegram = 5 ExitLocalIO = 6 ExitMutationReconcile = 7 )
Variables ¶
This section is empty.
Functions ¶
func ExitCodeFor ¶
func SanitizeTerminal ¶
Types ¶
type Envelope ¶
type Envelope struct {
SchemaVersion string `json:"schema_version"`
Meta Meta `json:"meta"`
Data any `json:"data"`
}
func NewEnvelope ¶
type ErrorBody ¶
type ErrorBody struct {
Code string `json:"code"`
Message string `json:"message"`
ExitCode int `json:"exit_code"`
Outcome string `json:"outcome,omitempty"`
RetrySafe *bool `json:"retry_safe,omitempty"`
ReconciliationHandle string `json:"reconciliation_handle,omitempty"`
Guidance string `json:"guidance,omitempty"`
RetryAfterSeconds int `json:"retry_after_seconds,omitempty"`
TelegramCode int `json:"telegram_code,omitempty"`
TelegramType string `json:"telegram_type,omitempty"`
}
type ErrorResponse ¶
type ErrorResponse struct {
SchemaVersion string `json:"schema_version"`
Meta *Meta `json:"meta,omitempty"`
Error ErrorBody `json:"error"`
}
func ErrorFrom ¶
func ErrorFrom(err error) ErrorResponse
type Meta ¶
type Meta struct {
Command string `json:"command"`
TeleVersion string `json:"tele_version"`
Profile string `json:"profile"`
AccountID int64 `json:"account_id,omitempty"`
PeerRef string `json:"peer_ref,omitempty"`
FetchedAt string `json:"fetched_at"`
Limit int `json:"limit,omitempty"`
SideEffects []string `json:"side_effects,omitempty"`
Retrieval *RetrievalMeta `json:"retrieval,omitempty"`
}
type Record ¶
type Record struct {
SchemaVersion string `json:"schema_version"`
Type string `json:"type"`
Meta *Meta `json:"meta,omitempty"`
Data any `json:"data,omitempty"`
Error *ErrorBody `json:"error,omitempty"`
}
func DataRecord ¶
func ErrorRecord ¶
func ErrorRecord(response ErrorResponse) Record
func ErrorRecordFrom ¶
func MetaRecord ¶
type RetrievalMeta ¶
type RetrievalMeta struct {
RequestedCount int `json:"requested_count"`
ReturnedCount int `json:"returned_count"`
Complete *bool `json:"complete"`
Truncated bool `json:"truncated"`
NextCursor string `json:"next_cursor,omitempty"`
InputCursor string `json:"input_cursor,omitempty"`
ServerTotal *int `json:"server_total,omitempty"`
Pages int `json:"pages"`
}
Click to show internal directories.
Click to hide internal directories.