Documentation
¶
Index ¶
- func DecodePayload[t TaskPayload](data []byte) (t, error)
- func EncodePayload(payload TaskPayload) ([]byte, error)
- type BMCCommandDonePayload
- type Client
- func (c *Client) DeleteTask(queue, id string) error
- func (c *Client) GetQueues() ([]string, error)
- func (c *Client) GetTaskInfo(queue, id string) (*asynq.TaskInfo, error)
- func (c *Client) List(queue *string) ([]*asynq.TaskInfo, error)
- func (c *Client) NewTask(payload TaskPayload, additionalOpts ...asynq.Option) (*asynq.TaskInfo, error)
- func (c *Client) Ping() error
- type IPDeletePayload
- type MachineAllocationPayload
- type MachineBMCCommandPayload
- type MachineDeletePayload
- type NetworkDeletePayload
- type TaskPayload
- type TaskType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePayload ¶ added in v0.4.0
func DecodePayload[t TaskPayload](data []byte) (t, error)
DecodePayload can be used to decode a task payload using json unmarshal. If an error occurs while decoding, an asynq.SkipRetry error gets wrapped to prevent retry of the task.
func EncodePayload ¶ added in v0.4.0
func EncodePayload(payload TaskPayload) ([]byte, error)
EncodePayload can be used to encode a task payload using json marshal.
Types ¶
type BMCCommandDonePayload ¶
type BMCCommandDonePayload struct {
Error *string `json:"error,omitempty"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DeleteTask ¶
func (*Client) GetTaskInfo ¶
type IPDeletePayload ¶
type IPDeletePayload struct {
AllocationUUID string `json:"allocation_uuid,omitempty"`
IP string `json:"ip,omitempty"`
Project string `json:"project,omitempty"`
}
func (*IPDeletePayload) Type ¶ added in v0.1.8
func (p *IPDeletePayload) Type() TaskType
type MachineAllocationPayload ¶
type MachineAllocationPayload struct {
// UUID of the machine which was allocated and trigger the machine installation
UUID string `json:"uuid,omitempty"`
}
type MachineBMCCommandPayload ¶
type MachineBMCCommandPayload struct {
// UUID of the machine where the command should be executed against
UUID string `json:"uuid,omitempty"`
// Partition where the machine resides
Partition string `json:"partition,omitempty"`
// The actual command
Command string `json:"command,omitempty"`
// CommandID identifies this command unique
CommandID string `json:"command_id"`
}
func (*MachineBMCCommandPayload) Type ¶ added in v0.1.8
func (p *MachineBMCCommandPayload) Type() TaskType
type MachineDeletePayload ¶
type MachineDeletePayload struct {
// UUID of the machine which should be deleted (the machine)
UUID string `json:"uuid"`
// AllocationUUID of the machine allocation which should be deleted
AllocationUUID string `json:"allocation_uuid"`
// MachineIpAllocationUUIDs are the machine ips that belong to machine allocation at the point of deletion
MachineIpAllocationUUIDs []string `json:"machine_ip_allocation_uuids,omitempty"`
// Project is the project on which the machine is allocated
Project string `json:"project"`
// Partition is the partition in which the machine is located
Partition string `json:"partition"`
// RackID is the rack id in which the machine is located
RackID string `json:"rack_id"`
// HeadscaleNodeID is the vpn node id that the firewall was connected with
HeadscaleNodeID *uint64 `json:"headscale_node_id"`
}
func (*MachineDeletePayload) Type ¶ added in v0.1.8
func (p *MachineDeletePayload) Type() TaskType
type NetworkDeletePayload ¶
type NetworkDeletePayload struct {
UUID string `json:"uuid,omitempty"`
}
func (*NetworkDeletePayload) Type ¶ added in v0.1.8
func (p *NetworkDeletePayload) Type() TaskType
type TaskPayload ¶ added in v0.1.8
type TaskPayload interface {
Type() TaskType
}
Click to show internal directories.
Click to hide internal directories.