Documentation ¶
Index ¶
- func InvalidField(field string) error
- type App
- type Events
- type Job
- func (j *Job) GetJobInfoAndApp(db interfaces.DB) error
- func (j *Job) GetJobTemplatesByNameAndLocale(db interfaces.DB) (map[string]map[string]Template, error)
- func (j *Job) Labels() []string
- func (j *Job) TagError(db interfaces.DB, name, message string)
- func (j *Job) TagRunning(db interfaces.DB, name, message string)
- func (j *Job) TagSuccess(db interfaces.DB, name, message string)
- func (j *Job) Validate(c echo.Context) error
- type JobGroup
- type Status
- type Template
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InvalidField ¶
InvalidField returns an error telling that field is invalid
Types ¶
type App ¶
type App struct { ID uuid.UUID `sql:",pk" json:"id"` Name string `json:"name"` BundleID string `json:"bundleId"` CreatedBy string `json:"createdBy"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` }
App is the app model struct
type Events ¶
type Events struct { ID uuid.UUID `sql:",pk" json:"id"` Message string `json:"message"` StatusID uuid.UUID `sql:",notnull" json:"statusID"` State string `json:"state"` CreatedAt int64 `json:"createdAt"` }
Events is the events model struct
type Job ¶
type Job struct { ID uuid.UUID `sql:",pk" json:"id"` TotalBatches int `json:"totalBatches"` CompletedBatches int `json:"completedBatches"` ControlGroup float64 `json:"controlGroup"` TotalUsers int `json:"totalUsers"` TotalTokens int `json:"totalTokens"` CompletedTokens int `json:"completedTokens"` DBPageSize int `json:"dbPageSize"` Localized bool `json:"localized"` CompletedAt int64 `json:"completedAt"` ExpiresAt int64 `json:"expiresAt"` StartsAt int64 `json:"startsAt"` Context map[string]interface{} `json:"context"` Service string `json:"service"` Filters map[string]interface{} `json:"filters"` Metadata map[string]interface{} `json:"metadata"` CSVPath string `json:"csvPath"` ControlGroupCSVPath string `json:"controlGroupCsvPath"` CreatedBy string `json:"createdBy"` App App `json:"app"` AppID uuid.UUID `json:"appId"` JobGroupID uuid.UUID `json:"jobGroupId" sql:",null"` TemplateName string `json:"templateName"` PastTimeStrategy string `json:"pastTimeStrategy"` Status string `json:"status"` Feedbacks map[string]interface{} `json:"feedbacks"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` StatusEvents []*Status `json:"statusEvents"` }
Job is the job model struct
func (*Job) GetJobInfoAndApp ¶
func (j *Job) GetJobInfoAndApp(db interfaces.DB) error
GetJobInfoAndApp get the app and the job from the database job.ID must be set
func (*Job) GetJobTemplatesByNameAndLocale ¶
func (j *Job) GetJobTemplatesByNameAndLocale(db interfaces.DB) (map[string]map[string]Template, error)
GetJobTemplatesByNameAndLocale ...
func (*Job) TagError ¶
func (j *Job) TagError(db interfaces.DB, name, message string)
TagError create a status in one job
func (*Job) TagRunning ¶
func (j *Job) TagRunning(db interfaces.DB, name, message string)
TagRunning create a status in one job
func (*Job) TagSuccess ¶
func (j *Job) TagSuccess(db interfaces.DB, name, message string)
TagSuccess create a status in one job
type JobGroup ¶
type JobGroup struct { ID uuid.UUID `sql:",pk" json:"id"` AppID uuid.UUID `json:"appId"` Jobs []*Job `json:"jobs"` }
JobGroup is a collection of jobs
type Status ¶
type Status struct { ID uuid.UUID `sql:",pk" json:"id"` Name string `json:"name"` JobID uuid.UUID `sql:",notnull" json:"jobID"` CreatedAt int64 `json:"createdAt"` Events []*Events `json:"events"` // contains filtered or unexported fields }
Status is the status model struct
type Template ¶
type Template struct { ID uuid.UUID `sql:",pk" json:"id"` Name string `json:"name"` Locale string `json:"locale"` Defaults map[string]interface{} `json:"defaults"` Body map[string]interface{} `json:"body"` CreatedBy string `json:"createdBy"` App App `json:"app"` AppID uuid.UUID `json:"appId"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` }
Template is the template model struct
type User ¶
type User struct { ID uuid.UUID `sql:",pk" json:"id"` Email string `json:"email"` IsAdmin bool `sql:",notnull" json:"isAdmin"` AllowedApps []uuid.UUID `pg:",array" json:"allowedApps"` CreatedBy string `json:"createdBy"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` }
User is the user model struct
Click to show internal directories.
Click to hide internal directories.