Documentation ¶
Index ¶
- Constants
- func JSON(w http.ResponseWriter, resp interface{}, err error)
- func Marshal(req *http.Request, payload interface{})
- func NoBody(w http.ResponseWriter, err error)
- func ReportError(w http.ResponseWriter, err error)
- func ServiceProviders(t *testing.T, baseURL string) []httputil.ServiceProvider
- func Vars(r *http.Request) map[string]string
- func WriteAsJSON(t *testing.T, w http.ResponseWriter, resp interface{})
- type Auth
- type AuthProvider
- type Index
- type IndexProvider
- type Obj
- type Object
- func (object *Object) CreateUpload(name string, payload *tcobject.CreateUploadRequest) (*tcobject.CreateUploadResponse, error)
- func (object *Object) FakeObject(name string, hashes map[string]string)
- func (object *Object) FinishUpload(name string, payload *tcobject.FinishUploadRequest) error
- func (object *Object) StartDownload(name string, payload *tcobject.DownloadObjectRequest) (*tcobject.DownloadObjectResponse, error)
- func (object *Object) StartDownloadCount() int
- func (object *Object) UploadFromFile(projectID string, name string, contentType string, expires time.Time, ...) error
- type ObjectProvider
- type PurgeCache
- type Queue
- func (queue *Queue) Artifact(taskId, runId, name string) (*tcqueue.GetArtifactContentResponse, error)
- func (queue *Queue) CancelTask(taskId string) (*tcqueue.TaskStatusResponse, error)
- func (queue *Queue) ClaimWork(taskQueueId string, payload *tcqueue.ClaimWorkRequest) (*tcqueue.ClaimWorkResponse, error)
- func (queue *Queue) CreateArtifact(taskId, runId, name string, payload *tcqueue.PostArtifactRequest) (*tcqueue.PostArtifactResponse, error)
- func (queue *Queue) CreateTask(taskId string, payload *tcqueue.TaskDefinitionRequest) (*tcqueue.TaskStatusResponse, error)
- func (queue *Queue) DownloadArtifactToBuf(taskId string, runId int64, name string) (buf []byte, contentType string, contentLength int64, err error)
- func (queue *Queue) DownloadArtifactToFile(taskId string, runId int64, name string, filename string) (string, int64, error)
- func (queue *Queue) FakeErrorArtifact(taskId string, runId string, name string, message string, reason string)
- func (queue *Queue) FakeObjectArtifact(taskId string, runId string, name string, contentType string)
- func (queue *Queue) FakeS3Artifact(taskId string, runId string, name string, contentType string)
- func (queue *Queue) FinishArtifact(taskId, runId, name string, payload *tcqueue.FinishArtifactRequest) error
- func (queue *Queue) GetLatestArtifact_SignedURL(taskId, name string, duration time.Duration) (*url.URL, error)
- func (queue *Queue) LatestArtifact(taskId, name string) (*tcqueue.GetArtifactContentResponse, error)
- func (queue *Queue) ListArtifacts(taskId, runId, continuationToken, limit string) (*tcqueue.ListArtifactsResponse, error)
- func (queue *Queue) ReclaimTask(taskId, runId string) (*tcqueue.TaskReclaimResponse, error)
- func (queue *Queue) ReportCompleted(taskId, runId string) (*tcqueue.TaskStatusResponse, error)
- func (queue *Queue) ReportException(taskId, runId string, payload *tcqueue.TaskExceptionRequest) (*tcqueue.TaskStatusResponse, error)
- func (queue *Queue) ReportFailed(taskId, runId string) (*tcqueue.TaskStatusResponse, error)
- func (queue *Queue) Status(taskId string) (*tcqueue.TaskStatusResponse, error)
- func (queue *Queue) Task(taskId string) (*tcqueue.TaskDefinitionResponse, error)
- type QueueProvider
- func (qp *QueueProvider) Artifact(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) CancelTask(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) ClaimWork(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) CreateArtifact(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) CreateTask(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) FinishArtifact(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) GetLatestArtifact_SignedURL(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) LatestArtifact(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) ListArtifacts(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) ReclaimTask(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) RegisterService(r *mux.Router)
- func (qp *QueueProvider) ReportCompleted(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) ReportException(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) ReportFailed(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) Status(w http.ResponseWriter, r *http.Request)
- func (qp *QueueProvider) Task(w http.ResponseWriter, r *http.Request)
- type Secrets
- type SecretsProvider
- func (sp *SecretsProvider) Get(w http.ResponseWriter, r *http.Request)
- func (sp *SecretsProvider) List(w http.ResponseWriter, r *http.Request)
- func (sp *SecretsProvider) Ping(w http.ResponseWriter, r *http.Request)
- func (sp *SecretsProvider) RegisterService(r *mux.Router)
- func (sp *SecretsProvider) Remove(w http.ResponseWriter, r *http.Request)
- func (sp *SecretsProvider) Set(w http.ResponseWriter, r *http.Request)
- type ServiceFactory
- func (sf *ServiceFactory) Auth(creds *tcclient.Credentials, rootURL string) tc.Auth
- func (sf *ServiceFactory) Index(creds *tcclient.Credentials, rootURL string) tc.Index
- func (sf *ServiceFactory) Object(creds *tcclient.Credentials, rootURL string) tc.Object
- func (sf *ServiceFactory) PurgeCache(creds *tcclient.Credentials, rootURL string) tc.PurgeCache
- func (sf *ServiceFactory) Queue(creds *tcclient.Credentials, rootURL string) tc.Queue
- func (sf *ServiceFactory) Secrets(creds *tcclient.Credentials, rootURL string) tc.Secrets
- func (sf *ServiceFactory) WorkerManager(creds *tcclient.Credentials, rootURL string) tc.WorkerManager
- type WorkerManager
- func (wm *WorkerManager) CreateWorkerPool(workerPoolId string, payload *tcworkermanager.WorkerPoolDefinition) (*tcworkermanager.WorkerPoolFullDefinition, error)
- func (wm *WorkerManager) RegisterWorker(payload *tcworkermanager.RegisterWorkerRequest) (*tcworkermanager.RegisterWorkerResponse, error)
- func (wm *WorkerManager) WorkerPool(workerPoolId string) (*tcworkermanager.WorkerPoolFullDefinition, error)
- type WorkerManagerProvider
- func (wp *WorkerManagerProvider) CreateWorkerPool(w http.ResponseWriter, r *http.Request)
- func (wp *WorkerManagerProvider) RegisterService(r *mux.Router)
- func (wp *WorkerManagerProvider) RegisterWorker(w http.ResponseWriter, r *http.Request)
- func (wp *WorkerManagerProvider) WorkerPool(w http.ResponseWriter, r *http.Request)
Constants ¶
const WST_AUDIENCE = "testing"
const WST_SECRET = "sshhh!"
Variables ¶
This section is empty.
Functions ¶
func JSON ¶
func JSON(w http.ResponseWriter, resp interface{}, err error)
func NoBody ¶
func NoBody(w http.ResponseWriter, err error)
func ReportError ¶
func ReportError(w http.ResponseWriter, err error)
func ServiceProviders ¶
func ServiceProviders(t *testing.T, baseURL string) []httputil.ServiceProvider
func WriteAsJSON ¶
func WriteAsJSON(t *testing.T, w http.ResponseWriter, resp interface{})
Types ¶
type Auth ¶
type Auth struct { }
func (*Auth) ExpandScopes ¶
func (auth *Auth) ExpandScopes(payload *tcauth.SetOfScopes) (*tcauth.SetOfScopes, error)
func (*Auth) SentryDSN ¶
func (auth *Auth) SentryDSN(project string) (*tcauth.SentryDSNResponse, error)
func (*Auth) WebsocktunnelToken ¶
func (auth *Auth) WebsocktunnelToken(wstAudience, wstClientId string) (*tcauth.WebsocktunnelTokenResponse, error)
type AuthProvider ¶
type AuthProvider struct {
// contains filtered or unexported fields
}
func NewAuthProvider ¶
func NewAuthProvider(auth tc.Auth) *AuthProvider
func (*AuthProvider) ExpandScopes ¶
func (ap *AuthProvider) ExpandScopes(w http.ResponseWriter, r *http.Request)
func (*AuthProvider) RegisterService ¶
func (ap *AuthProvider) RegisterService(r *mux.Router)
func (*AuthProvider) SentryDSN ¶
func (ap *AuthProvider) SentryDSN(w http.ResponseWriter, r *http.Request)
func (*AuthProvider) WebsocktunnelToken ¶
func (ap *AuthProvider) WebsocktunnelToken(w http.ResponseWriter, r *http.Request)
type IndexProvider ¶
type IndexProvider struct {
// contains filtered or unexported fields
}
func NewIndexProvider ¶
func NewIndexProvider(index tc.Index) *IndexProvider
func (*IndexProvider) FindTask ¶
func (ip *IndexProvider) FindTask(w http.ResponseWriter, r *http.Request)
func (*IndexProvider) RegisterService ¶
func (ip *IndexProvider) RegisterService(r *mux.Router)
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
func (*Object) CreateUpload ¶
func (object *Object) CreateUpload(name string, payload *tcobject.CreateUploadRequest) (*tcobject.CreateUploadResponse, error)
func (*Object) FakeObject ¶
FakeS3Object creates a fake object which is assumed to be stored in mocks3 at an object of the same name. It is up to the caller to create the object in mocks3 if necesary.
func (*Object) FinishUpload ¶
func (object *Object) FinishUpload(name string, payload *tcobject.FinishUploadRequest) error
func (*Object) StartDownload ¶
func (object *Object) StartDownload(name string, payload *tcobject.DownloadObjectRequest) (*tcobject.DownloadObjectResponse, error)
func (*Object) StartDownloadCount ¶
StartDownloadCount returns the number of times StartDownload has been called
type ObjectProvider ¶
type ObjectProvider struct {
// contains filtered or unexported fields
}
func NewObjectProvider ¶
func NewObjectProvider(object tc.Object) *ObjectProvider
func (*ObjectProvider) CreateUpload ¶
func (op *ObjectProvider) CreateUpload(w http.ResponseWriter, r *http.Request)
func (*ObjectProvider) FinishUpload ¶
func (op *ObjectProvider) FinishUpload(w http.ResponseWriter, r *http.Request)
func (*ObjectProvider) RegisterService ¶
func (op *ObjectProvider) RegisterService(r *mux.Router)
func (*ObjectProvider) StartDownload ¶
func (op *ObjectProvider) StartDownload(w http.ResponseWriter, r *http.Request)
type PurgeCache ¶
type PurgeCache struct { }
func NewPurgeCache ¶
func NewPurgeCache(t *testing.T) *PurgeCache
func (*PurgeCache) PurgeRequests ¶
func (purgeCache *PurgeCache) PurgeRequests(workerPoolId, since string) (*tcpurgecache.OpenPurgeRequestList, error)
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) Artifact ¶
func (queue *Queue) Artifact(taskId, runId, name string) (*tcqueue.GetArtifactContentResponse, error)
func (*Queue) CancelTask ¶
func (queue *Queue) CancelTask(taskId string) (*tcqueue.TaskStatusResponse, error)
func (*Queue) ClaimWork ¶
func (queue *Queue) ClaimWork(taskQueueId string, payload *tcqueue.ClaimWorkRequest) (*tcqueue.ClaimWorkResponse, error)
func (*Queue) CreateArtifact ¶
func (queue *Queue) CreateArtifact(taskId, runId, name string, payload *tcqueue.PostArtifactRequest) (*tcqueue.PostArtifactResponse, error)
func (*Queue) CreateTask ¶
func (queue *Queue) CreateTask(taskId string, payload *tcqueue.TaskDefinitionRequest) (*tcqueue.TaskStatusResponse, error)
func (*Queue) DownloadArtifactToBuf ¶
func (*Queue) DownloadArtifactToFile ¶
func (*Queue) FakeErrorArtifact ¶
func (queue *Queue) FakeErrorArtifact(taskId string, runId string, name string, message string, reason string)
FakeErrorArtifact makes a fake artifact with storageType 'object', outside of the usual API flow. It is up to the caller to also create the data in the object service, if necessary
func (*Queue) FakeObjectArtifact ¶
func (queue *Queue) FakeObjectArtifact(taskId string, runId string, name string, contentType string)
FakeObjectArtifact makes a fake artifact with storageType 'object', outside of the usual API flow. It is up to the caller to also create the data in the object service, if necessary
func (*Queue) FakeS3Artifact ¶
FakeS3Artifact makes a fake artifact with storageType 's3', outside of the usual API flow. It is up to the caller to also create the data on mocks3, if necessary
func (*Queue) FinishArtifact ¶
func (queue *Queue) FinishArtifact(taskId, runId, name string, payload *tcqueue.FinishArtifactRequest) error
func (*Queue) GetLatestArtifact_SignedURL ¶
func (*Queue) LatestArtifact ¶
func (queue *Queue) LatestArtifact(taskId, name string) (*tcqueue.GetArtifactContentResponse, error)
func (*Queue) ListArtifacts ¶
func (queue *Queue) ListArtifacts(taskId, runId, continuationToken, limit string) (*tcqueue.ListArtifactsResponse, error)
func (*Queue) ReclaimTask ¶
func (queue *Queue) ReclaimTask(taskId, runId string) (*tcqueue.TaskReclaimResponse, error)
func (*Queue) ReportCompleted ¶
func (queue *Queue) ReportCompleted(taskId, runId string) (*tcqueue.TaskStatusResponse, error)
func (*Queue) ReportException ¶
func (queue *Queue) ReportException(taskId, runId string, payload *tcqueue.TaskExceptionRequest) (*tcqueue.TaskStatusResponse, error)
func (*Queue) ReportFailed ¶
func (queue *Queue) ReportFailed(taskId, runId string) (*tcqueue.TaskStatusResponse, error)
type QueueProvider ¶
type QueueProvider struct {
// contains filtered or unexported fields
}
func NewQueueProvider ¶
func NewQueueProvider(queue tc.Queue) *QueueProvider
func (*QueueProvider) Artifact ¶
func (qp *QueueProvider) Artifact(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) CancelTask ¶
func (qp *QueueProvider) CancelTask(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) ClaimWork ¶
func (qp *QueueProvider) ClaimWork(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) CreateArtifact ¶
func (qp *QueueProvider) CreateArtifact(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) CreateTask ¶
func (qp *QueueProvider) CreateTask(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) FinishArtifact ¶
func (qp *QueueProvider) FinishArtifact(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) GetLatestArtifact_SignedURL ¶
func (qp *QueueProvider) GetLatestArtifact_SignedURL(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) LatestArtifact ¶
func (qp *QueueProvider) LatestArtifact(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) ListArtifacts ¶
func (qp *QueueProvider) ListArtifacts(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) ReclaimTask ¶
func (qp *QueueProvider) ReclaimTask(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) RegisterService ¶
func (qp *QueueProvider) RegisterService(r *mux.Router)
func (*QueueProvider) ReportCompleted ¶
func (qp *QueueProvider) ReportCompleted(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) ReportException ¶
func (qp *QueueProvider) ReportException(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) ReportFailed ¶
func (qp *QueueProvider) ReportFailed(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) Status ¶
func (qp *QueueProvider) Status(w http.ResponseWriter, r *http.Request)
func (*QueueProvider) Task ¶
func (qp *QueueProvider) Task(w http.ResponseWriter, r *http.Request)
type Secrets ¶
type Secrets struct { // map from secret name to secret value Secrets map[string]*tcsecrets.Secret }
func NewSecrets ¶
func NewSecrets() *Secrets
type SecretsProvider ¶
type SecretsProvider struct {
// contains filtered or unexported fields
}
func NewSecretsProvider ¶
func NewSecretsProvider(secrets tc.Secrets) *SecretsProvider
func (*SecretsProvider) Get ¶
func (sp *SecretsProvider) Get(w http.ResponseWriter, r *http.Request)
func (*SecretsProvider) List ¶
func (sp *SecretsProvider) List(w http.ResponseWriter, r *http.Request)
func (*SecretsProvider) Ping ¶
func (sp *SecretsProvider) Ping(w http.ResponseWriter, r *http.Request)
func (*SecretsProvider) RegisterService ¶
func (sp *SecretsProvider) RegisterService(r *mux.Router)
func (*SecretsProvider) Remove ¶
func (sp *SecretsProvider) Remove(w http.ResponseWriter, r *http.Request)
func (*SecretsProvider) Set ¶
func (sp *SecretsProvider) Set(w http.ResponseWriter, r *http.Request)
type ServiceFactory ¶
type ServiceFactory struct {
// contains filtered or unexported fields
}
func NewServiceFactory ¶
func NewServiceFactory(t *testing.T) *ServiceFactory
func (*ServiceFactory) Auth ¶
func (sf *ServiceFactory) Auth(creds *tcclient.Credentials, rootURL string) tc.Auth
func (*ServiceFactory) Index ¶
func (sf *ServiceFactory) Index(creds *tcclient.Credentials, rootURL string) tc.Index
func (*ServiceFactory) Object ¶
func (sf *ServiceFactory) Object(creds *tcclient.Credentials, rootURL string) tc.Object
func (*ServiceFactory) PurgeCache ¶
func (sf *ServiceFactory) PurgeCache(creds *tcclient.Credentials, rootURL string) tc.PurgeCache
func (*ServiceFactory) Queue ¶
func (sf *ServiceFactory) Queue(creds *tcclient.Credentials, rootURL string) tc.Queue
func (*ServiceFactory) Secrets ¶
func (sf *ServiceFactory) Secrets(creds *tcclient.Credentials, rootURL string) tc.Secrets
func (*ServiceFactory) WorkerManager ¶
func (sf *ServiceFactory) WorkerManager(creds *tcclient.Credentials, rootURL string) tc.WorkerManager
type WorkerManager ¶
type WorkerManager struct {
// contains filtered or unexported fields
}
func NewWorkerManager ¶
func NewWorkerManager(t *testing.T) *WorkerManager
func (*WorkerManager) CreateWorkerPool ¶
func (wm *WorkerManager) CreateWorkerPool(workerPoolId string, payload *tcworkermanager.WorkerPoolDefinition) (*tcworkermanager.WorkerPoolFullDefinition, error)
func (*WorkerManager) RegisterWorker ¶
func (wm *WorkerManager) RegisterWorker(payload *tcworkermanager.RegisterWorkerRequest) (*tcworkermanager.RegisterWorkerResponse, error)
func (*WorkerManager) WorkerPool ¶
func (wm *WorkerManager) WorkerPool(workerPoolId string) (*tcworkermanager.WorkerPoolFullDefinition, error)
type WorkerManagerProvider ¶
type WorkerManagerProvider struct {
// contains filtered or unexported fields
}
func NewWorkerManagerProvider ¶
func NewWorkerManagerProvider(workerManager tc.WorkerManager) *WorkerManagerProvider
func (*WorkerManagerProvider) CreateWorkerPool ¶
func (wp *WorkerManagerProvider) CreateWorkerPool(w http.ResponseWriter, r *http.Request)
func (*WorkerManagerProvider) RegisterService ¶
func (wp *WorkerManagerProvider) RegisterService(r *mux.Router)
func (*WorkerManagerProvider) RegisterWorker ¶
func (wp *WorkerManagerProvider) RegisterWorker(w http.ResponseWriter, r *http.Request)
func (*WorkerManagerProvider) WorkerPool ¶
func (wp *WorkerManagerProvider) WorkerPool(w http.ResponseWriter, r *http.Request)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
The interfaces in this package contain the methods of each taskcluster service, allowing the use of fakes that provide the same methods.
|
The interfaces in this package contain the methods of each taskcluster service, allowing the use of fakes that provide the same methods. |