Documentation
¶
Index ¶
- Constants
- func Handler(deps Deps) http.Handler
- type AccessView
- type AccountStatus
- type AccountView
- type AddAccountRequest
- type AddWebhookRequest
- type Client
- func (c *Client) Access(ctx context.Context) ([]AccessView, error)
- func (c *Client) Account(ctx context.Context, name string) (AccountView, error)
- func (c *Client) Accounts(ctx context.Context) ([]AccountView, error)
- func (c *Client) AddAccount(ctx context.Context, req AddAccountRequest, progress func(PairingEvent)) (AccountView, error)
- func (c *Client) AddWebhook(ctx context.Context, req AddWebhookRequest) (CreatedWebhook, error)
- func (c *Client) CloseIdleConnections()
- func (c *Client) CreateToken(ctx context.Context, req CreateTokenRequest) (CreatedToken, error)
- func (c *Client) DescribeAccount(ctx context.Context, name, description string) (AccountView, error)
- func (c *Client) EnableWebhook(ctx context.Context, name string) (EnabledWebhook, error)
- func (c *Client) Password(ctx context.Context) (string, error)
- func (c *Client) RedeliverWebhook(ctx context.Context, name string, req RedeliverRequest) (RedeliveredWebhook, error)
- func (c *Client) RemoveAccount(ctx context.Context, name string) (RemovedAccount, error)
- func (c *Client) RemoveWebhook(ctx context.Context, name string) (RemovedWebhook, error)
- func (c *Client) RevokeAccess(ctx context.Context, name string) (AccessView, error)
- func (c *Client) RotateWebhookSecret(ctx context.Context, name string) (RotatedWebhookSecret, error)
- func (c *Client) SetAccess(ctx context.Context, name string, req SetAccessRequest) (AccessView, error)
- func (c *Client) SetRetention(ctx context.Context, name string, months int) (AccountView, error)
- func (c *Client) SetWebhook(ctx context.Context, name string, req WebhookOptions) (WebhookView, error)
- func (c *Client) Status(ctx context.Context) (StatusView, error)
- func (c *Client) TestWebhook(ctx context.Context, name string) (WebhookTest, error)
- func (c *Client) Webhooks(ctx context.Context) ([]WebhookView, error)
- type CreateTokenRequest
- type CreatedToken
- type CreatedWebhook
- type DeliveryError
- type Deps
- type DescribeAccountRequest
- type DiskUsage
- type EnabledWebhook
- type Error
- type GrantEvents
- type PairingEvent
- type RedeliverRequest
- type RedeliveredWebhook
- type RemovedAccount
- type RemovedWebhook
- type RetentionPasses
- type RetentionView
- type RotatedWebhookSecret
- type SetAccessRequest
- type SetRetentionRequest
- type StatusView
- type WebhookOptions
- type WebhookTest
- type WebhookView
Constants ¶
View Source
const ( PairingCode = "code" PairingQR = "qr" PairingConnected = "connected" PairingFailed = "failed" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessView ¶
type AccountStatus ¶
type AccountStatus struct {
AccountView
Messages int64 `json:"messages"`
MediaBytes int64 `json:"media_bytes"`
}
type AccountView ¶
type AddAccountRequest ¶
type AddWebhookRequest ¶ added in v0.2.0
type AddWebhookRequest struct {
Name string `json:"name"`
WebhookOptions
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddAccount ¶
func (c *Client) AddAccount(ctx context.Context, req AddAccountRequest, progress func(PairingEvent)) (AccountView, error)
func (*Client) AddWebhook ¶ added in v0.2.0
func (c *Client) AddWebhook(ctx context.Context, req AddWebhookRequest) (CreatedWebhook, error)
func (*Client) CloseIdleConnections ¶
func (c *Client) CloseIdleConnections()
func (*Client) CreateToken ¶
func (c *Client) CreateToken(ctx context.Context, req CreateTokenRequest) (CreatedToken, error)
func (*Client) DescribeAccount ¶
func (*Client) EnableWebhook ¶ added in v0.2.0
func (*Client) RedeliverWebhook ¶ added in v0.2.0
func (c *Client) RedeliverWebhook(ctx context.Context, name string, req RedeliverRequest) (RedeliveredWebhook, error)
func (*Client) RemoveAccount ¶
func (*Client) RemoveWebhook ¶ added in v0.2.0
func (*Client) RevokeAccess ¶
func (*Client) RotateWebhookSecret ¶ added in v0.2.0
func (*Client) SetAccess ¶
func (c *Client) SetAccess(ctx context.Context, name string, req SetAccessRequest) (AccessView, error)
func (*Client) SetRetention ¶
func (*Client) SetWebhook ¶ added in v0.2.0
func (c *Client) SetWebhook(ctx context.Context, name string, req WebhookOptions) (WebhookView, error)
func (*Client) TestWebhook ¶ added in v0.2.0
type CreateTokenRequest ¶
type CreatedToken ¶
type CreatedToken struct {
Access AccessView `json:"access"`
Token string `json:"token"`
}
type CreatedWebhook ¶ added in v0.2.0
type CreatedWebhook struct {
Webhook WebhookView `json:"webhook"`
Secret string `json:"secret"`
}
type DeliveryError ¶ added in v0.2.0
type DescribeAccountRequest ¶
type DescribeAccountRequest struct {
Description string `json:"description"`
}
type EnabledWebhook ¶ added in v0.2.0
type EnabledWebhook struct {
Name string `json:"name"`
}
type GrantEvents ¶
type PairingEvent ¶
type PairingEvent struct {
Event string `json:"event"`
Code string `json:"code,omitempty"`
QR string `json:"qr,omitempty"`
Account *AccountView `json:"account,omitempty"`
Error string `json:"error,omitempty"`
}
type RedeliverRequest ¶ added in v0.2.0
type RedeliverRequest struct {
Since string `json:"since,omitempty"`
}
type RedeliveredWebhook ¶ added in v0.2.0
type RemovedAccount ¶
type RemovedAccount struct {
Account AccountView `json:"account"`
Warning string `json:"warning,omitempty"`
}
type RemovedWebhook ¶ added in v0.2.0
type RemovedWebhook struct {
Name string `json:"name"`
}
type RetentionPasses ¶
type RetentionView ¶
type RotatedWebhookSecret ¶ added in v0.2.0
type SetAccessRequest ¶
type SetRetentionRequest ¶
type SetRetentionRequest struct {
Months int `json:"months"`
}
type StatusView ¶
type StatusView struct {
Accounts []AccountStatus `json:"accounts"`
Retention RetentionView `json:"retention"`
}
type WebhookOptions ¶ added in v0.2.0
type WebhookOptions struct {
URL string `json:"url,omitempty"`
Accounts []string `json:"accounts"`
AllExistingAccounts bool `json:"all_existing_accounts,omitempty"`
Chats string `json:"chats,omitempty"`
Events []string `json:"events"`
Content string `json:"content,omitempty"`
Format string `json:"format,omitempty"`
Headers []string `json:"headers"`
Quiet string `json:"quiet,omitempty"`
MaxWait string `json:"max_wait,omitempty"`
}
type WebhookTest ¶ added in v0.2.0
type WebhookView ¶ added in v0.2.0
type WebhookView struct {
Name string `json:"name"`
URL string `json:"url"`
Accounts []string `json:"accounts"`
Events []string `json:"events"`
Chats string `json:"chats"`
ListedChats []string `json:"listed_chats,omitempty"`
Content string `json:"content"`
Format string `json:"format"`
HeaderNames []string `json:"header_names,omitempty"`
State string `json:"state"`
CreatedAt string `json:"created_at"`
Pending int `json:"pending"`
Failed int `json:"failed"`
LastSuccess string `json:"last_success,omitempty"`
LastError *DeliveryError `json:"last_error,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.