Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
type CacheEntry ¶
type CacheEntry struct {
Stats GitHubStats
Expiration time.Time
}
type Config ¶
type Config struct {
Path string // API path
Token string // GitHub token
IP string // IP address
Port string // Port
Scheme string // HTTP or HTTPS
CertFile string // Certificate file
KeyFile string // Key file
IncludeOptions IncludeOptions // Include options
CacheDuration time.Duration // Cache duration
RateLimit int // Rate limit
}
type GStats ¶
type GStats struct {
// contains filtered or unexported fields
}
func (*GStats) Connect ¶
Connect initialise le client GitHub avec le token et configure le serveur.
- @param config Config - The configuration
- @return error? - The error
func (*GStats) GetGitHubStats ¶
func (g *GStats) GetGitHubStats(username string, opts IncludeOptions) (GitHubStats, error)
GetGitHubStats Get the GitHub stats for a given user according to the specified options.
- @param username string - The username
- @param opts IncludeOptions - The options
- @return GitHubStats, error - The stats, the error
type GitHubStats ¶
type IncludeOptions ¶
type Organizations ¶
type Organizations struct {
Organizations []string `json:"organizations"`
}
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter(limit int, interval time.Duration) *RateLimiter
NewRateLimiter Create a new rate limiter.
- @param limit int - The limit
- @param interval time.Duration - The interval
- @return *RateLimiter - The rate limiter
func (*RateLimiter) Allow ¶
func (rl *RateLimiter) Allow() bool
Allow Allow a request.
- @return bool - The result
Click to show internal directories.
Click to hide internal directories.