Documentation ¶
Index ¶
- func GetSSHInfo(client *gqlclient.Client, ctx context.Context, id int32) (job *Job, version *Version, err error)
- type AccessKind
- type AccessScope
- type Artifact
- type Binary
- type Cursor
- type EmailTrigger
- type EmailTriggerInput
- type Entity
- type EntityValue
- type File
- type Job
- func Artifacts(client *gqlclient.Client, ctx context.Context, id int32) (job *Job, err error)
- func Cancel(client *gqlclient.Client, ctx context.Context, jobId int32) (cancel *Job, err error)
- func ExportJob(client *gqlclient.Client, ctx context.Context, id int32) (job *Job, err error)
- func Manifest(client *gqlclient.Client, ctx context.Context, id int32) (job *Job, err error)
- func Monitor(client *gqlclient.Client, ctx context.Context, id int32) (job *Job, err error)
- func Show(client *gqlclient.Client, ctx context.Context, id int32) (job *Job, err error)
- func Submit(client *gqlclient.Client, ctx context.Context, manifest string, tags []string, ...) (submit *Job, err error)
- type JobCursor
- func ExportJobs(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (jobs *JobCursor, err error)
- func JobIDs(client *gqlclient.Client, ctx context.Context) (jobs *JobCursor, err error)
- func Jobs(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (jobs *JobCursor, err error)
- func RunningJobs(client *gqlclient.Client, ctx context.Context) (jobs *JobCursor, err error)
- type JobEvent
- type JobGroup
- type JobStatus
- type Log
- type OAuthClient
- type PGPKey
- type SSHKey
- type Secret
- type SecretCursor
- type SecretFile
- type SecretValue
- type Settings
- type Task
- type TaskStatus
- type Trigger
- type TriggerCondition
- type TriggerInput
- type TriggerType
- type TriggerValue
- type User
- type UserWebhookInput
- type UserWebhookSubscription
- type Version
- type Visibility
- type WebhookDelivery
- type WebhookDeliveryCursor
- type WebhookEvent
- type WebhookPayload
- type WebhookPayloadValue
- type WebhookSubscription
- type WebhookSubscriptionCursor
- type WebhookSubscriptionValue
- type WebhookTrigger
- type WebhookTriggerInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessKind ¶
type AccessKind string
const ( AccessKindRo AccessKind = "RO" AccessKindRw AccessKind = "RW" )
type AccessScope ¶
type AccessScope string
const ( AccessScopeProfile AccessScope = "PROFILE" AccessScopeJobs AccessScope = "JOBS" AccessScopeLogs AccessScope = "LOGS" AccessScopeSecrets AccessScope = "SECRETS" )
type EmailTrigger ¶
type EmailTrigger struct { Condition TriggerCondition `json:"condition"` To string `json:"to"` Cc *string `json:"cc,omitempty"` InReplyTo *string `json:"inReplyTo,omitempty"` }
type EmailTriggerInput ¶
type Entity ¶
type Entity struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` Updated gqlclient.Time `json:"updated"` // The canonical name of this entity. For users, this is their username // prefixed with '~'. Additional entity types will be supported in the future. CanonicalName string `json:"canonicalName"` // Underlying value of the GraphQL interface Value EntityValue `json:"-"` }
func (*Entity) UnmarshalJSON ¶ added in v0.4.0
type EntityValue ¶ added in v0.4.0
type EntityValue interface {
// contains filtered or unexported methods
}
EntityValue is one of: User
type Job ¶
type Job struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` Updated gqlclient.Time `json:"updated"` Status JobStatus `json:"status"` Manifest string `json:"manifest"` Note *string `json:"note,omitempty"` Tags []string `json:"tags"` Visibility Visibility `json:"visibility"` // Name of the build image Image string `json:"image"` // Name of the build runner which picked up this job, or null if the job is // pending or queued. Runner *string `json:"runner,omitempty"` Owner *Entity `json:"owner"` Group *JobGroup `json:"group,omitempty"` Tasks []Task `json:"tasks"` Artifacts []Artifact `json:"artifacts"` // The job's top-level log file, not associated with any tasks Log *Log `json:"log,omitempty"` // List of secrets available to this job, or null if they were disabled Secrets []Secret `json:"secrets,omitempty"` }
type JobCursor ¶
A cursor for enumerating a list of jobs
If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.
func ExportJobs ¶ added in v0.2.0
type JobEvent ¶ added in v0.3.0
type JobEvent struct { Uuid string `json:"uuid"` Event WebhookEvent `json:"event"` Date gqlclient.Time `json:"date"` Job *Job `json:"job"` }
type OAuthClient ¶ added in v0.3.0
type OAuthClient struct {
Uuid string `json:"uuid"`
}
type Secret ¶
type Secret struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` Uuid string `json:"uuid"` Name *string `json:"name,omitempty"` // Set when this secret was copied from another user account FromUser *Entity `json:"fromUser,omitempty"` // Underlying value of the GraphQL interface Value SecretValue `json:"-"` }
func ShareSecret ¶ added in v0.4.0
func (*Secret) UnmarshalJSON ¶ added in v0.4.0
type SecretCursor ¶
type SecretCursor struct { Results []Secret `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating a list of secrets
If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.
func CompleteSecrets ¶ added in v0.4.0
type SecretFile ¶
type SecretValue ¶ added in v0.4.0
type SecretValue interface {
// contains filtered or unexported methods
}
SecretValue is one of: SSHKey | PGPKey | SecretFile
type TaskStatus ¶
type TaskStatus string
const ( TaskStatusPending TaskStatus = "PENDING" TaskStatusRunning TaskStatus = "RUNNING" TaskStatusSuccess TaskStatus = "SUCCESS" TaskStatusFailed TaskStatus = "FAILED" TaskStatusSkipped TaskStatus = "SKIPPED" )
func (TaskStatus) Icon ¶
func (status TaskStatus) Icon() string
func (TaskStatus) TermIcon ¶
func (status TaskStatus) TermIcon() string
func (TaskStatus) TermStyle ¶
func (status TaskStatus) TermStyle() termfmt.Style
type Trigger ¶
type Trigger struct { Condition TriggerCondition `json:"condition"` // Underlying value of the GraphQL interface Value TriggerValue `json:"-"` }
Triggers run upon the completion of all of the jobs in a job group. Note that these triggers are distinct from the ones defined by an individual job's build manifest, but are similar in functionality.
func (*Trigger) UnmarshalJSON ¶ added in v0.4.0
type TriggerCondition ¶
type TriggerCondition string
const ( TriggerConditionSuccess TriggerCondition = "SUCCESS" TriggerConditionFailure TriggerCondition = "FAILURE" TriggerConditionAlways TriggerCondition = "ALWAYS" )
type TriggerInput ¶
type TriggerInput struct { Type TriggerType `json:"type"` Condition TriggerCondition `json:"condition"` Email *EmailTriggerInput `json:"email,omitempty"` Webhook *WebhookTriggerInput `json:"webhook,omitempty"` }
type TriggerType ¶
type TriggerType string
const ( TriggerTypeEmail TriggerType = "EMAIL" TriggerTypeWebhook TriggerType = "WEBHOOK" )
type TriggerValue ¶ added in v0.4.0
type TriggerValue interface {
// contains filtered or unexported methods
}
TriggerValue is one of: EmailTrigger | WebhookTrigger
type User ¶
type User struct { Id int32 `json:"id"` Created gqlclient.Time `json:"created"` Updated gqlclient.Time `json:"updated"` CanonicalName string `json:"canonicalName"` Username string `json:"username"` Email string `json:"email"` Url *string `json:"url,omitempty"` Location *string `json:"location,omitempty"` Bio *string `json:"bio,omitempty"` // Jobs submitted by this user. Jobs *JobCursor `json:"jobs"` }
type UserWebhookInput ¶ added in v0.3.0
type UserWebhookInput struct { Url string `json:"url"` Events []WebhookEvent `json:"events"` Query string `json:"query"` }
type UserWebhookSubscription ¶ added in v0.3.0
type UserWebhookSubscription struct { Id int32 `json:"id"` Events []WebhookEvent `json:"events"` Query string `json:"query"` Url string `json:"url"` Client *OAuthClient `json:"client,omitempty"` Deliveries *WebhookDeliveryCursor `json:"deliveries"` Sample string `json:"sample"` }
type Version ¶
type Version struct { Major int32 `json:"major"` Minor int32 `json:"minor"` Patch int32 `json:"patch"` // If this API version is scheduled for deprecation, this is the date on which // it will stop working; or null if this API version is not scheduled for // deprecation. DeprecationDate gqlclient.Time `json:"deprecationDate,omitempty"` Settings *Settings `json:"settings"` }
type Visibility ¶ added in v0.4.0
type Visibility string
const ( VisibilityPublic Visibility = "PUBLIC" VisibilityUnlisted Visibility = "UNLISTED" VisibilityPrivate Visibility = "PRIVATE" )
func ParseVisibility ¶ added in v0.4.0
func ParseVisibility(s string) (Visibility, error)
type WebhookDelivery ¶ added in v0.3.0
type WebhookDelivery struct { Uuid string `json:"uuid"` Date gqlclient.Time `json:"date"` Event WebhookEvent `json:"event"` Subscription *WebhookSubscription `json:"subscription"` RequestBody string `json:"requestBody"` // These details are provided only after a response is received from the // remote server. If a response is sent whose Content-Type is not text/*, or // cannot be decoded as UTF-8, the response body will be null. It will be // truncated after 64 KiB. ResponseBody *string `json:"responseBody,omitempty"` ResponseHeaders *string `json:"responseHeaders,omitempty"` ResponseStatus *int32 `json:"responseStatus,omitempty"` }
type WebhookDeliveryCursor ¶ added in v0.3.0
type WebhookDeliveryCursor struct { Results []WebhookDelivery `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating a list of webhook deliveries
If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.
type WebhookEvent ¶ added in v0.3.0
type WebhookEvent string
const (
WebhookEventJobCreated WebhookEvent = "JOB_CREATED"
)
func ParseUserEvents ¶ added in v0.3.0
func ParseUserEvents(events []string) ([]WebhookEvent, error)
type WebhookPayload ¶ added in v0.3.0
type WebhookPayload struct { Uuid string `json:"uuid"` Event WebhookEvent `json:"event"` Date gqlclient.Time `json:"date"` // Underlying value of the GraphQL interface Value WebhookPayloadValue `json:"-"` }
func (*WebhookPayload) UnmarshalJSON ¶ added in v0.4.0
func (base *WebhookPayload) UnmarshalJSON(b []byte) error
type WebhookPayloadValue ¶ added in v0.4.0
type WebhookPayloadValue interface {
// contains filtered or unexported methods
}
WebhookPayloadValue is one of: JobEvent
type WebhookSubscription ¶ added in v0.3.0
type WebhookSubscription struct { Id int32 `json:"id"` Events []WebhookEvent `json:"events"` Query string `json:"query"` Url string `json:"url"` // If this webhook was registered by an authorized OAuth 2.0 client, this // field is non-null. Client *OAuthClient `json:"client,omitempty"` // All deliveries which have been sent to this webhook. Deliveries *WebhookDeliveryCursor `json:"deliveries"` // Returns a sample payload for this subscription, for testing purposes Sample string `json:"sample"` // Underlying value of the GraphQL interface Value WebhookSubscriptionValue `json:"-"` }
func CreateUserWebhook ¶ added in v0.3.0
func CreateUserWebhook(client *gqlclient.Client, ctx context.Context, config UserWebhookInput) (createUserWebhook *WebhookSubscription, err error)
func DeleteUserWebhook ¶ added in v0.3.0
func (*WebhookSubscription) UnmarshalJSON ¶ added in v0.4.0
func (base *WebhookSubscription) UnmarshalJSON(b []byte) error
type WebhookSubscriptionCursor ¶ added in v0.3.0
type WebhookSubscriptionCursor struct { Results []WebhookSubscription `json:"results"` Cursor *Cursor `json:"cursor,omitempty"` }
A cursor for enumerating a list of webhook subscriptions
If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.
func UserWebhooks ¶ added in v0.3.0
type WebhookSubscriptionValue ¶ added in v0.4.0
type WebhookSubscriptionValue interface {
// contains filtered or unexported methods
}
WebhookSubscriptionValue is one of: UserWebhookSubscription
type WebhookTrigger ¶
type WebhookTrigger struct { Condition TriggerCondition `json:"condition"` Url string `json:"url"` }
type WebhookTriggerInput ¶
type WebhookTriggerInput struct {
Url string `json:"url"`
}