forked from vieter-v/vieter
doc: added documentation to all functions
This commit is contained in:
parent
5b016df85d
commit
5f7d7c4780
7 changed files with 32 additions and 9 deletions
|
|
@ -5,12 +5,14 @@ import net.http { Method }
|
|||
import response { Response }
|
||||
import time
|
||||
|
||||
// get_build_logs returns all build logs.
|
||||
pub fn (c &Client) get_build_logs() ?Response<[]BuildLog> {
|
||||
data := c.send_request<[]BuildLog>(Method.get, '/api/logs', {}) ?
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
// get_build_logs_for_repo returns all build logs for a given repo.
|
||||
pub fn (c &Client) get_build_logs_for_repo(repo_id int) ?Response<[]BuildLog> {
|
||||
params := {
|
||||
'repo': repo_id.str()
|
||||
|
|
@ -21,18 +23,21 @@ pub fn (c &Client) get_build_logs_for_repo(repo_id int) ?Response<[]BuildLog> {
|
|||
return data
|
||||
}
|
||||
|
||||
// get_build_log returns a specific build log.
|
||||
pub fn (c &Client) get_build_log(id int) ?Response<BuildLog> {
|
||||
data := c.send_request<BuildLog>(Method.get, '/api/logs/$id', {}) ?
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
// get_build_log_content returns the contents of the build log file.
|
||||
pub fn (c &Client) get_build_log_content(id int) ?string {
|
||||
data := c.send_request_raw_response(Method.get, '/api/logs/$id/content', {}, '') ?
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
// add_build_log adds a new build log to the server.
|
||||
pub fn (c &Client) add_build_log(repo_id int, start_time time.Time, end_time time.Time, arch string, exit_code int, content string) ?Response<string> {
|
||||
params := {
|
||||
'repo': repo_id.str()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue