Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeOAuth2State(state string) (eventline.Id, eventline.Id, error)
- func DefaultProjectNotificationSettings(project *eventline.Project) *eventline.ProjectNotificationSettings
- func DefaultProjectSettings(project *eventline.Project) *eventline.ProjectSettings
- func EncodeOAuth2State(identityId eventline.Id, sessionId eventline.Id) (string, error)
- func IdentityConnectorSelect(name string) *web.Select
- func IdentityTypeSelect(cdef *eventline.ConnectorDef, name string) *web.Select
- func NewLoginMenu(selectedEntry string) *web.Menu
- func NewMainMenu(selectedEntry string) *web.Menu
- type APIClient
- type APIError
- type APIHTTPServer
- type APIRequestError
- type DuplicateAPIKeyNameError
- type DuplicateIdentityNameError
- type DuplicateProjectNameError
- type DuplicateUsernameError
- type EventWorker
- type HTTPContext
- type HTTPHandler
- func (h *HTTPHandler) DeleteCookie()
- func (h *HTTPHandler) IdPathVariable(name string) (id eventline.Id, err error)
- func (h *HTTPHandler) LoadSession(sessionId eventline.Id) error
- func (h *HTTPHandler) ParseCursor(sorts eventline.Sorts) (*eventline.Cursor, error)
- func (h *HTTPHandler) ParseMetricParameters() (*eventline.MetricParameters, error)
- func (h *HTTPHandler) RedirectionTarget() string
- func (h *HTTPHandler) ReplyAuthError(status int, code string, format string, args ...interface{})
- func (h *HTTPHandler) ReplyContent(status int, content web.Content)
- func (h *HTTPHandler) ReplyJSONLocation(status int, uri string, extra map[string]interface{})
- func (h *HTTPHandler) ReplyView(status int, view *web.View)
- func (h *HTTPHandler) SetContextSession(session *eventline.Session)
- func (h *HTTPHandler) SetSessionCookie(cookie *http.Cookie)
- func (h *HTTPHandler) TimestampQueryParameter(name string) (*time.Time, error)
- type HTTPInterface
- type HTTPRouteFunc
- type HTTPRouteOptions
- type HTTPServer
- func (s *HTTPServer) AbortJobExecution(h *HTTPHandler, jeId eventline.Id) error
- func (s *HTTPServer) CreateProject(h *HTTPHandler, newProject *eventline.NewProject) (*eventline.Project, error)
- func (s *HTTPServer) DeleteJob(h *HTTPHandler, jobId eventline.Id) error
- func (s *HTTPServer) DeleteProject(h *HTTPHandler, projectId eventline.Id) error
- func (s *HTTPServer) DisableJob(h *HTTPHandler, jobId eventline.Id) error
- func (s *HTTPServer) EnableJob(h *HTTPHandler, jobId eventline.Id) error
- func (s *HTTPServer) ExecuteJob(h *HTTPHandler, jobId eventline.Id, input *eventline.JobExecutionInput) (*eventline.JobExecution, error)
- func (s *HTTPServer) LoadAccount(h *HTTPHandler) (*eventline.Account, error)
- func (s *HTTPServer) LoadAccountPage(h *HTTPHandler) (*eventline.Page, error)
- func (s *HTTPServer) LoadIdentity(h *HTTPHandler, identityId eventline.Id) (*eventline.Identity, error)
- func (s *HTTPServer) LoadIdentityByName(h *HTTPHandler, identityName string) (*eventline.Identity, error)
- func (s *HTTPServer) LoadJob(h *HTTPHandler, jobId eventline.Id) (*eventline.Job, error)
- func (s *HTTPServer) LoadJobByName(h *HTTPHandler, jobName string) (*eventline.Job, error)
- func (s *HTTPServer) LoadJobExecution(h *HTTPHandler, jeId eventline.Id) (*eventline.JobExecution, error)
- func (s *HTTPServer) LoadProject(h *HTTPHandler, projectId eventline.Id) (*eventline.Project, error)
- func (s *HTTPServer) LoadProjectByName(h *HTTPHandler, projectName string) (*eventline.Project, error)
- func (s *HTTPServer) LoadProjectPage(h *HTTPHandler) (*eventline.Page, error)
- func (s *HTTPServer) LogIn(h *HTTPHandler, loginData *LoginData) (*eventline.Session, error)
- func (s *HTTPServer) RenameJob(h *HTTPHandler, jobId eventline.Id, data *eventline.JobRenamingData) error
- func (s *HTTPServer) RestartJobExecution(h *HTTPHandler, jeId eventline.Id) error
- func (s *HTTPServer) UpdateProject(h *HTTPHandler, projectId eventline.Id, newProject *eventline.NewProject) (*eventline.Project, error)
- type IdentityInUseError
- type IdentityRefresher
- type JobExecutionGC
- type JobExecutionWatcher
- type JobScheduler
- type JobSpecValidator
- type LoginData
- type NotificationWorker
- type NotificationsCfg
- type ProService
- type ProjectConfiguration
- type Runner
- type SMTPServerCfg
- type Service
- func (s *Service) AbortJobExecution(jeId eventline.Id, scope eventline.Scope) (*eventline.JobExecution, error)
- func (s *Service) AddFavouriteJob(conn pg.Conn, jobId eventline.Id, scope eventline.Scope) error
- func (s *Service) CreateAPIKey(newAPIKey *eventline.NewAPIKey, scope eventline.Scope) (*eventline.APIKey, string, error)
- func (s *Service) CreateAccount(newAccount *eventline.NewAccount) (*eventline.Account, error)
- func (s *Service) CreateIdentity(newIdentity *eventline.NewIdentity, scope eventline.Scope) (*eventline.Identity, error)
- func (s *Service) CreateNotification(conn pg.Conn, recipients []string, subject, templateName string, ...) error
- func (s *Service) CreateOrUpdateJob(conn pg.Conn, spec *eventline.JobSpec, scope eventline.Scope) (*eventline.Job, bool, error)
- func (s *Service) CreateProject(newProject *eventline.NewProject, accountId *eventline.Id) (*eventline.Project, error)
- func (s *Service) CreateSession(conn pg.Conn, ns *eventline.NewSession, scope eventline.Scope) (*eventline.Session, error)
- func (s *Service) CreateSubscription(conn pg.Conn, job *eventline.Job, scope eventline.Scope) (*eventline.Subscription, error)
- func (s *Service) DefaultCfg() interface{}
- func (s *Service) DeleteAPIKey(keyId eventline.Id, scope eventline.Scope) error
- func (s *Service) DeleteAccount(accountId eventline.Id) error
- func (s *Service) DeleteIdentities(conn pg.Conn, scope eventline.Scope) error
- func (s *Service) DeleteIdentity(identityId eventline.Id, scope eventline.Scope) error
- func (s *Service) DeleteJob(conn pg.Conn, job *eventline.Job, scope eventline.Scope) error
- func (s *Service) DeleteProject(projectId eventline.Id, hctx *HTTPContext) error
- func (s *Service) DeliverNotification(conn pg.Conn, n *eventline.Notification) error
- func (s *Service) DisableJob(conn pg.Conn, jobId eventline.Id, scope eventline.Scope) (*eventline.Job, error)
- func (s *Service) EnableJob(conn pg.Conn, jobId eventline.Id, scope eventline.Scope) (*eventline.Job, error)
- func (s *Service) ExecuteJob(conn pg.Conn, jobId eventline.Id, input *eventline.JobExecutionInput, ...) (*eventline.JobExecution, error)
- func (s *Service) FindConnectorWorker(cname string) *eventline.Worker
- func (s *Service) FindWorker(name string) *eventline.Worker
- func (s *Service) IdentityRedirectionURI(identity *eventline.Identity, sessionId eventline.Id, defaultURI string) (string, error)
- func (s *Service) Init(ss *goservice.Service) error
- func (s *Service) InstantiateJob(conn pg.Conn, job *eventline.Job, event *eventline.Event, ...) (*eventline.JobExecution, error)
- func (s *Service) LoadJobExecutionContext(conn pg.Conn, je *eventline.JobExecution) (*eventline.ExecutionContext, error)
- func (s *Service) LogIn(data *LoginData, httpCtx *HTTPContext) (*eventline.Session, error)
- func (s *Service) LogOut(httpCtx *HTTPContext) error
- func (s *Service) MaybeCreateDefaultAccount(conn pg.Conn) (*eventline.Account, error)
- func (s *Service) MaybeCreateDefaultProject(conn pg.Conn, account *eventline.Account) (*eventline.Project, error)
- func (s *Service) ProcessEvent(conn pg.Conn, event *eventline.Event, scope eventline.Scope) (bool, error)
- func (s *Service) ProcessSubscription(conn pg.Conn, sctx *eventline.SubscriptionContext) error
- func (s *Service) RefreshIdentity(identityId eventline.Id, scope eventline.Scope) error
- func (s *Service) RemoveFavouriteJob(conn pg.Conn, jobId eventline.Id, scope eventline.Scope) error
- func (s *Service) RenameJob(conn pg.Conn, jobId eventline.Id, data *eventline.JobRenamingData, ...) (*eventline.Job, error)
- func (s *Service) RenderNotificationText(name string, data interface{}) ([]byte, error)
- func (s *Service) ReplayEvent(eventId eventline.Id, scope eventline.Scope) (*eventline.Event, error)
- func (s *Service) RestartJobExecution(jeId eventline.Id, scope eventline.Scope) (*eventline.JobExecution, error)
- func (s *Service) SelectAccountProject(projectId eventline.Id, hctx *HTTPContext) error
- func (s *Service) SelfUpdateAccount(accountId eventline.Id, update *eventline.AccountSelfUpdate, hctx *HTTPContext) error
- func (s *Service) SelfUpdateAccountPassword(accountId eventline.Id, update *eventline.AccountPasswordUpdate) error
- func (s *Service) SendJobExecutionNotification(conn pg.Conn, je *eventline.JobExecution) error
- func (s *Service) ServiceCfg() *goservice.ServiceCfg
- func (s *Service) Start(ss *goservice.Service) error
- func (s *Service) StartJobExecution(conn pg.Conn, je *eventline.JobExecution, scope eventline.Scope) error
- func (s *Service) StartRunner(data *eventline.RunnerData) (Runner, error)
- func (s *Service) Stop(ss *goservice.Service)
- func (s *Service) Terminate(ss *goservice.Service)
- func (s *Service) TerminateSubscription(conn pg.Conn, subscription *eventline.Subscription, projectDeletion bool, ...) error
- func (s *Service) TerminateSubscriptions(conn pg.Conn, scope eventline.Scope) error
- func (s *Service) UpdateAccount(accountId eventline.Id, update *eventline.AccountUpdate) (*eventline.Account, error)
- func (s *Service) UpdateAccountPassword(accountId eventline.Id, update *eventline.AccountPasswordUpdate) (*eventline.Account, error)
- func (s *Service) UpdateIdentity(identityId eventline.Id, newIdentity *eventline.NewIdentity, ...) (*eventline.Identity, error)
- func (s *Service) UpdateJobExecutionFailure(conn pg.Conn, je *eventline.JobExecution, format string, args ...interface{}) error
- func (s *Service) UpdateProjectConfiguration(projectId eventline.Id, cfg *ProjectConfiguration) error
- func (s *Service) ValidateCfg() error
- func (s *Service) ValidateJobSpec(conn pg.Conn, spec *eventline.JobSpec, scope eventline.Scope) error
- func (s *Service) WrapRoute(fn HTTPRouteFunc, options HTTPRouteOptions, iface HTTPInterface) shttp.RouteFunc
- type ServiceCfg
- type ServiceData
- type SessionGC
- type SubscriptionWorker
- type WebContext
- type WebHTTPServer
Constants ¶
View Source
const ( SessionCookieName = "session_id" SessionTTL = 86_400 // seconds )
View Source
const ( PgAdvisoryLockId2ServiceInit uint32 = 0x0001 PgAdvisoryLockId2JobScheduling uint32 = 0x0002 PgAdvisoryLockId2JobDeployment uint32 = 0x0003 )
View Source
const PgAdvisoryLockId1 uint32 = 0x0101
Advisory locks are identified by two 32 bit integers. We arbitrarily reserve a value for the first one for all locks taken by Eventline.
Note that go-service uses 0x0100 (pg.AdvisoryLockId1).
Variables ¶
View Source
var ( ErrAuthenticationRequired = errors.New("authentication required") ErrAdminRoleRequired = errors.New("admin role required") ErrInvalidSessionCookie = errors.New("invalid session cookie") ErrUnknownAPIKey = errors.New("unknown api key") ErrUnknownAccount = errors.New("unknown account") ErrUnknownSession = errors.New("unknown session") ErrMissingProjectId = errors.New("missing project id") ErrInvalidProjectId = errors.New("invalid project id") )
View Source
var Connectors = []eventline.Connector{ cdockerhub.NewConnector(), ceventline.NewConnector(), cgeneric.NewConnector(), cgithub.NewConnector(), cpostgresql.NewConnector(), ctime.NewConnector(), }
View Source
var (
ErrIdentityNotRefreshable = errors.New("identity is not refreshable")
)
View Source
var (
ErrWrongPassword = errors.New("wrong password")
)
Functions ¶
func DefaultProjectNotificationSettings ¶
func DefaultProjectNotificationSettings(project *eventline.Project) *eventline.ProjectNotificationSettings
func DefaultProjectSettings ¶
func DefaultProjectSettings(project *eventline.Project) *eventline.ProjectSettings
func EncodeOAuth2State ¶
func IdentityConnectorSelect ¶
func IdentityTypeSelect ¶
func IdentityTypeSelect(cdef *eventline.ConnectorDef, name string) *web.Select
func NewLoginMenu ¶
func NewMainMenu ¶
Types ¶
type APIClient ¶ added in v1.1.0
func NewAPIClient ¶ added in v1.1.0
func (*APIClient) SendJSONRequest ¶ added in v1.1.0
type APIHTTPServer ¶
type APIHTTPServer struct {
*HTTPServer
}
func NewAPIHTTPServer ¶
func NewAPIHTTPServer(service *Service) (*APIHTTPServer, error)
type APIRequestError ¶ added in v1.1.0
func (APIRequestError) Error ¶ added in v1.1.0
func (err APIRequestError) Error() string
type DuplicateAPIKeyNameError ¶
type DuplicateAPIKeyNameError struct {
Name string
}
func (DuplicateAPIKeyNameError) Error ¶
func (err DuplicateAPIKeyNameError) Error() string
type DuplicateIdentityNameError ¶
type DuplicateIdentityNameError struct {
Name string
}
func (DuplicateIdentityNameError) Error ¶
func (err DuplicateIdentityNameError) Error() string
type DuplicateProjectNameError ¶
type DuplicateProjectNameError struct {
Name string
}
func (DuplicateProjectNameError) Error ¶
func (err DuplicateProjectNameError) Error() string
type DuplicateUsernameError ¶
type DuplicateUsernameError struct {
Username string
}
func (DuplicateUsernameError) Error ¶
func (err DuplicateUsernameError) Error() string
type EventWorker ¶
func NewEventWorker ¶
func NewEventWorker(s *Service) *EventWorker
func (*EventWorker) Init ¶
func (ew *EventWorker) Init(w *eventline.Worker)
func (*EventWorker) ProcessJob ¶
func (ew *EventWorker) ProcessJob() (bool, error)
func (*EventWorker) Start ¶
func (ew *EventWorker) Start() error
func (*EventWorker) Stop ¶
func (ew *EventWorker) Stop()
type HTTPContext ¶
type HTTPContext struct { // If authenticated AccountId *eventline.Id AccountRole *eventline.AccountRole AccountSettings *eventline.AccountSettings // If authenticated on the web interface Session *eventline.Session // If there is a current project ProjectIdChecked bool // true if we have performed project id detection ProjectId *eventline.Id ProjectName string }
func (*HTTPContext) AccountProjectScope ¶
func (ctx *HTTPContext) AccountProjectScope() eventline.Scope
func (*HTTPContext) AccountScope ¶
func (ctx *HTTPContext) AccountScope() eventline.Scope
func (*HTTPContext) ProjectScope ¶
func (ctx *HTTPContext) ProjectScope() eventline.Scope
type HTTPHandler ¶
type HTTPHandler struct { *shttp.Handler Service *Service Interface HTTPInterface RouteOptions HTTPRouteOptions Context *HTTPContext }
func (*HTTPHandler) DeleteCookie ¶
func (h *HTTPHandler) DeleteCookie()
func (*HTTPHandler) IdPathVariable ¶ added in v1.1.0
func (h *HTTPHandler) IdPathVariable(name string) (id eventline.Id, err error)
func (*HTTPHandler) LoadSession ¶
func (h *HTTPHandler) LoadSession(sessionId eventline.Id) error
func (*HTTPHandler) ParseCursor ¶
func (*HTTPHandler) ParseMetricParameters ¶
func (h *HTTPHandler) ParseMetricParameters() (*eventline.MetricParameters, error)
func (*HTTPHandler) RedirectionTarget ¶
func (h *HTTPHandler) RedirectionTarget() string
func (*HTTPHandler) ReplyAuthError ¶
func (h *HTTPHandler) ReplyAuthError(status int, code string, format string, args ...interface{})
func (*HTTPHandler) ReplyContent ¶
func (h *HTTPHandler) ReplyContent(status int, content web.Content)
func (*HTTPHandler) ReplyJSONLocation ¶
func (h *HTTPHandler) ReplyJSONLocation(status int, uri string, extra map[string]interface{})
func (*HTTPHandler) SetContextSession ¶
func (h *HTTPHandler) SetContextSession(session *eventline.Session)
func (*HTTPHandler) SetSessionCookie ¶
func (h *HTTPHandler) SetSessionCookie(cookie *http.Cookie)
func (*HTTPHandler) TimestampQueryParameter ¶
func (h *HTTPHandler) TimestampQueryParameter(name string) (*time.Time, error)
type HTTPInterface ¶
type HTTPInterface string
const ( APIHTTPInterface HTTPInterface = "api" WebHTTPInterface HTTPInterface = "web" )
type HTTPRouteFunc ¶
type HTTPRouteFunc func(*HTTPHandler)
type HTTPRouteOptions ¶
type HTTPServer ¶
type HTTPServer struct { Log *log.Logger Pg *pg.Client // shortcut to avoid s.Service.Pg Service *Service Server *shttp.Server }
func (*HTTPServer) AbortJobExecution ¶ added in v1.0.0
func (s *HTTPServer) AbortJobExecution(h *HTTPHandler, jeId eventline.Id) error
func (*HTTPServer) CreateProject ¶
func (s *HTTPServer) CreateProject(h *HTTPHandler, newProject *eventline.NewProject) (*eventline.Project, error)
func (*HTTPServer) DeleteJob ¶
func (s *HTTPServer) DeleteJob(h *HTTPHandler, jobId eventline.Id) error
func (*HTTPServer) DeleteProject ¶
func (s *HTTPServer) DeleteProject(h *HTTPHandler, projectId eventline.Id) error
func (*HTTPServer) DisableJob ¶
func (s *HTTPServer) DisableJob(h *HTTPHandler, jobId eventline.Id) error
func (*HTTPServer) EnableJob ¶
func (s *HTTPServer) EnableJob(h *HTTPHandler, jobId eventline.Id) error
func (*HTTPServer) ExecuteJob ¶
func (s *HTTPServer) ExecuteJob(h *HTTPHandler, jobId eventline.Id, input *eventline.JobExecutionInput) (*eventline.JobExecution, error)
func (*HTTPServer) LoadAccount ¶
func (s *HTTPServer) LoadAccount(h *HTTPHandler) (*eventline.Account, error)
func (*HTTPServer) LoadAccountPage ¶
func (s *HTTPServer) LoadAccountPage(h *HTTPHandler) (*eventline.Page, error)
func (*HTTPServer) LoadIdentity ¶
func (s *HTTPServer) LoadIdentity(h *HTTPHandler, identityId eventline.Id) (*eventline.Identity, error)
func (*HTTPServer) LoadIdentityByName ¶ added in v1.1.0
func (s *HTTPServer) LoadIdentityByName(h *HTTPHandler, identityName string) (*eventline.Identity, error)
func (*HTTPServer) LoadJob ¶
func (s *HTTPServer) LoadJob(h *HTTPHandler, jobId eventline.Id) (*eventline.Job, error)
func (*HTTPServer) LoadJobByName ¶
func (s *HTTPServer) LoadJobByName(h *HTTPHandler, jobName string) (*eventline.Job, error)
func (*HTTPServer) LoadJobExecution ¶ added in v1.0.0
func (s *HTTPServer) LoadJobExecution(h *HTTPHandler, jeId eventline.Id) (*eventline.JobExecution, error)
func (*HTTPServer) LoadProject ¶
func (s *HTTPServer) LoadProject(h *HTTPHandler, projectId eventline.Id) (*eventline.Project, error)
func (*HTTPServer) LoadProjectByName ¶
func (s *HTTPServer) LoadProjectByName(h *HTTPHandler, projectName string) (*eventline.Project, error)
func (*HTTPServer) LoadProjectPage ¶
func (s *HTTPServer) LoadProjectPage(h *HTTPHandler) (*eventline.Page, error)
func (*HTTPServer) LogIn ¶
func (s *HTTPServer) LogIn(h *HTTPHandler, loginData *LoginData) (*eventline.Session, error)
func (*HTTPServer) RenameJob ¶ added in v1.1.0
func (s *HTTPServer) RenameJob(h *HTTPHandler, jobId eventline.Id, data *eventline.JobRenamingData) error
func (*HTTPServer) RestartJobExecution ¶ added in v1.0.0
func (s *HTTPServer) RestartJobExecution(h *HTTPHandler, jeId eventline.Id) error
func (*HTTPServer) UpdateProject ¶
func (s *HTTPServer) UpdateProject(h *HTTPHandler, projectId eventline.Id, newProject *eventline.NewProject) (*eventline.Project, error)
type IdentityInUseError ¶
func (IdentityInUseError) Error ¶
func (err IdentityInUseError) Error() string
type IdentityRefresher ¶
type IdentityRefresher struct { Log *log.Logger Service *Service // contains filtered or unexported fields }
func NewIdentityRefresher ¶
func NewIdentityRefresher(s *Service) *IdentityRefresher
func (*IdentityRefresher) Init ¶
func (ir *IdentityRefresher) Init(w *eventline.Worker)
func (*IdentityRefresher) ProcessJob ¶
func (ir *IdentityRefresher) ProcessJob() (bool, error)
func (*IdentityRefresher) Start ¶
func (ir *IdentityRefresher) Start() error
func (*IdentityRefresher) Stop ¶
func (ir *IdentityRefresher) Stop()
type JobExecutionGC ¶ added in v1.0.0
func NewJobExecutionGC ¶ added in v1.0.0
func NewJobExecutionGC(s *Service) *JobExecutionGC
func (*JobExecutionGC) Init ¶ added in v1.0.0
func (jegc *JobExecutionGC) Init(w *eventline.Worker)
func (*JobExecutionGC) ProcessJob ¶ added in v1.0.0
func (jegc *JobExecutionGC) ProcessJob() (bool, error)
func (*JobExecutionGC) Start ¶ added in v1.0.0
func (jegc *JobExecutionGC) Start() error
func (*JobExecutionGC) Stop ¶ added in v1.0.0
func (jegc *JobExecutionGC) Stop()
type JobExecutionWatcher ¶ added in v1.0.0
func NewJobExecutionWatcher ¶ added in v1.0.0
func NewJobExecutionWatcher(s *Service) *JobExecutionWatcher
func (*JobExecutionWatcher) Init ¶ added in v1.0.0
func (w *JobExecutionWatcher) Init(worker *eventline.Worker)
func (*JobExecutionWatcher) ProcessJob ¶ added in v1.0.0
func (w *JobExecutionWatcher) ProcessJob() (bool, error)
func (*JobExecutionWatcher) Start ¶ added in v1.0.0
func (w *JobExecutionWatcher) Start() error
func (*JobExecutionWatcher) Stop ¶ added in v1.0.0
func (w *JobExecutionWatcher) Stop()
type JobScheduler ¶
func NewJobScheduler ¶
func NewJobScheduler(s *Service) *JobScheduler
func (*JobScheduler) Init ¶
func (js *JobScheduler) Init(w *eventline.Worker)
func (*JobScheduler) ProcessJob ¶
func (js *JobScheduler) ProcessJob() (bool, error)
func (*JobScheduler) Start ¶
func (js *JobScheduler) Start() error
func (*JobScheduler) Stop ¶
func (js *JobScheduler) Stop()
type JobSpecValidator ¶ added in v1.1.0
type LoginData ¶
func (*LoginData) ValidateJSON ¶ added in v1.1.0
type NotificationWorker ¶
func NewNotificationWorker ¶
func NewNotificationWorker(s *Service) *NotificationWorker
func (*NotificationWorker) Init ¶
func (nw *NotificationWorker) Init(w *eventline.Worker)
func (*NotificationWorker) ProcessJob ¶
func (nw *NotificationWorker) ProcessJob() (bool, error)
func (*NotificationWorker) Start ¶
func (nw *NotificationWorker) Start() error
func (*NotificationWorker) Stop ¶
func (nw *NotificationWorker) Stop()
type NotificationsCfg ¶
type NotificationsCfg struct { SMTPServer *SMTPServerCfg `json:"smtp_server"` FromAddress string `json:"from_address"` SubjectPrefix string `json:"subject_prefix"` Signature string `json:"signature"` AllowedDomains []string `json:"allowed_domains"` }
func DefaultNotificationsCfg ¶
func DefaultNotificationsCfg() *NotificationsCfg
func (*NotificationsCfg) ValidateJSON ¶ added in v1.1.0
func (cfg *NotificationsCfg) ValidateJSON(v *ejson.Validator)
type ProService ¶ added in v1.0.0
type ProService interface { DefaultServiceCfg() ejson.Validatable Init(*Service) error Start() error Stop() Terminate() }
type ProjectConfiguration ¶
type ProjectConfiguration struct { Project *eventline.NewProject `json:"project"` ProjectSettings *eventline.ProjectSettings `json:"project_settings"` ProjectNotificationSettings *eventline.ProjectNotificationSettings `json:"project_notification_settings"` }
func (*ProjectConfiguration) ValidateJSON ¶ added in v1.1.0
func (cfg *ProjectConfiguration) ValidateJSON(v *ejson.Validator)
type SMTPServerCfg ¶
type SMTPServerCfg struct { Address string `json:"address"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` }
func (*SMTPServerCfg) ValidateJSON ¶ added in v1.1.0
func (cfg *SMTPServerCfg) ValidateJSON(v *ejson.Validator)
type Service ¶
type Service struct { Data ServiceData Cfg ServiceCfg Service *goservice.Service Log *log.Logger Pg *pg.Client APIHTTPServer *APIHTTPServer WebHTTPServer *WebHTTPServer BuildIdHash string WebHTTPServerURI *url.URL // contains filtered or unexported fields }
func NewService ¶
func NewService(data ServiceData) *Service
func (*Service) AbortJobExecution ¶
func (*Service) AddFavouriteJob ¶
func (*Service) CreateAPIKey ¶
func (*Service) CreateAccount ¶
func (*Service) CreateIdentity ¶
func (*Service) CreateNotification ¶
func (*Service) CreateOrUpdateJob ¶
func (*Service) CreateProject ¶
func (*Service) CreateSession ¶
func (*Service) CreateSubscription ¶
func (*Service) DefaultCfg ¶ added in v1.1.0
func (s *Service) DefaultCfg() interface{}
func (*Service) DeleteAPIKey ¶
func (*Service) DeleteIdentities ¶
func (*Service) DeleteIdentity ¶
func (*Service) DeleteProject ¶
func (s *Service) DeleteProject(projectId eventline.Id, hctx *HTTPContext) error
func (*Service) DeliverNotification ¶
func (*Service) DisableJob ¶
func (*Service) ExecuteJob ¶
func (*Service) FindConnectorWorker ¶
func (*Service) IdentityRedirectionURI ¶
func (*Service) InstantiateJob ¶
func (*Service) LoadJobExecutionContext ¶
func (s *Service) LoadJobExecutionContext(conn pg.Conn, je *eventline.JobExecution) (*eventline.ExecutionContext, error)
func (*Service) LogOut ¶
func (s *Service) LogOut(httpCtx *HTTPContext) error
func (*Service) MaybeCreateDefaultAccount ¶
func (*Service) MaybeCreateDefaultProject ¶
func (*Service) ProcessEvent ¶
func (*Service) ProcessSubscription ¶
func (*Service) RefreshIdentity ¶
func (*Service) RemoveFavouriteJob ¶
func (*Service) RenderNotificationText ¶
func (*Service) ReplayEvent ¶
func (*Service) RestartJobExecution ¶
func (*Service) SelectAccountProject ¶
func (s *Service) SelectAccountProject(projectId eventline.Id, hctx *HTTPContext) error
func (*Service) SelfUpdateAccount ¶
func (s *Service) SelfUpdateAccount(accountId eventline.Id, update *eventline.AccountSelfUpdate, hctx *HTTPContext) error
func (*Service) SelfUpdateAccountPassword ¶
func (*Service) SendJobExecutionNotification ¶
func (*Service) ServiceCfg ¶
func (s *Service) ServiceCfg() *goservice.ServiceCfg
func (*Service) StartJobExecution ¶
func (*Service) StartRunner ¶
func (s *Service) StartRunner(data *eventline.RunnerData) (Runner, error)
func (*Service) TerminateSubscription ¶
func (*Service) TerminateSubscriptions ¶
func (*Service) UpdateAccount ¶
func (*Service) UpdateAccountPassword ¶
func (*Service) UpdateIdentity ¶
func (*Service) UpdateJobExecutionFailure ¶ added in v1.0.0
func (*Service) UpdateProjectConfiguration ¶
func (s *Service) UpdateProjectConfiguration(projectId eventline.Id, cfg *ProjectConfiguration) error
func (*Service) ValidateCfg ¶ added in v1.1.0
func (*Service) ValidateJobSpec ¶
func (*Service) WrapRoute ¶
func (s *Service) WrapRoute(fn HTTPRouteFunc, options HTTPRouteOptions, iface HTTPInterface) shttp.RouteFunc
type ServiceCfg ¶
type ServiceCfg struct { Logger *log.LoggerCfg `json:"logger"` ServiceAPI *goservice.ServiceAPICfg `json:"service_api"` DataDirectory string `json:"data_directory"` APIHTTPServer *shttp.ServerCfg `json:"api_http_server"` WebHTTPServer *shttp.ServerCfg `json:"web_http_server"` Influx *influx.ClientCfg `json:"influx"` Pg *pg.ClientCfg `json:"pg"` EncryptionKey cryptoutils.AES256Key `json:"encryption_key"` WebHTTPServerURI string `json:"web_http_server_uri"` InsecureHTTPCookies bool `json:"insecure_http_cookies"` Connectors map[string]json.RawMessage `json:"connectors"` Workers map[string]eventline.WorkerCfg `json:"workers"` MaxParallelJobExecutions int `json:"max_parallel_job_executions"` JobExecutionRetention int `json:"job_execution_retention"` // days JobExecutionRefreshInterval int `json:"job_execution_refresh_interval"` // seconds JobExecutionTimeout int `json:"job_execution_timeout"` // seconds SessionRetention int `json:"session_retention"` // days AllowedRunners []string `json:"allowed_runners"` Runners map[string]json.RawMessage `json:"runners"` Notifications *NotificationsCfg `json:"notifications"` ProCfg ejson.Validatable `json:"pro"` }
func DefaultServiceCfg ¶
func DefaultServiceCfg() ServiceCfg
type ServiceData ¶
type SessionGC ¶ added in v1.0.0
func NewSessionGC ¶ added in v1.0.0
func (*SessionGC) ProcessJob ¶ added in v1.0.0
type SubscriptionWorker ¶
func NewSubscriptionWorker ¶
func NewSubscriptionWorker(s *Service) *SubscriptionWorker
func (*SubscriptionWorker) Init ¶
func (sw *SubscriptionWorker) Init(w *eventline.Worker)
func (*SubscriptionWorker) ProcessJob ¶
func (sw *SubscriptionWorker) ProcessJob() (bool, error)
func (*SubscriptionWorker) Start ¶
func (sw *SubscriptionWorker) Start() error
func (*SubscriptionWorker) Stop ¶
func (sw *SubscriptionWorker) Stop()
type WebContext ¶
type WebContext struct { Product string Version string VersionHash string PublicPage bool LoggedIn bool AccountSettings *eventline.AccountSettings ProjectIdChecked bool // true if we have performed project id detection ProjectId *eventline.Id ProjectName string }
The set of information we inject into every rendered piece of web content. It is available in templates as .Context.
func (*WebContext) FormatAltDate ¶
func (ctx *WebContext) FormatAltDate(t time.Time) (s string)
func (*WebContext) FormatDate ¶
func (ctx *WebContext) FormatDate(t time.Time) (s string)
func (*WebContext) FormatDuration ¶
func (ctx *WebContext) FormatDuration(d time.Duration) (s string)
type WebHTTPServer ¶
type WebHTTPServer struct {
*HTTPServer
}
func NewWebHTTPServer ¶
func NewWebHTTPServer(service *Service) (*WebHTTPServer, error)
func (*WebHTTPServer) NewTemplate ¶
func (s *WebHTTPServer) NewTemplate(name string, data interface{}) *web.Template
Source Files ¶
- accounts.go
- api_client.go
- api_http_server.go
- api_http_server_account.go
- api_http_server_events.go
- api_http_server_identities.go
- api_http_server_job_executions.go
- api_http_server_jobs.go
- api_http_server_login.go
- api_http_server_projects.go
- api_keys.go
- cfg.go
- event_worker.go
- events.go
- favourite_jobs.go
- http.go
- http_server_accounts.go
- http_server_identities.go
- http_server_job_executions.go
- http_server_jobs.go
- http_server_login.go
- http_server_projects.go
- identities.go
- identity_refresher.go
- job_execution_gc.go
- job_execution_watcher.go
- job_executions.go
- job_scheduler.go
- jobs.go
- login.go
- metrics.go
- notification_worker.go
- notifications.go
- oauth2.go
- pg.go
- projects.go
- runners.go
- service.go
- service_data.go
- session_gc.go
- subscription_worker.go
- subscriptions.go
- web.go
- web_context.go
- web_http_server.go
- web_http_server_account.go
- web_http_server_admin.go
- web_http_server_assets.go
- web_http_server_events.go
- web_http_server_external.go
- web_http_server_identities.go
- web_http_server_job_executions.go
- web_http_server_jobs.go
- web_http_server_login.go
- web_http_server_oauth2.go
- web_http_server_projects.go
- web_http_server_step_executions.go
Click to show internal directories.
Click to hide internal directories.