Documentation ¶
Index ¶
- func AggregateLogs(db *sql.DB) (int, error)
- func CompareUserWithJobUser(user auth.User, jobUser JSONB) (bool, error)
- func FailExpiredJobs(db *sql.DB) (affectedJobs int64, err error)
- func FailQueuedJobs(db *sql.DB) (affectedJobs int64, err error)
- func IsConcurrencySafe(db Db, messageId string, agentId string) (bool, error)
- func ProcessLogReply(db *sql.DB, reply *arc.Reply, agentId string, concurrencySafe bool) error
- func ProcessRegistration(db *sql.DB, reg *arc.Registration, agentId string, concurrencySafe bool) error
- func ProcessTags(db *sql.DB, authorization *auth.Authorization, agentId string, ...) error
- func PruneJobs(db *sql.DB) (affectedJobs int64, err error)
- func PruneLocks(db Db) (int64, error)
- type Agent
- func (agent *Agent) AddTagAuthorized(db Db, authorization *auth.Authorization, tagKey string, tagValue string) error
- func (agent *Agent) DeleteAuthorized(db Db, authorization *auth.Authorization) error
- func (agent *Agent) DeleteTagAuthorized(db Db, authorization *auth.Authorization, tagKey string) error
- func (agent *Agent) Example()
- func (agent *Agent) FromRegistration(reg *arc.Registration, agentId string) error
- func (agent *Agent) Get(db Db) error
- func (agent *Agent) GetAuthorizedAndShowFacts(db Db, authorization *auth.Authorization, showFacts []string) error
- func (agent *Agent) Save(db Db) error
- func (agent *Agent) Update(db Db) error
- type Agents
- type Db
- type FilterError
- type JSONB
- type Job
- func (job *Job) CustomExecuteScriptExample(status arc.JobState, createdAt time.Time, timeout int)
- func (job *Job) ExecuteScriptExample()
- func (job *Job) Get(db *sql.DB) error
- func (job *Job) GetAuthorized(db *sql.DB, authorization *auth.Authorization) error
- func (job *Job) RpcVersionExample()
- func (job *Job) Save(db *sql.DB) error
- func (job *Job) Update(db *sql.DB) (err error)
- type JobBadRequestError
- type JobID
- type JobTargetAgentNotFoundError
- type Jobs
- type Lock
- type Log
- type LogPart
- type Registration
- type RegistrationExistsError
- type Reply
- type ReplyExistsError
- type Request
- type Status
- type TagError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateLogs ¶
aggregate log parts with final state which are older then 5 min or log parts older then 1 day
func CompareUserWithJobUser ¶
func FailExpiredJobs ¶
fail jobs which the timeout + 60 sec has exceeded and still in queued or executing status
func FailQueuedJobs ¶
fail jobs which no heartbeat was send back after created_at + 60 sec
func IsConcurrencySafe ¶
func ProcessLogReply ¶
func ProcessRegistration ¶
func ProcessTags ¶
func PruneLocks ¶
Types ¶
type Agent ¶
type Agent struct { DisplayName string `json:"display_name"` AgentID string `json:"agent_id"` Project string `json:"project"` Organization string `json:"organization"` Facts JSONB `json:"facts,omitempty"` Tags JSONB `json:"tags,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` UpdatedWith string `json:"updated_with"` UpdatedBy string `json:"updated_by"` }
func (*Agent) AddTagAuthorized ¶
func (*Agent) DeleteAuthorized ¶
func (agent *Agent) DeleteAuthorized(db Db, authorization *auth.Authorization) error
func (*Agent) DeleteTagAuthorized ¶
func (*Agent) FromRegistration ¶
func (agent *Agent) FromRegistration(reg *arc.Registration, agentId string) error
func (*Agent) GetAuthorizedAndShowFacts ¶
type Agents ¶
type Agents []Agent
func (*Agents) CreateAndSaveAgentExamples ¶
func (*Agents) GetAuthorizedAndShowFacts ¶
func (agents *Agents) GetAuthorizedAndShowFacts(db *sql.DB, filterQuery string, authorization *auth.Authorization, showFacts []string, pag *pagination.Pagination) error
type FilterError ¶
type FilterError struct {
Msg string
}
func (FilterError) Error ¶
func (e FilterError) Error() string
type Job ¶
type Job struct { arc.Request Status arc.JobState `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Project string `json:"project"` User JSONB `json:"user"` }
func CreateJobAuthorized ¶
func (*Job) CustomExecuteScriptExample ¶
func (*Job) ExecuteScriptExample ¶
func (job *Job) ExecuteScriptExample()
func (*Job) GetAuthorized ¶
func (*Job) RpcVersionExample ¶
func (job *Job) RpcVersionExample()
type JobBadRequestError ¶
type JobBadRequestError struct {
Msg string
}
func (JobBadRequestError) Error ¶
func (e JobBadRequestError) Error() string
type JobTargetAgentNotFoundError ¶
type JobTargetAgentNotFoundError struct {
Msg string
}
func (JobTargetAgentNotFoundError) Error ¶
func (e JobTargetAgentNotFoundError) Error() string
type Jobs ¶
type Jobs []Job
func (*Jobs) CreateAndSaveRpcVersionExamples ¶
func (*Jobs) GetAuthorized ¶
func (jobs *Jobs) GetAuthorized(db *sql.DB, authorization *auth.Authorization, agentId string, pag *pagination.Pagination) error
type Lock ¶
type Log ¶
type Log struct { JobID string `json:"job_id"` Content string `json:"content"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func (*Log) GetOrCollectAuthorized ¶
type LogPart ¶
type Registration ¶
type Registration struct {
arc.Registration
}
func (*Registration) Example ¶
func (reg *Registration) Example()
type RegistrationExistsError ¶
type RegistrationExistsError struct {
Msg string
}
func (RegistrationExistsError) Error ¶
func (e RegistrationExistsError) Error() string
type ReplyExistsError ¶
type ReplyExistsError struct {
Msg string
}
func (ReplyExistsError) Error ¶
func (e ReplyExistsError) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.