Documentation
¶
Index ¶
- 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) []tchttputil.ServiceProvider
- func Vars(r *http.Request) map[string]string
- func WriteAsJSON(t *testing.T, w http.ResponseWriter, resp interface{})
- type Auth
- type AuthProvider
- type PurgeCache
- type Queue
- func (queue *Queue) CancelTask(taskId string) (*tcqueue.TaskStatusResponse, error)
- func (queue *Queue) ClaimWork(provisionerId, workerType 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) GetLatestArtifact_SignedURL(taskId, name string, duration time.Duration) (*url.URL, 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) 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) GetLatestArtifact_SignedURL(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) 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 ¶
This section is empty.
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) []tchttputil.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, wstClient 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 PurgeCache ¶
type PurgeCache struct { }
func NewPurgeCache ¶
func NewPurgeCache(t *testing.T) *PurgeCache
func (*PurgeCache) PurgeRequests ¶
func (purgeCache *PurgeCache) PurgeRequests(provisionerId, workerType, since string) (*tcpurgecache.OpenPurgeRequestList, error)
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) CancelTask ¶
func (queue *Queue) CancelTask(taskId string) (*tcqueue.TaskStatusResponse, error)
func (*Queue) ClaimWork ¶
func (queue *Queue) ClaimWork(provisionerId, workerType 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) GetLatestArtifact_SignedURL ¶
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) 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) GetLatestArtifact_SignedURL ¶
func (qp *QueueProvider) GetLatestArtifact_SignedURL(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) 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)
Click to show internal directories.
Click to hide internal directories.