Documentation
¶
Overview ¶
Package dto declares every response body the API can send, so nothing else can reach a caller.
Index ¶
- Constants
- func DeliveryHeaders() []string
- func Encode(r Response) (contentType string, body []byte, err error)
- func Size[T Chat | Message](item T) (int, error)
- type Accepted
- type AdminChat
- type AdminChats
- type Attachment
- type AttachmentInfo
- type BackfillRequested
- type ChangePage
- type Chat
- type ChatPage
- type ChatResult
- type Client
- type ClientChat
- type ClientCreated
- type ClientList
- type ClientSummary
- type Delivery
- type Error
- type Health
- type Me
- type MeClient
- type MediaPause
- type MediaStatus
- type Message
- type MessagePage
- type Pairing
- type Prometheus
- type ReadScope
- type Response
- type ScopeChat
- type SearchPage
- type SendResult
- type Sender
- type Session
- type Status
- type StatusClients
- type StatusCounts
- type WriteScope
Constants ¶
View Source
const ( MediaFetching = "fetching" MediaReady = "ready" )
Variables ¶
This section is empty.
Functions ¶
func DeliveryHeaders ¶ added in v1.2.0
func DeliveryHeaders() []string
Types ¶
type AdminChats ¶ added in v0.3.0
type Attachment ¶ added in v1.2.0
type Attachment struct {
// contains filtered or unexported fields
}
func NewAttachment ¶ added in v1.2.0
func (Attachment) Expires ¶ added in v1.2.0
func (a Attachment) Expires() time.Time
func (Attachment) Finished ¶ added in v1.2.0
func (a Attachment) Finished(sent int64, complete bool)
type AttachmentInfo ¶ added in v1.2.0
type AttachmentInfo struct {
Kind string `json:"kind"`
Variant string `json:"variant"`
State string `json:"state"`
ServedType string `json:"served_type"`
Format string `json:"format"`
Normalised bool `json:"normalised"`
Bytes int64 `json:"bytes"`
SizeDeclared int64 `json:"size_declared"`
Delivery string `json:"delivery"`
Reason *string `json:"reason"`
Parts int `json:"parts"`
Offset int64 `json:"offset"`
Length int64 `json:"length"`
RestRoute string `json:"rest_route"`
ExpiresAt *string `json:"expires_at"`
RetryAfterSeconds *int `json:"retry_after_seconds,omitempty"`
Untrusted bool `json:"untrusted"`
Notice string `json:"notice"`
}
type BackfillRequested ¶ added in v1.0.0
type BackfillRequested struct {
RequestID string `json:"request_id"`
}
func (BackfillRequested) Status ¶ added in v1.0.0
func (BackfillRequested) Status() int
type ChangePage ¶ added in v0.3.0
type ChatResult ¶ added in v0.3.0
type Client ¶ added in v0.3.0
type Client struct {
ID string `json:"id"`
Name string `json:"name"`
State string `json:"state"`
CreatedAt string `json:"created_at"`
ExpiresAt string `json:"expires_at"`
RevokedAt *string `json:"revoked_at"`
AllChats bool `json:"all_chats"`
AllowFirstContact bool `json:"allow_first_contact"`
AllowMedia bool `json:"allow_media"`
ReadChats []ClientChat `json:"read_chats"`
WriteChats []ClientChat `json:"write_chats"`
}
type ClientChat ¶ added in v0.3.0
type ClientCreated ¶ added in v0.3.0
type ClientList ¶ added in v0.3.0
type ClientList struct {
Clients []ClientSummary `json:"clients"`
}
type ClientSummary ¶ added in v0.3.0
type ClientSummary struct {
ID string `json:"id"`
Name string `json:"name"`
State string `json:"state"`
CreatedAt string `json:"created_at"`
ExpiresAt string `json:"expires_at"`
RevokedAt *string `json:"revoked_at"`
AllChats bool `json:"all_chats"`
AllowFirstContact bool `json:"allow_first_contact"`
AllowMedia bool `json:"allow_media"`
ReadChatCount int64 `json:"read_chat_count"`
WriteChatCount int64 `json:"write_chat_count"`
}
type Delivery ¶ added in v1.2.0
type Delivery struct {
// contains filtered or unexported fields
}
func (Delivery) Body ¶ added in v1.2.0
func (d Delivery) Body() *io.SectionReader
type MeClient ¶ added in v0.3.0
type MeClient struct {
ID string `json:"id"`
Name string `json:"name"`
ExpiresAt string `json:"expires_at"`
Read ReadScope `json:"read"`
Write WriteScope `json:"write"`
}
type MediaPause ¶ added in v1.2.0
type MediaPause struct {
Paused bool `json:"paused"`
}
type MediaStatus ¶ added in v1.2.0
type MediaStatus struct {
AttachmentInfo
}
func (MediaStatus) RetryAfter ¶ added in v1.2.0
func (m MediaStatus) RetryAfter() time.Duration
func (MediaStatus) Status ¶ added in v1.2.0
func (m MediaStatus) Status() int
type Message ¶ added in v0.3.0
type Message struct {
Ref string `json:"mref"`
Chat string `json:"chat"`
Sender Sender `json:"sender"`
FromMe bool `json:"from_me"`
TS string `json:"ts"`
Kind string `json:"kind"`
Text *string `json:"text"`
TextDisplay *string `json:"text_display"`
TextTruncated bool `json:"text_truncated"`
MediaType *string `json:"media_type"`
ReplyTo *string `json:"reply_to"`
QuoteVerified bool `json:"quote_verified"`
EditedAt *string `json:"edited_at"`
Revoked bool `json:"revoked"`
Origin string `json:"origin"`
Untrusted bool `json:"untrusted"`
}
type MessagePage ¶ added in v0.3.0
type Prometheus ¶
type Prometheus struct {
// contains filtered or unexported fields
}
func Metrics ¶
func Metrics(reg *metrics.Registry) Prometheus
type SearchPage ¶ added in v0.3.0
type SendResult ¶ added in v1.0.0
type SendResult struct {
Message *Message `json:"message"`
Replayed bool `json:"replayed"`
Session Session `json:"session"`
RetryAfterSeconds *int `json:"retry_after_seconds,omitempty"`
}
func (SendResult) Status ¶ added in v1.0.0
func (SendResult) Status() int
type Status ¶ added in v0.2.0
type Status struct {
State string `json:"state"`
Reason string `json:"reason"`
Paired bool `json:"paired"`
Counts StatusCounts `json:"counts"`
Clients StatusClients `json:"clients"`
Warnings []string `json:"warnings"`
Downloads string `json:"downloads"`
LastIngestAt *string `json:"last_ingest_at"`
Version string `json:"version"`
}
type StatusClients ¶ added in v0.3.0
type StatusCounts ¶ added in v0.2.0
type StatusCounts struct {
Chats int64 `json:"chats"`
Messages int64 `json:"messages"`
BlobsPending int64 `json:"history_blobs_pending"`
BlobsQuarantined int64 `json:"history_blobs_quarantined"`
InboxBacklog int64 `json:"inbox_backlog"`
InboxQuarantined int64 `json:"inbox_quarantined"`
BackfillsToday int64 `json:"backfills_today"`
MediaRefsLive int64 `json:"media_refs_live"`
MediaRefsExpired int64 `json:"media_refs_expired"`
RevokeTombstones int64 `json:"revoke_tombstones"`
}
type WriteScope ¶ added in v0.3.0
type WriteScope struct {
Chats []ScopeChat `json:"chats"`
}
Click to show internal directories.
Click to hide internal directories.