Skip to content
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.

Commit

Permalink
Regenerated source
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasfj committed Apr 11, 2018
1 parent 7b384fc commit 52fdce4
Showing 1 changed file with 21 additions and 27 deletions.
48 changes: 21 additions & 27 deletions tcindex/tcindex.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,11 @@
//
// First create an Index object:
//
// myIndex, err := index.New(nil)
// index := tcindex.New(nil)
//
// handling any errors...
//
// if err != nil {
// // handle error...
// }
//
// and then call one or more of myIndex's methods, e.g.:
// and then call one or more of index's methods, e.g.:
//
// data, err := myIndex.FindTask(.....)
// data, err := index.FindTask(.....)
//
// handling any errors...
//
Expand All @@ -131,7 +125,7 @@
// http://references.taskcluster.net/index/v1/api.json together with the input and output schemas it references, downloaded on
// Tue, 10 Apr 2018 at 17:21:00 UTC. The code was generated
// by https://github.com/taskcluster/taskcluster-client-go/blob/master/build.sh.
package index
package tcindex

import (
"net/url"
Expand All @@ -150,12 +144,12 @@ type Index tcclient.Client
// nil to create a client without authentication. The
// returned client is mutable, so returned settings can be altered.
//
// myIndex, err := index.New(nil) // credentials loaded from TASKCLUSTER_* env vars
// index, err := tcindex.New(nil) // client without authentication
// if err != nil {
// // handle malformed credentials...
// }
// myIndex.BaseURL = "http://localhost:1234/api/Index/v1" // alternative API endpoint (production by default)
// data, err := myIndex.FindTask(.....) // for example, call the FindTask(.....) API endpoint (described further down)...
// index.BaseURL = "http://localhost:1234/api/Index/v1" // alternative API endpoint (production by default)
// data, err := index.FindTask(.....) // for example, call the FindTask(.....) API endpoint (described further down)...
// if err != nil {
// // handle errors...
// }
Expand Down Expand Up @@ -188,8 +182,8 @@ func NewFromEnv(credentials *tcclient.Credentials) *Index {
// task exists for the given path, this API end-point will respond with a 404 status.
//
// See https://docs.taskcluster.net/reference/core/index/api-docs#findTask
func (myIndex *Index) FindTask(indexPath string) (*IndexedTaskResponse, error) {
cd := tcclient.Client(*myIndex)
func (index *Index) FindTask(indexPath string) (*IndexedTaskResponse, error) {
cd := tcclient.Client(*index)
responseObject, _, err := (&cd).APICall(nil, "GET", "/task/"+url.QueryEscape(indexPath), new(IndexedTaskResponse), nil)
return responseObject.(*IndexedTaskResponse), err
}
Expand All @@ -203,15 +197,15 @@ func (myIndex *Index) FindTask(indexPath string) (*IndexedTaskResponse, error) {
// object.
//
// See https://docs.taskcluster.net/reference/core/index/api-docs#listNamespaces
func (myIndex *Index) ListNamespaces(namespace, continuationToken, limit string) (*ListNamespacesResponse, error) {
func (index *Index) ListNamespaces(namespace, continuationToken, limit string) (*ListNamespacesResponse, error) {
v := url.Values{}
if continuationToken != "" {
v.Add("continuationToken", continuationToken)
}
if limit != "" {
v.Add("limit", limit)
}
cd := tcclient.Client(*myIndex)
cd := tcclient.Client(*index)
responseObject, _, err := (&cd).APICall(nil, "GET", "/namespaces/"+url.QueryEscape(namespace), new(ListNamespacesResponse), v)
return responseObject.(*ListNamespacesResponse), err
}
Expand All @@ -228,15 +222,15 @@ func (myIndex *Index) ListNamespaces(namespace, continuationToken, limit string)
// services, as that makes little sense.
//
// See https://docs.taskcluster.net/reference/core/index/api-docs#listTasks
func (myIndex *Index) ListTasks(namespace, continuationToken, limit string) (*ListTasksResponse, error) {
func (index *Index) ListTasks(namespace, continuationToken, limit string) (*ListTasksResponse, error) {
v := url.Values{}
if continuationToken != "" {
v.Add("continuationToken", continuationToken)
}
if limit != "" {
v.Add("limit", limit)
}
cd := tcclient.Client(*myIndex)
cd := tcclient.Client(*index)
responseObject, _, err := (&cd).APICall(nil, "GET", "/tasks/"+url.QueryEscape(namespace), new(ListTasksResponse), v)
return responseObject.(*ListTasksResponse), err
}
Expand All @@ -251,8 +245,8 @@ func (myIndex *Index) ListTasks(namespace, continuationToken, limit string) (*Li
// index:insert-task:<namespace>
//
// See https://docs.taskcluster.net/reference/core/index/api-docs#insertTask
func (myIndex *Index) InsertTask(namespace string, payload *InsertTaskRequest) (*IndexedTaskResponse, error) {
cd := tcclient.Client(*myIndex)
func (index *Index) InsertTask(namespace string, payload *InsertTaskRequest) (*IndexedTaskResponse, error) {
cd := tcclient.Client(*index)
responseObject, _, err := (&cd).APICall(payload, "PUT", "/task/"+url.QueryEscape(namespace), new(IndexedTaskResponse), nil)
return responseObject.(*IndexedTaskResponse), err
}
Expand All @@ -277,8 +271,8 @@ func (myIndex *Index) InsertTask(namespace string, payload *InsertTaskRequest) (
// queue:get-artifact:<name>
//
// See https://docs.taskcluster.net/reference/core/index/api-docs#findArtifactFromTask
func (myIndex *Index) FindArtifactFromTask(indexPath, name string) error {
cd := tcclient.Client(*myIndex)
func (index *Index) FindArtifactFromTask(indexPath, name string) error {
cd := tcclient.Client(*index)
_, _, err := (&cd).APICall(nil, "GET", "/task/"+url.QueryEscape(indexPath)+"/artifacts/"+url.QueryEscape(name), nil, nil)
return err
}
Expand All @@ -290,17 +284,17 @@ func (myIndex *Index) FindArtifactFromTask(indexPath, name string) error {
// queue:get-artifact:<name>
//
// See FindArtifactFromTask for more details.
func (myIndex *Index) FindArtifactFromTask_SignedURL(indexPath, name string, duration time.Duration) (*url.URL, error) {
cd := tcclient.Client(*myIndex)
func (index *Index) FindArtifactFromTask_SignedURL(indexPath, name string, duration time.Duration) (*url.URL, error) {
cd := tcclient.Client(*index)
return (&cd).SignedURL("/task/"+url.QueryEscape(indexPath)+"/artifacts/"+url.QueryEscape(name), nil, duration)
}

// Respond without doing anything.
// This endpoint is used to check that the service is up.
//
// See https://docs.taskcluster.net/reference/core/index/api-docs#ping
func (myIndex *Index) Ping() error {
cd := tcclient.Client(*myIndex)
func (index *Index) Ping() error {
cd := tcclient.Client(*index)
_, _, err := (&cd).APICall(nil, "GET", "/ping", nil, nil)
return err
}

0 comments on commit 52fdce4

Please sign in to comment.