Skip to content

client #

fn new #

pub fn new(address string, api_key string) Client

new creates a new Client instance.

struct Client #

pub struct Client {
pub:
	address string
	api_key string
}

fn (Client) add_build_log #

pub fn (c &Client) add_build_log(target_id int, start_time time.Time, end_time time.Time, arch string, exit_code int, content string) !Response[int]

add_build_log adds a new build log to the server.

fn (Client) add_target #

pub fn (c &Client) add_target(t NewTarget) !int

add_target adds a new target to the server.

fn (Client) get_all_targets #

pub fn (c &Client) get_all_targets() ![]Target

get_all_targets retrieves all targs from the API using the default limit.

fn (Client) get_build_log #

pub fn (c &Client) get_build_log(id int) !BuildLog

get_build_log returns a specific build log.

fn (Client) get_build_log_content #

pub fn (c &Client) get_build_log_content(id int) !string

get_build_log_content returns the contents of the build log file.

fn (Client) get_build_logs #

pub fn (c &Client) get_build_logs(filter BuildLogFilter) ![]BuildLog

get_build_logs returns all build logs.

fn (Client) get_target #

pub fn (c &Client) get_target(id int) !Target

get_target returns the target for a specific id.

fn (Client) get_targets #

pub fn (c &Client) get_targets(filter TargetFilter) ![]Target

get_targets returns a list of targets, given a filter object.

fn (Client) patch_target #

pub fn (c &Client) patch_target(id int, params map[string]string) !string

patch_target sends a PATCH request to the given target with the params as payload.

fn (Client) poll_jobs #

pub fn (c &Client) poll_jobs(arch string, max int) ![]BuildConfig

poll_jobs requests a list of new build jobs from the server.

fn (Client) queue_job #

pub fn (c &Client) queue_job(target_id int, arch string, force bool) !

queue_job adds a new one-time build job for the given target to the job queue.

fn (Client) remove_arch_repo #

pub fn (c &Client) remove_arch_repo(repo string, arch string) !

remove_arch_repo removes an entire arch-repo.

fn (Client) remove_build_log #

pub fn (c &Client) remove_build_log(id int) !

remove_build_log removes the build log with the given id from the server.

fn (Client) remove_package #

pub fn (c &Client) remove_package(repo string, arch string, pkgname string) !

remove_package removes a single package from the given arch-repo.

fn (Client) remove_repo #

pub fn (c &Client) remove_repo(repo string) !

remove_repo removes an entire repository.

fn (Client) remove_target #

pub fn (c &Client) remove_target(id int) !string

remove_target removes the target with the given id from the server.

fn (Client) send_request #

fn (c &Client) send_request[T](method Method, url string, params map[string]string) !Response[T]

send_request<T> just calls send_request_with_body<T> with an empty body.

fn (Client) send_request_raw #

fn (c &Client) send_request_raw(method Method, url string, params map[string]string, body string) !http.Response

send_request_raw sends an HTTP request, returning the http.Response object.
It encodes the params so that they're safe to pass as HTTP query parameters.

fn (Client) send_request_raw_response #

fn (c &Client) send_request_raw_response(method Method, url string, params map[string]string, body string) !string

send_request_raw_response returns the raw text response for an HTTP request.

fn (Client) send_request_with_body #

fn (c &Client) send_request_with_body[T](method Method, url string, params map[string]string, body string) !Response[T]

send_request_with_body<T> calls send_request_raw_response & parses its output as a Response<T> object.

struct NewTarget #

pub struct NewTarget {
	kind   string
	url    string
	branch string
	repo   string
	path   string
	arch   []string
}