Documentation ¶
Index ¶
- Constants
- Variables
- func CheckLogSTH(qc *que.Client, logger *log.Logger, job *que.Job, tx *pgx.Tx) error
- func GetEntries(qc *que.Client, logger *log.Logger, job *que.Job, tx *pgx.Tx) error
- func NewLogMetadata(qc *que.Client, logger *log.Logger, job *que.Job, tx *pgx.Tx) error
- func RefreshMetadataForEntries(qc *que.Client, logger *log.Logger, job *que.Job, tx *pgx.Tx) error
- func UpdateCTLogList(qc *que.Client, logger *log.Logger, job *que.Job, tx *pgx.Tx) error
- type CTLog
- type CheckSTHConf
- type GetEntriesConf
- type Handler
- type JobConfig
- type JobFunc
- type LogMetadataJobArgs
Constants ¶
View Source
const ( // KeyCheckSTH is the name of the job KeyCheckSTH = "cron_check_sth" // InsecurePrefix can be prepended to the "connect_url" field to indicate that TLS verification should be disabled for a particular URL. // This is used from some older logs that appear to still be up, but have issues with their certificates. InsecurePrefix = "insecure-skip-verify-" )
View Source
const ( KeyGetEntries = "get_entries" KeyUpdateMetadata = "update_metadata" MaxToRequest = 1024 MaxToUpdate = 1024 )
View Source
const ( StateActive = 0 StateIgnore = 1 )
View Source
const ( KeyUpdateLogs = "cron_update_logs" KnownLogsURL = "https://www.gstatic.com/ct/log_list/all_logs_list.json" )
View Source
const (
KeyNewLogMetadata = "new_log_metadata"
)
Variables ¶
View Source
var ( ErrImmediateReschedule = errors.New("commit tx, and reschedule ASAP") ErrDoNotReschedule = errors.New("no need to reschedule, we are done") )
Functions ¶
func CheckLogSTH ¶
CheckLogSTH checks for new entries, and schedules a job to fetch them if needed
func GetEntries ¶
func NewLogMetadata ¶
Types ¶
type CheckSTHConf ¶
type CheckSTHConf struct { // URL is used to lookup the record in the monitored_logs table URL string TLDs []string `json:"tlds"` }
CheckSTHConf is stored in the que_jobs table
type GetEntriesConf ¶
type Handler ¶
type Handler struct { PGXConnConfig *pgx.ConnConfig InitSQL string WorkerCount int WorkerMap map[string]*JobConfig OnStart func(qc *que.Client, pgxPool *pgx.ConnPool, logger *log.Logger) error Logger *log.Logger QueueName string }
func (*Handler) WorkForever ¶
type JobConfig ¶
type JobConfig struct { F JobFunc // Debug logging VerboseLogging bool // One will only be called at once Singleton bool // Will be rescheduled upon success Duration time.Duration // contains filtered or unexported fields }
type JobFunc ¶
JobFunc should do a thing. Return either: nil => wrapper will schedule the next cron (if a cron), then commit the tx. ErrImmediateReschedule => wrapper will commit the tx, then try it again immediately. ErrDidNotReschedule => wrapper will rollback the tx, and if a cron, will not reschedule or retry. any other error => wrapper rollback the tx, and allow que to reschedule
type LogMetadataJobArgs ¶
Click to show internal directories.
Click to hide internal directories.