client

package
v2.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents the SQL Jobber API client.

func New

func New(o *Opt) *Client

New returns a new instance of Client.

func (*Client) DeleteGroupJob

func (c *Client) DeleteGroupJob(jobID string, purge bool) error

DeleteGroupJob deletes group job and its child jobs.

func (*Client) DeleteJob

func (c *Client) DeleteJob(jobID string, purge bool) error

DeleteJob sends a request to delete a job.

func (*Client) GetGroupStatus

func (c *Client) GetGroupStatus(groupID string) (models.GroupStatusResp, error)

GetGroupStatus fetches the status of a group of job.

func (*Client) GetJobStatus

func (c *Client) GetJobStatus(jobID string) (models.JobStatusResp, error)

GetJobStatus fetches the status of a job.

func (*Client) GetPendingJobs

func (c *Client) GetPendingJobs(queue string) ([]tasqueue.JobMessage, error)

GetPendingJobs fetches the list of pending jobs.

func (*Client) PostJob

func (c *Client) PostJob(j models.JobReq) (models.JobResp, error)

PostJob posts a new job.

func (*Client) PostJobGroup

func (c *Client) PostJobGroup(jobs models.GroupReq) (models.GroupResp, error)

PostJobGroup posts multiple jobs under a group.

type Opt

type Opt struct {
	RootURL    string
	HTTPClient *http.Client
	Logger     *slog.Logger
}

Opt represents the options required to initialize Client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL