Documentation
¶
Index ¶
- type AuthConfig
- type BasicAuthConfig
- type Config
- type DatabaseConfig
- type DispatcherConfig
- type GitHubAuthConfig
- type GitHubConfig
- type Group
- type GroupsConfig
- type HistoryConfig
- type PostgresConfig
- type RateLimitConfig
- type RateLimitTierConfig
- type SQLiteConfig
- type ServerConfig
- type UserAuth
- type WorkflowDispatchTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct {
SessionTTL time.Duration `yaml:"session_ttl"`
Basic BasicAuthConfig `yaml:"basic"`
GitHub GitHubAuthConfig `yaml:"github"`
}
AuthConfig contains authentication settings.
type BasicAuthConfig ¶
BasicAuthConfig contains basic auth settings.
type Config ¶
type Config struct {
Server ServerConfig `yaml:"server"`
Database DatabaseConfig `yaml:"database"`
GitHub GitHubConfig `yaml:"github"`
Dispatcher DispatcherConfig `yaml:"dispatcher"`
Auth AuthConfig `yaml:"auth"`
History HistoryConfig `yaml:"history"`
Groups GroupsConfig `yaml:"groups"`
}
Config is the root configuration for dispatchoor.
func (*Config) GetRunnersToken ¶ added in v0.1.3
GetRunnersToken returns the token to use for listing runners. Returns RunnersToken if configured, otherwise falls back to Token.
func (*Config) HasGitHubToken ¶ added in v0.1.1
HasGitHubToken returns true if a GitHub token is configured.
func (*Config) HasRunnersToken ¶ added in v0.1.3
HasRunnersToken returns true if a token for listing runners is available.
type DatabaseConfig ¶
type DatabaseConfig struct {
Driver string `yaml:"driver"`
SQLite SQLiteConfig `yaml:"sqlite"`
Postgres PostgresConfig `yaml:"postgres"`
}
DatabaseConfig contains database connection settings.
type DispatcherConfig ¶
type DispatcherConfig struct {
Enabled bool `yaml:"enabled"`
Interval time.Duration `yaml:"interval"`
TrackingInterval time.Duration `yaml:"tracking_interval"`
}
DispatcherConfig contains dispatch loop settings.
type GitHubAuthConfig ¶
type GitHubAuthConfig struct {
Enabled bool `yaml:"enabled"`
ClientID string `yaml:"client_id"`
ClientSecret string `yaml:"client_secret"`
RedirectURL string `yaml:"redirect_url"`
OrgRoleMapping map[string]string `yaml:"org_role_mapping"`
UserRoleMapping map[string]string `yaml:"user_role_mapping"`
}
GitHubAuthConfig contains GitHub OAuth settings.
type GitHubConfig ¶
type GitHubConfig struct {
Token string `yaml:"token"`
RunnersToken string `yaml:"runners_token"`
PollInterval time.Duration `yaml:"poll_interval"`
RateLimitBuffer int `yaml:"rate_limit_buffer"`
}
GitHubConfig contains GitHub API settings.
type Group ¶
type Group struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
Description string `yaml:"description"`
RunnerLabels []string `yaml:"runner_labels"`
WorkflowDispatchTemplates []WorkflowDispatchTemplate `yaml:"workflow_dispatch_templates"`
WorkflowDispatchTemplatesFiles []string `yaml:"workflow_dispatch_templates_files"`
WorkflowDispatchTemplatesURLs []string `yaml:"workflow_dispatch_templates_urls"`
}
Group represents a runner pool and its associated workflow dispatch jobs.
type GroupsConfig ¶
type GroupsConfig struct {
GitHub []Group `yaml:"github"`
}
GroupsConfig contains all group configurations.
type HistoryConfig ¶
type HistoryConfig struct {
RetentionDays int `yaml:"retention_days"` // default 30, -1 to disable
CleanupInterval time.Duration `yaml:"cleanup_interval"` // default 1h
}
HistoryConfig contains job history retention settings.
type PostgresConfig ¶
type PostgresConfig struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
User string `yaml:"user"`
Password string `yaml:"password"`
Database string `yaml:"database"`
SSLMode string `yaml:"sslmode"`
}
PostgresConfig contains PostgreSQL-specific settings.
type RateLimitConfig ¶ added in v0.1.3
type RateLimitConfig struct {
Enabled bool `yaml:"enabled"`
Auth RateLimitTierConfig `yaml:"auth"`
Public RateLimitTierConfig `yaml:"public"`
Authenticated RateLimitTierConfig `yaml:"authenticated"`
}
RateLimitConfig contains rate limiting settings for different endpoint tiers.
type RateLimitTierConfig ¶ added in v0.1.3
type RateLimitTierConfig struct {
RequestsPerMinute int `yaml:"requests_per_minute"`
}
RateLimitTierConfig contains rate limit settings for a specific tier.
type SQLiteConfig ¶
type SQLiteConfig struct {
Path string `yaml:"path"`
}
SQLiteConfig contains SQLite-specific settings.
type ServerConfig ¶
type ServerConfig struct {
Listen string `yaml:"listen"`
CORSOrigins []string `yaml:"cors_origins"`
RateLimit RateLimitConfig `yaml:"rate_limit"`
}
ServerConfig contains HTTP server settings.
type UserAuth ¶
type UserAuth struct {
Username string `yaml:"username"`
Password string `yaml:"password"`
Role string `yaml:"role"`
}
UserAuth represents a user configured for basic auth.
type WorkflowDispatchTemplate ¶
type WorkflowDispatchTemplate struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
Owner string `yaml:"owner"`
Repo string `yaml:"repo"`
WorkflowID string `yaml:"workflow_id"`
Ref string `yaml:"ref"`
Inputs map[string]string `yaml:"inputs"`
Labels map[string]string `yaml:"labels"`
SourceType string `yaml:"-"` // "inline", "file", or "url" - set during loading
SourcePath string `yaml:"-"` // filename or URL (empty for inline) - set during loading
}
WorkflowDispatchTemplate represents a workflow dispatch template configuration.