Documentation
¶
Index ¶
- Constants
- func HashConfig(config string) string
- func NewRouter(c *core.Core, redisClient *redis.Client, callbackHandler CallbackHandler, ...) *mux.Router
- type BuildInfo
- type CallbackHandler
- type CallbackHandlerResult
- type CheckRequest
- type CheckResponse
- type CheckResult
- type ConfigSuccessHandler
- type Handler
- type HealthResponse
- type Job
- type JobStatus
- type MessageResponse
- type ScanRequest
- type ScanResponse
- type TaskData
- type VersionInfo
- type WorkerPoolStatus
Constants ¶
View Source
const REDIS_SET_DURATION = 30 * time.Minute
Variables ¶
This section is empty.
Functions ¶
func HashConfig ¶
func NewRouter ¶
func NewRouter(c *core.Core, redisClient *redis.Client, callbackHandler CallbackHandler, configSuccessHandler ConfigSuccessHandler, logger *zap.Logger, updater *github.Updater, worker *workerpool.WorkerPool, versionInfo VersionInfo, redisResultExpiration time.Duration, refreshInterval time.Duration) *mux.Router
Types ¶
type CallbackHandler ¶
type CallbackHandler func(CallbackHandlerResult)
type CallbackHandlerResult ¶
type CallbackHandlerResult struct { JobID string Results []core.CheckResult Error error }
type CheckRequest ¶
type CheckRequest struct {
Configs []string `json:"configs"`
}
type CheckResponse ¶
type CheckResponse struct {
Results []CheckResult `json:"results"`
}
type CheckResult ¶
type ConfigSuccessHandler ¶
type ConfigSuccessHandler func(core.CheckResult)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(c *core.Core, redisClient *redis.Client, callbackHandler CallbackHandler, configSuccessHandler ConfigSuccessHandler, logger *zap.Logger, updater *github.Updater, worker *workerpool.WorkerPool, versionInfo VersionInfo, redisResultExpiration time.Duration, refreshInterval time.Duration) *Handler
type HealthResponse ¶
type HealthResponse struct { Status string `json:"status"` Version string `json:"version"` Build BuildInfo `json:"build"` WorkerPool WorkerPoolStatus `json:"worker_pool"` }
type Job ¶
type Job struct { ID string `json:"id"` Status JobStatus `json:"status"` Configs []string `json:"-"` Results map[string]CheckResult `json:"results"` TotalCount int `json:"total_count"` DoneCount int `json:"done_count"` StartTime *time.Time `json:"start_time,omitempty"` EndTime *time.Time `json:"end_time,omitempty"` CreatedAt time.Time `json:"created_at"` Error string `json:"error,omitempty"` // contains filtered or unexported fields }
func (*Job) AddResult ¶
func (j *Job) AddResult(configHash string, result CheckResult)
type MessageResponse ¶
type ScanRequest ¶
type ScanRequest struct {
Configs []string `json:"configs"`
}
type ScanResponse ¶
type ScanResponse struct {
JobID string `json:"job_id"`
}
type VersionInfo ¶ added in v1.1.0
type WorkerPoolStatus ¶
Click to show internal directories.
Click to hide internal directories.