Documentation ¶
Index ¶
- Constants
- func StringContain(s []string, e string) bool
- type Closeable
- type EngineFactory
- type Job
- type JobEngine
- type JobIdentity
- type JobImageBuildFromReleasePara
- type JobKind
- type JobLogPart
- type JobManager
- type JobState
- type JobStepContext
- type JobStepInfo
- type JobStepLog
- type JobStore
- type LogManager
- type ManagerFactory
- type Reloadable
- type Step
- type StepState
- type StoreFactory
Constants ¶
View Source
const ( LogCompleteFlag = "0F80573E-61DA-4C1B-9CDE-396F139D63DD" JobUnrecognized = "unrecognized" )
View Source
const ( DefaultJobTTL = 60 * 60 * 24 * 7 FlushChannelSize = 200 EventMapSize = 10000 )
View Source
const ( DefaultJobLogTTL = 60 * 60 * 24 * 7 JobStepID = "%s/%s" JobLogReadSize = 8 * 1024 JobChannelSize = 100 JobLogStoreInterval = 10 )
Variables ¶
This section is empty.
Functions ¶
func StringContain ¶
Types ¶
type EngineFactory ¶
type Job ¶
type Job struct { JobIdentity UserID string `json:"userID"` Spec map[string]interface{} `json:"spec"` Engine string `json:"engine"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` State JobState `json:"state"` Steps []Step `json:"steps"` Detail string `json:"detail"` Version int32 `json:"version"` }
type JobEngine ¶
type JobEngine interface { Closeable Reloadable Initialize() error GetName() string GetSupportedJobs() []string CreateJob(ctx context.Context, job *Job) error GetJobStatus(ctx context.Context, job Job) (*Job, error) DeleteJob(ctx context.Context, jobID JobIdentity) error StartLoop() error GetJobEventChannel() <-chan JobIdentity FetchJobStepLog(ctx context.Context, jobID JobIdentity, stepName string) (io.ReadCloser, error) }
type JobIdentity ¶
type JobLogPart ¶
type JobManager ¶
type JobManager interface { Closeable Reloadable GetName() string CreateJob(ctx context.Context, j *Job, kind string) error AcceptableJob(ctx context.Context, j Job) string DeleteJob(ctx context.Context, jobID JobIdentity) error GetJob(ctx context.Context, jobID JobIdentity) (Job, error) BatchGetJobs(ctx context.Context, jobID JobIdentity, IDs []string) ([]Job, error) StartLoop() error RegisterJobChangeNotifyChannel(ch chan<- Job) }
func NewJobManagerImpl ¶
func NewJobManagerImpl(engine JobEngine, store JobStore, config appconfig.JobManager, logger *zap.Logger) (JobManager, error)
type JobStepContext ¶
type JobStepContext struct {
// contains filtered or unexported fields
}
type JobStepInfo ¶
type JobStepLog ¶
type JobStepLog struct { JobIdentity StepID string LogTime time.Time Data []byte }
type JobStore ¶
type JobStore interface { Closeable Reloadable Initialize() error GetName() string CreateJob(ctx context.Context, job *Job, ttl int64) error UpdateJobStatus(ctx context.Context, job *Job, version int32) error GetJob(ctx context.Context, jobID JobIdentity) (Job, error) BatchGetJobs(ctx context.Context, jobID JobIdentity, IDs []string) ([]Job, error) DeleteJob(ctx context.Context, jobID JobIdentity) error DeleteJobLog(ctx context.Context, jobID JobIdentity) error InsertJobStepLog(ctx context.Context, log *JobStepLog, ttl int64) error GetJobStepLogs(ctx context.Context, jobID JobIdentity, stepID, startTime string, maxRecord int) (*JobLogPart, error) DeleteJobStepLog(ctx context.Context, log *JobStepLog) error JobStepLogFinished(ctx context.Context, jobID JobIdentity, stepID string) bool }
type LogManager ¶
type LogManager interface { Closeable Reloadable GetName() string StartLoop() error DeleteJob(ctx context.Context, jobID JobIdentity) error GetJobChangeChannel() chan<- Job GetJobStepLogs(ctx context.Context, jobID JobIdentity, stepID string, startTime string, maxRecord int) (*JobLogPart, error) }
func NewLogManagerImpl ¶
func NewLogManagerImpl(engine JobEngine, store JobStore, config appconfig.LogManager, logger *zap.Logger) (LogManager, error)
type ManagerFactory ¶
type ManagerFactory interface { NewJobManager(engine JobEngine, store JobStore, config config.JobManager, logger *zap.Logger) (JobManager, error) NewLogManager(engine JobEngine, store JobStore, config config.LogManager, logger *zap.Logger) (LogManager, error) }
func NewFactory ¶
func NewFactory() (ManagerFactory, error)
type Reloadable ¶
type Reloadable interface { Reload() GetReloadDirs() []string }
type StoreFactory ¶
Click to show internal directories.
Click to hide internal directories.