Documentation ¶
Index ¶
- func FastHTTPClient(cfg *config.Job) *http.Client
- func HTTPClient(cfg *config.Job) *http.Client
- type AgentStatus
- type Client
- type Command
- type CommandState
- type CommandType
- type MongoClient
- func (c *MongoClient) AddAgentStatus(stat AgentStatus) error
- func (c *MongoClient) AddWorkloads(workloads []interface{}) error
- func (c *MongoClient) CancelCommand() error
- func (c *MongoClient) ClusterTime() (*primitive.DateTime, error)
- func (c *MongoClient) Disconnect() (err error)
- func (c *MongoClient) DropCollection() error
- func (c *MongoClient) GetAgentWithHeartbeatWithin() (uint64, error)
- func (c *MongoClient) GetCommandWorkloads(command *Command) ([]*Workload, error)
- func (c *MongoClient) GetNewWorkloads() (*Workload, error)
- func (c *MongoClient) GetNextUnFinishedCommand() (*Command, error)
- func (c *MongoClient) InsertMany(data []interface{}) (bool, error)
- func (c *MongoClient) InsertOne(data interface{}) (bool, error)
- func (c *MongoClient) IsMasterAgent(agentId primitive.ObjectID) (bool, error)
- func (c *MongoClient) ReadMany(filter interface{}) (bool, error)
- func (c *MongoClient) ReadOne(filter interface{}) (bool, error)
- func (c *MongoClient) RemoveAgentStatus(stat AgentStatus) error
- func (c *MongoClient) RunJob(job config.Job) error
- func (c *MongoClient) SaveAgentStatus(stat AgentStatus) error
- func (c *MongoClient) SaveCommand(command *Command) error
- func (c *MongoClient) SaveWorkload(workload *Workload) error
- func (c *MongoClient) UpdateOne(filter interface{}, data interface{}) (bool, error)
- type NodeInfo
- type Workload
- type WorkloadState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentStatus ¶
type CommandState ¶
type CommandState int
const ( CommandStateCreated CommandState = iota // created CommandStateRunning // running CommandStateDone // done CommandStateError // error )
func (CommandState) String ¶
func (i CommandState) String() string
type CommandType ¶
type CommandType int
const ( CommandTypeStartWorkload CommandType = iota // start CommandTypeStopWorkload // stop )
func (CommandType) String ¶
func (i CommandType) String() string
type MongoClient ¶
type MongoClient struct {
// contains filtered or unexported fields
}
func NewInternalMongoClient ¶
func NewInternalMongoClient(connectionString string) (*MongoClient, error)
func NewMongoClient ¶
func (*MongoClient) AddAgentStatus ¶
func (c *MongoClient) AddAgentStatus(stat AgentStatus) error
func (*MongoClient) AddWorkloads ¶
func (c *MongoClient) AddWorkloads(workloads []interface{}) error
func (*MongoClient) CancelCommand ¶
func (c *MongoClient) CancelCommand() error
func (*MongoClient) ClusterTime ¶
func (c *MongoClient) ClusterTime() (*primitive.DateTime, error)
func (*MongoClient) Disconnect ¶
func (c *MongoClient) Disconnect() (err error)
func (*MongoClient) DropCollection ¶
func (c *MongoClient) DropCollection() error
func (*MongoClient) GetAgentWithHeartbeatWithin ¶
func (c *MongoClient) GetAgentWithHeartbeatWithin() (uint64, error)
agent
func (*MongoClient) GetCommandWorkloads ¶
func (c *MongoClient) GetCommandWorkloads(command *Command) ([]*Workload, error)
func (*MongoClient) GetNewWorkloads ¶
func (c *MongoClient) GetNewWorkloads() (*Workload, error)
todo: temp change to stream for commands
func (*MongoClient) GetNextUnFinishedCommand ¶
func (c *MongoClient) GetNextUnFinishedCommand() (*Command, error)
func (*MongoClient) InsertMany ¶
func (c *MongoClient) InsertMany(data []interface{}) (bool, error)
func (*MongoClient) InsertOne ¶
func (c *MongoClient) InsertOne(data interface{}) (bool, error)
func (*MongoClient) IsMasterAgent ¶
func (c *MongoClient) IsMasterAgent(agentId primitive.ObjectID) (bool, error)
func (*MongoClient) ReadMany ¶
func (c *MongoClient) ReadMany(filter interface{}) (bool, error)
func (*MongoClient) ReadOne ¶
func (c *MongoClient) ReadOne(filter interface{}) (bool, error)
func (*MongoClient) RemoveAgentStatus ¶
func (c *MongoClient) RemoveAgentStatus(stat AgentStatus) error
func (*MongoClient) SaveAgentStatus ¶
func (c *MongoClient) SaveAgentStatus(stat AgentStatus) error
func (*MongoClient) SaveCommand ¶
func (c *MongoClient) SaveCommand(command *Command) error
func (*MongoClient) SaveWorkload ¶
func (c *MongoClient) SaveWorkload(workload *Workload) error
func (*MongoClient) UpdateOne ¶
func (c *MongoClient) UpdateOne(filter interface{}, data interface{}) (bool, error)
type Workload ¶
type Workload struct { Id primitive.ObjectID `bson:"_id"` CommandId primitive.ObjectID `bson:"command_id"` AgentId primitive.ObjectID `bson:"agent_id"` Data config.Job `bson:"data"` State string `bson:"state"` CreatedAt primitive.DateTime `bson:"created_at"` Version primitive.ObjectID `bson:"version"` }
type WorkloadState ¶
type WorkloadState int
todo: move to different place
const ( WorkloadStateCreated WorkloadState = iota WorkloadStateToRun WorkloadStateRunning WorkloadStateDone WorkloadStateError WorkloadStateToDelete WorkloadStateDeleted )
func (WorkloadState) String ¶
func (i WorkloadState) String() string
Click to show internal directories.
Click to hide internal directories.