garm/params/interfaces.go
Gabriel Adrian Samfira 1a719567ff Add rate limit cache and fixes
This change adds a loop that keeps a cache of credentials rate limits
as reported by the github API. The cache is updated every 30 seconds
and is purely informational for the user.

This change also adds some caching improvements. Functions that return
values from the cache as lists, will now sort by ID or creation date.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-05-08 21:39:55 +00:00

17 lines
377 B
Go

package params
import "time"
// EntityGetter is implemented by all github entities (repositories, organizations and enterprises).
// It defines the GetEntity() function which returns a github entity.
type EntityGetter interface {
GetEntity() (GithubEntity, error)
}
type IDGetter interface {
GetID() uint
}
type CreationDateGetter interface {
GetCreatedAt() time.Time
}