Documentation ¶
Index ¶
- func AuthHeader(r *http.Request) (string, string)
- func Authenticate(tokens map[string]string, next http.Handler) http.Handler
- func JSON(w http.ResponseWriter, thing interface{})
- func JSONLiteral(w http.ResponseWriter, thing string)
- func Sentencify(words []string) string
- func ShouldOAuthRedirect(path string) bool
- type ArchiveAPI
- type AuthConfig
- type AuthZConfig
- type Authenticator
- type BasicAuthConfig
- type BasicAuthenticator
- type ClientError
- type Config
- type GithubVerifier
- type InvalidParametersError
- type JSONError
- type JWTCreator
- type JobAPI
- type MembershipChecker
- type MetaAPI
- type MissingParametersError
- type OAuthConfig
- type OAuthenticator
- type PingAPI
- type RetentionAPI
- type ScheduleAPI
- type SessionsConfig
- type StatusAPI
- type StoreAPI
- type Supervisor
- func (s *Supervisor) CheckSchedule()
- func (s *Supervisor) FailUnfinishedTasks() error
- func (s *Supervisor) PurgeArchives()
- func (s *Supervisor) ReadConfig(path string) error
- func (s *Supervisor) RemoveTaskFromRunq(id uuid.UUID)
- func (s *Supervisor) ReschedulePendingTasks() error
- func (s *Supervisor) Resync() error
- func (s *Supervisor) Run() error
- func (s *Supervisor) ScheduleAdhoc(a *db.Task)
- func (s *Supervisor) ScheduleTask(t *db.Task)
- func (s *Supervisor) SpawnAPI()
- func (s *Supervisor) SpawnWorker()
- func (s *Supervisor) SpawnWorkers()
- type TargetAPI
- type TaskAPI
- type UAAVerifier
- type UpdateOp
- type Validator
- type WebServer
- type WorkerRequest
- type WorkerUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶ added in v0.6.4
func JSON ¶
func JSON(w http.ResponseWriter, thing interface{})
func JSONLiteral ¶
func JSONLiteral(w http.ResponseWriter, thing string)
func Sentencify ¶
func ShouldOAuthRedirect ¶ added in v0.6.4
Types ¶
type ArchiveAPI ¶
func (ArchiveAPI) ServeHTTP ¶
func (self ArchiveAPI) ServeHTTP(w http.ResponseWriter, req *http.Request)
type AuthConfig ¶ added in v0.6.4
type AuthConfig struct { Tokens map[string]string `yaml:"api_tokens"` Basic BasicAuthConfig `yaml:"basic"` OAuth OAuthConfig `yaml:"oauth"` }
type AuthZConfig ¶ added in v0.6.4
type AuthZConfig struct {
Orgs []string `yaml:"orgs"`
}
type Authenticator ¶ added in v0.6.4
type Authenticator interface { IsAuthenticated(*http.Request) bool RequireAuth(http.ResponseWriter, *http.Request) }
var UserAuthenticator Authenticator
type BasicAuthConfig ¶ added in v0.6.4
type BasicAuthenticator ¶ added in v0.6.4
type BasicAuthenticator struct {
Cfg BasicAuthConfig
}
func (BasicAuthenticator) IsAuthenticated ¶ added in v0.6.4
func (ba BasicAuthenticator) IsAuthenticated(r *http.Request) bool
func (BasicAuthenticator) RequireAuth ¶ added in v0.6.4
func (ba BasicAuthenticator) RequireAuth(w http.ResponseWriter, r *http.Request)
type ClientError ¶ added in v0.4.1
type ClientError struct {
Error string `json:"error"`
}
func ClientErrorf ¶ added in v0.4.1
func ClientErrorf(format string, v ...interface{}) ClientError
func (ClientError) JSON ¶ added in v0.4.1
func (e ClientError) JSON() string
type Config ¶
type Config struct { DatabaseType string `yaml:"database_type"` DatabaseDSN string `yaml:"database_dsn"` Addr string `yaml:"listen_addr"` PrivateKeyFile string `yaml:"private_key"` WebRoot string `yaml:"web_root"` Workers uint `yaml:"workers"` PurgeAgent string `yaml:"purge_agent"` MaxTimeout uint `yaml:"max_timeout"` SkipSSLVerify bool `yaml:"skip_ssl_verify"` Auth AuthConfig `yaml:"auth"` }
type GithubVerifier ¶ added in v0.6.4
type GithubVerifier struct {
Orgs []string
}
func (*GithubVerifier) Membership ¶ added in v0.6.4
type InvalidParametersError ¶
func InvalidParameters ¶
func InvalidParameters(names ...string) InvalidParametersError
func (InvalidParametersError) Error ¶
func (e InvalidParametersError) Error() string
func (*InvalidParametersError) IsValid ¶
func (e *InvalidParametersError) IsValid() bool
func (InvalidParametersError) JSON ¶
func (e InvalidParametersError) JSON() string
func (*InvalidParametersError) Validate ¶
func (e *InvalidParametersError) Validate(name string, value interface{}, fn Validator)
type JWTCreator ¶ added in v0.6.4
type JWTCreator struct {
SigningKey *rsa.PrivateKey
}
func (JWTCreator) GenToken ¶ added in v0.6.4
func (jc JWTCreator) GenToken(user interface{}, membership interface{}, maxAge int) (string, error)
func (JWTCreator) ServeHTTP ¶ added in v0.6.4
func (jc JWTCreator) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MembershipChecker ¶ added in v0.6.4
type MembershipChecker interface { Membership(goth.User, *http.Client) (map[string]interface{}, error) Verify(string, map[string]interface{}) bool }
var OAuthVerifier MembershipChecker
type MissingParametersError ¶
type MissingParametersError struct {
Missing []string `json:"missing"`
}
func MissingParameters ¶
func MissingParameters(names ...string) MissingParametersError
func (*MissingParametersError) Check ¶
func (e *MissingParametersError) Check(name string, value string)
func (MissingParametersError) Error ¶
func (e MissingParametersError) Error() string
func (MissingParametersError) IsValid ¶
func (e MissingParametersError) IsValid() bool
func (MissingParametersError) JSON ¶
func (e MissingParametersError) JSON() string
type OAuthConfig ¶ added in v0.6.4
type OAuthConfig struct { Provider string `yaml:"provider"` ProviderURL string `yaml:"provider_url"` Key string `yaml:"key"` Secret string `yaml:"secret"` BaseURL string `yaml:"base_url"` Authorization AuthZConfig `yaml:"authorization"` Sessions SessionsConfig `yaml:"sessions"` SigningKey string `yaml:"signing_key"` JWTPrivateKey *rsa.PrivateKey JWTPublicKey *rsa.PublicKey Client *http.Client }
type OAuthenticator ¶ added in v0.6.4
type OAuthenticator struct {
Cfg OAuthConfig
}
func (OAuthenticator) IsAuthenticated ¶ added in v0.6.4
func (oa OAuthenticator) IsAuthenticated(r *http.Request) bool
func (OAuthenticator) OAuthCallback ¶ added in v0.6.4
func (oa OAuthenticator) OAuthCallback() http.Handler
func (OAuthenticator) RequireAuth ¶ added in v0.6.4
func (oa OAuthenticator) RequireAuth(w http.ResponseWriter, r *http.Request)
type RetentionAPI ¶
func (RetentionAPI) ServeHTTP ¶
func (self RetentionAPI) ServeHTTP(w http.ResponseWriter, req *http.Request)
type ScheduleAPI ¶
func (ScheduleAPI) ServeHTTP ¶
func (self ScheduleAPI) ServeHTTP(w http.ResponseWriter, req *http.Request)
type SessionsConfig ¶ added in v0.6.4
type StatusAPI ¶ added in v0.4.1
type StatusAPI struct { Data *db.DB Super *Supervisor }
type Supervisor ¶
type Supervisor struct { Database *db.DB PrivateKeyFile string /* path to the SSH private key for talking to remote agents */ Workers uint /* how many workers to spin up */ PurgeAgent string /* What agent to use for purge jobs */ Web *WebServer /* Webserver that gets spawned to handle http requests */ Timeout time.Duration // contains filtered or unexported fields }
func NewSupervisor ¶
func NewSupervisor() *Supervisor
func (*Supervisor) CheckSchedule ¶
func (s *Supervisor) CheckSchedule()
func (*Supervisor) FailUnfinishedTasks ¶ added in v0.6.4
func (s *Supervisor) FailUnfinishedTasks() error
func (*Supervisor) PurgeArchives ¶
func (s *Supervisor) PurgeArchives()
func (*Supervisor) ReadConfig ¶
func (s *Supervisor) ReadConfig(path string) error
func (*Supervisor) RemoveTaskFromRunq ¶ added in v0.6.4
func (s *Supervisor) RemoveTaskFromRunq(id uuid.UUID)
func (*Supervisor) ReschedulePendingTasks ¶ added in v0.6.4
func (s *Supervisor) ReschedulePendingTasks() error
func (*Supervisor) Resync ¶
func (s *Supervisor) Resync() error
func (*Supervisor) Run ¶
func (s *Supervisor) Run() error
func (*Supervisor) ScheduleAdhoc ¶
func (s *Supervisor) ScheduleAdhoc(a *db.Task)
func (*Supervisor) ScheduleTask ¶ added in v0.4.1
func (s *Supervisor) ScheduleTask(t *db.Task)
func (*Supervisor) SpawnAPI ¶
func (s *Supervisor) SpawnAPI()
func (*Supervisor) SpawnWorker ¶
func (s *Supervisor) SpawnWorker()
func (*Supervisor) SpawnWorkers ¶
func (s *Supervisor) SpawnWorkers()
type UAAVerifier ¶ added in v0.6.4
func (*UAAVerifier) Membership ¶ added in v0.6.4
type WebServer ¶ added in v0.6.4
type WebServer struct { Database *db.DB Addr string WebRoot string Auth AuthConfig Authenticator http.Handler Supervisor *Supervisor }
func (*WebServer) ProtectedAPIs ¶ added in v0.6.4
type WorkerRequest ¶
Click to show internal directories.
Click to hide internal directories.