Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultDBPingBackoff = 2 * time.Second DefaultDBPingMaxRetries = 10 )
constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHubStorer ¶
type GitHubStorer interface {
GitHubStore(payload *GitHubWebhookData) error
}
GitHubStorer defines storage behaviours for github webhook.
type GitHubWebhookData ¶
type GitHubWebhookData struct {
Payload any
Event github.Event
Target string
UserLogin string
DeliveryID uuid.UUID
TargetID uint64
HookID uint64
UserID int64
Offset int64
Partition int32
}
GitHubWebhookData presents `github` table fields.
type Manager ¶
type Manager struct {
Logger *slog.Logger
Pool *pgxpool.Pool
DSN string
BackOff time.Duration
MaxRetries uint8
}
Manager represents database manager.
func (Manager) GitHubStore ¶
func (m Manager) GitHubStore(data *GitHubWebhookData) error
GitHubStore stores given github webhook data with extras to database.
type Storer ¶
type Storer interface {
Ping() error
GitHubStorer
}
Storer defines storage behaviours for different webhooks.
Click to show internal directories.
Click to hide internal directories.