Documentation
¶
Index ¶
- Constants
- func HeaderNames(webhook store.Webhook) []string
- func NewSecret() (string, error)
- func Sign(id string, at time.Time, body []byte, secrets ...string) (string, error)
- func SigningSecrets(w store.Webhook, now time.Time) []string
- func State(w store.Webhook) string
- type BlockedAddressError
- type Body
- type Clients
- type Dispatcher
- type DispatcherDeps
- type InvalidError
- type Options
- type Post
- type Registered
- type Registration
- type Registry
- func (r *Registry) Add(ctx context.Context, reg Registration) (Registered, string, error)
- func (r *Registry) Enable(ctx context.Context, name string) (store.Webhook, error)
- func (r *Registry) List(ctx context.Context) ([]Registered, error)
- func (r *Registry) Redeliver(ctx context.Context, name, since string) (store.Webhook, int, error)
- func (r *Registry) Remove(ctx context.Context, name string) (store.Webhook, error)
- func (r *Registry) RotateSecret(ctx context.Context, name string) (store.Webhook, error)
- func (r *Registry) Set(ctx context.Context, name string, opts Options) (Registered, error)
- func (r *Registry) Test(ctx context.Context, name string) (store.Webhook, Result, error)
- type RegistryDeps
- type Resolver
- type Result
- type Sender
Constants ¶
View Source
const ( ConnectTimeout = 5 * time.Second TotalTimeout = 15 * time.Second MaxResponseBytes = 64 << 10 MaxConcurrent = 4 )
View Source
const ( EventMessageReceived = store.EventMessageReceived EventAccountState = store.EventAccountState )
View Source
const ( ContentMinimal = "minimal" ContentFull = "full" )
View Source
const ( FormatStandard = "standard" FormatClaudeRoutine = "claude-routine" )
View Source
const ( ChatsAll = "all" ChatsDirect = "direct" ChatsGroups = "groups" ChatsListed = "listed" )
View Source
const ( StateEnabled = "enabled" StateDisabled = "disabled" )
View Source
const ( DefaultQuiet = 5 * time.Second DefaultMaxWait = 30 * time.Second )
View Source
const (
SecretPrefix = "whsec_"
)
Variables ¶
This section is empty.
Functions ¶
func HeaderNames ¶
Types ¶
type BlockedAddressError ¶
func (*BlockedAddressError) Error ¶
func (e *BlockedAddressError) Error() string
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(deps DispatcherDeps) *Dispatcher
func (*Dispatcher) Notice ¶
func (d *Dispatcher) Notice(evt any)
func (*Dispatcher) Wake ¶
func (d *Dispatcher) Wake()
type DispatcherDeps ¶
type InvalidError ¶
type InvalidError struct {
Message string
}
func (*InvalidError) Error ¶
func (e *InvalidError) Error() string
type Registered ¶
type Registration ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(deps RegistryDeps) *Registry
func (*Registry) Add ¶
func (r *Registry) Add(ctx context.Context, reg Registration) (Registered, string, error)
func (*Registry) RotateSecret ¶
type RegistryDeps ¶
Click to show internal directories.
Click to hide internal directories.