Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildOptions ¶
type DiscordEmbed ¶
type DiscordEmbedsField ¶
type DiscordEmbedsFooter ¶
type DiscordEmbedsFooter struct {
}
type DiscordMessage ¶
type DiscordMessage struct {
Content any `json:"content"`
Username string `json:"username,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
Embeds []DiscordEmbed `json:"embeds,omitempty"`
}
type DiscordRateLimit ¶
type DiscordRateLimit struct {
Limit int // X-RateLimit-Limit
Remaining int // X-RateLimit-Remaining
ResetTime time.Time // X-RateLimit-Reset (unix timestamp)
Bucket string // X-RateLimit-Bucket
Scope string // X-RateLimit-Scope
Global bool // X-RateLimit-Global
RetryAfter time.Duration // Retry-After (if rate limited)
}
DiscordRateLimit holds rate limit information from Discord headers
type EmbedColors ¶
type EmbedColors int
const ( LIGHT_BLUE EmbedColors = 0x58b9ff RED EmbedColors = 0xed4245 GREEN EmbedColors = 0x57f287 GRAY EmbedColors = 0x99aab5 )
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter manages Discord API rate limits
func NewRateLimiter ¶
func NewRateLimiter(log *logrus.Entry) *RateLimiter
func (*RateLimiter) Update ¶
func (rl *RateLimiter) Update(bucket string, headers http.Header)
Update processes rate limit headers from Discord response
func (*RateLimiter) Wait ¶
func (rl *RateLimiter) Wait(bucket string)
Wait blocks until it's safe to make a request
type Sender ¶
type Sender interface {
CanSend() bool
Send(title string, description string, client string, runTime time.Duration, fields []Field, dryRun bool) error
BuildField(action Action, options BuildOptions) Field
Name() string
}
func NewDiscordSender ¶
func NewDiscordSender(log *logrus.Entry, config config.NotificationsConfig) Sender
Click to show internal directories.
Click to hide internal directories.