Documentation ¶
Index ¶
- Constants
- func Bool(v bool) *bool
- func Int64(v int64) *int64
- func String(v string) *string
- func Uint(v uint) *uint
- type ActiveOption
- type ActiveService
- type Author
- type BetaFeature
- type BetaFeaturesService
- func (bs *BetaFeaturesService) Delete(ctx context.Context, userId uint, id uint) (*BetaFeature, *http.Response, error)
- func (bs *BetaFeaturesService) List(ctx context.Context, userId uint) ([]*BetaFeature, *http.Response, error)
- func (bs *BetaFeaturesService) Update(ctx context.Context, userId uint, id uint, enabled bool) (*BetaFeature, *http.Response, error)
- type BetaMigrationRequest
- type BetaMigrationRequestBody
- type BetaMigrationRequestsOption
- type BetaMigrationRequestsService
- func (bs *BetaMigrationRequestsService) Create(ctx context.Context, userId uint, request *BetaMigrationRequestBody) (*BetaMigrationRequest, *http.Response, error)
- func (bs *BetaMigrationRequestsService) List(ctx context.Context, userId uint, opt *BetaMigrationRequestsOption) ([]*BetaMigrationRequest, *http.Response, error)
- type Branch
- type BranchOption
- type BranchesOption
- type BranchesService
- func (bs *BranchesService) FindByRepoId(ctx context.Context, repoId uint, branchName string, opt *BranchOption) (*Branch, *http.Response, error)
- func (bs *BranchesService) FindByRepoSlug(ctx context.Context, repoSlug string, branchName string, opt *BranchOption) (*Branch, *http.Response, error)
- func (bs *BranchesService) ListByRepoId(ctx context.Context, repoId uint, opt *BranchesOption) ([]*Branch, *http.Response, error)
- func (bs *BranchesService) ListByRepoSlug(ctx context.Context, repoSlug string, opt *BranchesOption) ([]*Branch, *http.Response, error)
- type Broadcast
- type BroadcastsOption
- type BroadcastsService
- type Build
- type BuildOption
- type BuildsByRepoOption
- type BuildsOption
- type BuildsService
- func (bs *BuildsService) Cancel(ctx context.Context, id uint) (*Build, *http.Response, error)
- func (bs *BuildsService) Find(ctx context.Context, id uint, opt *BuildOption) (*Build, *http.Response, error)
- func (bs *BuildsService) List(ctx context.Context, opt *BuildsOption) ([]*Build, *http.Response, error)
- func (bs *BuildsService) ListByRepoId(ctx context.Context, repoId uint, opt *BuildsByRepoOption) ([]*Build, *http.Response, error)
- func (bs *BuildsService) ListByRepoSlug(ctx context.Context, repoSlug string, opt *BuildsByRepoOption) ([]*Build, *http.Response, error)
- func (bs *BuildsService) Restart(ctx context.Context, id uint) (*Build, *http.Response, error)
- type Cache
- type CachesService
- func (cs *CachesService) DeleteByRepoId(ctx context.Context, repoId uint) ([]*Cache, *http.Response, error)
- func (cs *CachesService) DeleteByRepoSlug(ctx context.Context, repoSlug string) ([]*Cache, *http.Response, error)
- func (cs *CachesService) ListByRepoId(ctx context.Context, repoId uint) ([]*Cache, *http.Response, error)
- func (cs *CachesService) ListByRepoSlug(ctx context.Context, repoSlug string) ([]*Cache, *http.Response, error)
- type Client
- type Commit
- type Committer
- type Config
- type Cron
- type CronBody
- type CronOption
- type CronsOption
- type CronsService
- func (cs *CronsService) CreateByRepoId(ctx context.Context, repoId uint, branchName string, cron *CronBody) (*Cron, *http.Response, error)
- func (cs *CronsService) CreateByRepoSlug(ctx context.Context, repoSlug string, branchName string, cron *CronBody) (*Cron, *http.Response, error)
- func (cs *CronsService) Delete(ctx context.Context, id uint) (*http.Response, error)
- func (cs *CronsService) Find(ctx context.Context, id uint, opt *CronOption) (*Cron, *http.Response, error)
- func (cs *CronsService) FindByRepoId(ctx context.Context, repoId uint, branch string, opt *CronOption) (*Cron, *http.Response, error)
- func (cs *CronsService) FindByRepoSlug(ctx context.Context, repoSlug string, branch string, opt *CronOption) (*Cron, *http.Response, error)
- func (cs *CronsService) ListByRepoId(ctx context.Context, repoId uint, opt *CronsOption) ([]*Cron, *http.Response, error)
- func (cs *CronsService) ListByRepoSlug(ctx context.Context, repoSlug string, opt *CronsOption) ([]*Cron, *http.Response, error)
- type EmailSubscriptionsService
- func (es *EmailSubscriptionsService) SubscribeByRepoId(ctx context.Context, repoId uint) (*http.Response, error)
- func (es *EmailSubscriptionsService) SubscribeByRepoSlug(ctx context.Context, repoSlug string) (*http.Response, error)
- func (es *EmailSubscriptionsService) UnsubscribeByRepoId(ctx context.Context, repoId uint) (*http.Response, error)
- func (es *EmailSubscriptionsService) UnsubscribeByRepoSlug(ctx context.Context, repoSlug string) (*http.Response, error)
- type EnvVar
- type EnvVarBody
- type EnvVarsService
- func (es *EnvVarsService) CreateByRepoId(ctx context.Context, repoId uint, envVar *EnvVarBody) (*EnvVar, *http.Response, error)
- func (es *EnvVarsService) CreateByRepoSlug(ctx context.Context, repoSlug string, envVar *EnvVarBody) (*EnvVar, *http.Response, error)
- func (es *EnvVarsService) DeleteByRepoId(ctx context.Context, repoId uint, id string) (*http.Response, error)
- func (es *EnvVarsService) DeleteByRepoSlug(ctx context.Context, repoSlug string, id string) (*http.Response, error)
- func (es *EnvVarsService) FindByRepoId(ctx context.Context, repoId uint, id string) (*EnvVar, *http.Response, error)
- func (es *EnvVarsService) FindByRepoSlug(ctx context.Context, repoSlug string, id string) (*EnvVar, *http.Response, error)
- func (es *EnvVarsService) ListByRepoId(ctx context.Context, repoId uint) ([]*EnvVar, *http.Response, error)
- func (es *EnvVarsService) ListByRepoSlug(ctx context.Context, repoSlug string) ([]*EnvVar, *http.Response, error)
- func (es *EnvVarsService) UpdateByRepoId(ctx context.Context, repoId uint, id string, envVar *EnvVarBody) (*EnvVar, *http.Response, error)
- func (es *EnvVarsService) UpdateByRepoSlug(ctx context.Context, repoSlug string, id string, envVar *EnvVarBody) (*EnvVar, *http.Response, error)
- type ErrorResponse
- type GeneratedKeyPairService
- func (ks *GeneratedKeyPairService) CreateByRepoId(ctx context.Context, repoId uint) (*KeyPair, *http.Response, error)
- func (ks *GeneratedKeyPairService) CreateByRepoSlug(ctx context.Context, repoSlug string) (*KeyPair, *http.Response, error)
- func (ks *GeneratedKeyPairService) FindByRepoId(ctx context.Context, repoId uint) (*KeyPair, *http.Response, error)
- func (ks *GeneratedKeyPairService) FindByRepoSlug(ctx context.Context, repoSlug string) (*KeyPair, *http.Response, error)
- type Installation
- type InstallationOption
- type InstallationsService
- type Job
- type JobOption
- type JobsOption
- type JobsService
- func (js *JobsService) Cancel(ctx context.Context, id uint) (*Job, *http.Response, error)
- func (js *JobsService) Debug(ctx context.Context, id uint) (*Job, *http.Response, error)
- func (js *JobsService) Find(ctx context.Context, id uint, opt *JobOption) (*Job, *http.Response, error)
- func (js *JobsService) List(ctx context.Context, opt *JobsOption) ([]*Job, *http.Response, error)
- func (js *JobsService) ListByBuild(ctx context.Context, buildId uint) ([]*Job, *http.Response, error)
- func (js *JobsService) Restart(ctx context.Context, id uint) (*Job, *http.Response, error)
- type KeyPair
- type KeyPairBody
- type KeyPairService
- func (ks *KeyPairService) CreateByRepoId(ctx context.Context, repoId uint, keyPair *KeyPairBody) (*KeyPair, *http.Response, error)
- func (ks *KeyPairService) CreateByRepoSlug(ctx context.Context, repoSlug string, keyPair *KeyPairBody) (*KeyPair, *http.Response, error)
- func (ks *KeyPairService) DeleteByRepoId(ctx context.Context, repoId uint) (*http.Response, error)
- func (ks *KeyPairService) DeleteByRepoSlug(ctx context.Context, repoSlug string) (*http.Response, error)
- func (ks *KeyPairService) FindByRepoId(ctx context.Context, repoId uint) (*KeyPair, *http.Response, error)
- func (ks *KeyPairService) FindByRepoSlug(ctx context.Context, repoSlug string) (*KeyPair, *http.Response, error)
- func (ks *KeyPairService) UpdateByRepoId(ctx context.Context, repoId uint, keyPair *KeyPairBody) (*KeyPair, *http.Response, error)
- func (ks *KeyPairService) UpdateByRepoSlug(ctx context.Context, repoSlug string, keyPair *KeyPairBody) (*KeyPair, *http.Response, error)
- type LintService
- type Log
- type LogPart
- type LogsService
- type Message
- type MessagesOption
- type MessagesService
- type Metadata
- type Organization
- type OrganizationOption
- type OrganizationsOption
- type OrganizationsService
- type Owner
- type OwnerOption
- type OwnerService
- type Permissions
- type Preference
- type PreferenceBody
- type PreferencesService
- func (ps *PreferencesService) Find(ctx context.Context, name string) (*Preference, *http.Response, error)
- func (ps *PreferencesService) List(ctx context.Context) ([]*Preference, *http.Response, error)
- func (ps *PreferencesService) Update(ctx context.Context, preference *PreferenceBody) (*Preference, *http.Response, error)
- type RepositoriesOption
- type RepositoriesService
- func (rs *RepositoriesService) Activate(ctx context.Context, slug string) (*Repository, *http.Response, error)
- func (rs *RepositoriesService) Deactivate(ctx context.Context, slug string) (*Repository, *http.Response, error)
- func (rs *RepositoriesService) Find(ctx context.Context, slug string, opt *RepositoryOption) (*Repository, *http.Response, error)
- func (rs *RepositoriesService) List(ctx context.Context, opt *RepositoriesOption) ([]*Repository, *http.Response, error)
- func (rs *RepositoriesService) ListByGitHubId(ctx context.Context, id uint, opt *RepositoriesOption) ([]*Repository, *http.Response, error)
- func (rs *RepositoriesService) ListByOwner(ctx context.Context, owner string, opt *RepositoriesOption) ([]*Repository, *http.Response, error)
- func (rs *RepositoriesService) Migrate(ctx context.Context, slug string) (*Repository, *http.Response, error)
- func (rs *RepositoriesService) Star(ctx context.Context, slug string) (*Repository, *http.Response, error)
- func (rs *RepositoriesService) Unstar(ctx context.Context, slug string) (*Repository, *http.Response, error)
- type Repository
- type RepositoryOption
- type Request
- type RequestBody
- type RequestOption
- type RequestsOption
- type RequestsService
- func (rs *RequestsService) CreateByRepoId(ctx context.Context, repoId uint, request *RequestBody) (*Request, *http.Response, error)
- func (rs *RequestsService) CreateByRepoSlug(ctx context.Context, repoSlug string, request *RequestBody) (*Request, *http.Response, error)
- func (rs *RequestsService) FindByRepoId(ctx context.Context, repoId uint, id uint, opt *RequestOption) (*Request, *http.Response, error)
- func (rs *RequestsService) FindByRepoSlug(ctx context.Context, repoSlug string, id uint, opt *RequestOption) (*Request, *http.Response, error)
- func (rs *RequestsService) ListByRepoId(ctx context.Context, repoId uint, opt *RequestsOption) ([]*Request, *http.Response, error)
- func (rs *RequestsService) ListByRepoSlug(ctx context.Context, repoSlug string, opt *RequestsOption) ([]*Request, *http.Response, error)
- type Setting
- type SettingBody
- type SettingsService
- func (ss *SettingsService) FindByRepoId(ctx context.Context, repoId uint, name string) (*Setting, *http.Response, error)
- func (ss *SettingsService) FindByRepoSlug(ctx context.Context, repoSlug string, name string) (*Setting, *http.Response, error)
- func (ss *SettingsService) ListByRepoId(ctx context.Context, repoId uint) ([]*Setting, *http.Response, error)
- func (ss *SettingsService) ListByRepoSlug(ctx context.Context, repoSlug string) ([]*Setting, *http.Response, error)
- func (ss *SettingsService) UpdateByRepoId(ctx context.Context, repoId uint, setting *SettingBody) (*Setting, *http.Response, error)
- func (ss *SettingsService) UpdateByRepoSlug(ctx context.Context, repoSlug string, setting *SettingBody) (*Setting, *http.Response, error)
- type Stage
- type StagesOption
- type StagesService
- type Tag
- type TravisYml
- type User
- type UserOption
- type UserService
- type Warning
Constants ¶
const ( // BuildStateCreated represents the build state `created` BuildStateCreated = "created" // BuildStateReceived represents the build state `received` BuildStateReceived = "received" // BuildStateStarted represents the build state `started` BuildStateStarted = "started" // BuildStatePassed represents the build state `passed` BuildStatePassed = "passed" // BuildStateFailed represents the build state `failed` BuildStateFailed = "failed" // BuildStateErrored represents the build state `errored` BuildStateErrored = "errored" // BuildStateCanceled represents the build state `canceled` BuildStateCanceled = "canceled" )
const ( // BuildEventTypePush represents the build event type `push` BuildEventTypePush = "push" // BuildEventTypePullRequest represents the build event type `pull_request` BuildEventTypePullRequest = "pull_request" )
const ( CronIntervalDaily = "daily" CronIntervalWeekly = "weekly" CronIntervalMonthly = "monthly" )
const ( // JobStatusCreated represents the job state `created` JobStatusCreated = "created" // JobStatusQueued represents the job state `queued` JobStatusQueued = "queued" // JobStatusReceived represents the job state `received` JobStatusReceived = "received" // JobStatusStarted represents the job state `started` JobStatusStarted = "started" // JobStatusCanceled represents the job state `canceled` JobStatusCanceled = "canceled" // JobStatusPassed represents the job state `passed` JobStatusPassed = "passed" )
const ( // BuildsOnlyWithTravisYmlSetting is a setting name for builds_only_with_travis_yml BuildsOnlyWithTravisYmlSetting = "builds_only_with_travis_yml" // BuildPushesSetting is a setting name for build_pushes BuildPushesSetting = "build_pushes" // BuildPullRequestsSetting is a setting name for build_pull_requests BuildPullRequestsSetting = "build_pull_requests" // MaximumNumberOfBuildsSetting is a setting name for maximum_number_of_builds MaximumNumberOfBuildsSetting = "maximum_number_of_builds" // AutoCancelPushesSetting is a setting name for auto_cancel_pushes AutoCancelPushesSetting = "auto_cancel_pushes" // AutoCancelPullRequestsSetting is a setting name for auto_cancel_pull_requests AutoCancelPullRequestsSetting = "auto_cancel_pull_requests" )
const ( ApiOrgUrl = "https://api.travis-ci.org/" ApiComUrl = "https://api.travis-ci.com/" )
Variables ¶
This section is empty.
Functions ¶
func Bool ¶ added in v0.2.0
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func Int64 ¶ added in v0.3.0
Int64 is a helper routine that allocates a new Int64 value to store v and returns a pointer to it.
Types ¶
type ActiveOption ¶ added in v0.2.0
type ActiveOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
ActiveOption specifies the optional parameters for active endpoint
type ActiveService ¶ added in v0.0.2
type ActiveService struct {
// contains filtered or unexported fields
}
ActiveService handles communication with the active endpoints of Travis CI API
func (*ActiveService) FindByGitHubId ¶ added in v0.0.2
func (as *ActiveService) FindByGitHubId(ctx context.Context, githubId uint, opt *ActiveOption) ([]*Build, *http.Response, error)
FindByGitHubId fetches active builds based on the owner's GitHub id
Travis CI API docs: https://developer.travis-ci.com/resource/active#for_owner
func (*ActiveService) FindByOwner ¶ added in v0.0.2
func (as *ActiveService) FindByOwner(ctx context.Context, owner string, opt *ActiveOption) ([]*Build, *http.Response, error)
FindByOwner fetches active builds based on the owner's name
Travis CI API docs: https://developer.travis-ci.com/resource/active#for_owner
type BetaFeature ¶ added in v0.1.0
type BetaFeature struct { // Value uniquely identifying the beta feature Id *uint `json:"id,omitempty"` // The name of the feature Name *string `json:"name,omitempty"` // Longer description of the feature Description *string `json:"description,omitempty"` // Indicates if the user has this feature turned on Enabled *bool `json:"enabled,omitempty"` // Url for users to leave Travis CI feedback on this feature FeedbackUrl *string `json:"feedback_url,omitempty"` *Metadata }
BetaFeature is a standard representation of an individual beta feature
Travis CI API docs: https://developer.travis-ci.com/resource/beta_feature#attributes
type BetaFeaturesService ¶ added in v0.1.0
type BetaFeaturesService struct {
// contains filtered or unexported fields
}
BetaFeaturesService handles communication with the beta feature related methods of the Travis CI API.
func (*BetaFeaturesService) Delete ¶ added in v0.2.0
func (bs *BetaFeaturesService) Delete(ctx context.Context, userId uint, id uint) (*BetaFeature, *http.Response, error)
Delete delete a user's beta feature
Travis CI API docs: https://developer.travis-ci.com/resource/beta_feature#delete
func (*BetaFeaturesService) List ¶ added in v0.1.0
func (bs *BetaFeaturesService) List(ctx context.Context, userId uint) ([]*BetaFeature, *http.Response, error)
List fetches a list of beta features available to a user
Travis CI API docs: https://developer.travis-ci.com/resource/beta_features#find
func (*BetaFeaturesService) Update ¶ added in v0.1.0
func (bs *BetaFeaturesService) Update(ctx context.Context, userId uint, id uint, enabled bool) (*BetaFeature, *http.Response, error)
Update updates a user's beta_feature
Travis CI API docs: https://developer.travis-ci.com/resource/beta_feature#update
type BetaMigrationRequest ¶ added in v0.2.0
type BetaMigrationRequest struct { // The beta_migration_request's id Id *uint `json:"id,omitempty"` // The beta_migration_request's owner_id OwnerId *uint `json:"owner_id,omitempty"` // The beta_migration_request's owner_name OwnerName *string `json:"owner_name,omitempty"` // Longer description of the feature OwnerType *string `json:"owner_type,omitempty"` // The beta_migration_request's accepted_at AcceptedAt *string `json:"accepted_at,omitempty"` // The beta_migration_request's organizations Organizations []*Organization `json:"organizations,omitempty"` *Metadata }
BetaMigrationRequest is a standard representation of an individual beta migration request
Travis CI API docs: https://developer.travis-ci.com/resource/beta_migration_request#attributes
type BetaMigrationRequestBody ¶ added in v0.2.0
type BetaMigrationRequestBody struct { // The beta_migration_request's organizations OrganizationIds []uint `json:"beta_migration_request.organizations"` }
BetaMigrationRequestBody specifies body for creating a beta migration request.
type BetaMigrationRequestsOption ¶ added in v0.2.0
type BetaMigrationRequestsOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
BetaMigrationRequestOption specifies options for finding a beta migration requests.
type BetaMigrationRequestsService ¶ added in v0.2.0
type BetaMigrationRequestsService struct {
// contains filtered or unexported fields
}
BetaMigrationRequestsService handles communication with the beta migration requests related methods of the Travis CI API.
func (*BetaMigrationRequestsService) Create ¶ added in v0.2.0
func (bs *BetaMigrationRequestsService) Create(ctx context.Context, userId uint, request *BetaMigrationRequestBody) (*BetaMigrationRequest, *http.Response, error)
Create creates a beta migration request
Travis CI API docs: https://developer.travis-ci.com/resource/beta_migration_request#create
func (*BetaMigrationRequestsService) List ¶ added in v0.2.0
func (bs *BetaMigrationRequestsService) List(ctx context.Context, userId uint, opt *BetaMigrationRequestsOption) ([]*BetaMigrationRequest, *http.Response, error)
List fetches a list of beta migration requests created by the user
Travis CI API docs: https://developer.travis-ci.com/resource/beta_migration_requests#find
type Branch ¶
type Branch struct { // Name of the git branch Name *string `json:"name,omitempty"` // GitHub Repository Repository *Repository `json:"repository,omitempty"` // Whether or not this is the repository's default branch DefaultBranch *bool `json:"default_branch,omitempty"` // Whether or not the branch still exists on GitHub ExistsOnGithub *bool `json:"exists_on_github,omitempty"` // Last build on the branch LastBuild *Build `json:"last_build,omitempty"` // Last 10 builds on the branch (when `include=branch.recent_builds` is used) RecentBuilds []*Build `json:"recent_builds,omitempty"` *Metadata }
Branch represents a branch of a GitHub repository
Travis CI API docs: https://developer.travis-ci.com/resource/branch#standard-representation
type BranchOption ¶ added in v0.2.0
type BranchOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
BranchOption specifies the optional parameters for branch endpoint
type BranchesOption ¶
type BranchesOption struct { // Whether or not the branch still exists on GitHub ExistsOnGithub bool `url:"exists_on_github,omitempty"` // How many branches to include in the response Limit int `url:"limit,omitempty"` // How many branches to skip before the first entry in the response Offset int `url:"offset,omitempty"` // Attributes to sort branches by SortBy string `url:"sort_by,omitempty"` // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
BranchesOption specifies the optional parameters for branches endpoint
type BranchesService ¶
type BranchesService struct {
// contains filtered or unexported fields
}
BranchesService handles communication with the branch related methods of the Travis CI API.
func (*BranchesService) FindByRepoId ¶
func (bs *BranchesService) FindByRepoId(ctx context.Context, repoId uint, branchName string, opt *BranchOption) (*Branch, *http.Response, error)
FindByRepoId fetches a branch based on the provided repository id and branch name
Travis CI API docs: https://developer.travis-ci.com/resource/branch#find
func (*BranchesService) FindByRepoSlug ¶
func (bs *BranchesService) FindByRepoSlug(ctx context.Context, repoSlug string, branchName string, opt *BranchOption) (*Branch, *http.Response, error)
FindByRepoSlug fetches a branch based on the provided repository slug and branch name
Travis CI API docs: https://developer.travis-ci.com/resource/branch#find
func (*BranchesService) ListByRepoId ¶ added in v0.0.7
func (bs *BranchesService) ListByRepoId(ctx context.Context, repoId uint, opt *BranchesOption) ([]*Branch, *http.Response, error)
ListByRepoId fetches the branches of a given repository id.
Travis CI API docs: https://developer.travis-ci.com/resource/branches#find
func (*BranchesService) ListByRepoSlug ¶ added in v0.0.7
func (bs *BranchesService) ListByRepoSlug(ctx context.Context, repoSlug string, opt *BranchesOption) ([]*Branch, *http.Response, error)
ListByRepoSlug fetches the branches of a given repository slug.
Travis CI API docs: https://developer.travis-ci.com/resource/branches#find
type Broadcast ¶ added in v0.0.9
type Broadcast struct { // Value uniquely identifying the broadcast Id *uint `json:"id,omitempty"` // Message to display to the user Message *string `json:"message,omitempty"` // Broadcast category (used for icon and color) Category *string `json:"category,omitempty"` // Whether or not the broadcast should still be displayed Active *bool `json:"active,omitempty"` // When the broadcast was created CreatedAt *string `json:"created_at,omitempty"` // Either a user, organization or repository, or null for global Recipient interface{} `json:"recipient,omitempty"` *Metadata }
Broadcast is a standard representation of an individual broadcast
Travis CI API docs: https://developer.travis-ci.com/resource/broadcast#standard-representation
type BroadcastsOption ¶ added in v0.0.9
type BroadcastsOption struct { // Filters broadcasts by whether or not the broadcast should still be displayed Active bool `url:"active"` // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
BroadcastsOption specifies the optional parameters for broadcasts endpoint
type BroadcastsService ¶ added in v0.0.9
type BroadcastsService struct {
// contains filtered or unexported fields
}
BroadcastsService handles communication with the broadcasts related methods of the Travis CI API.
func (*BroadcastsService) List ¶ added in v0.0.9
func (bs *BroadcastsService) List(ctx context.Context, opt *BroadcastsOption) ([]*Broadcast, *http.Response, error)
List fetches a list of broadcasts for the current user
Travis CI API docs: https://developer.travis-ci.com/resource/broadcasts#for_current_user
type Build ¶
type Build struct { // Value uniquely identifying the build Id *uint `json:"id,omitempty"` // Incremental number for a repository's builds Number *string `json:"number,omitempty"` // Current state of the build State *string `json:"state,omitempty"` // Wall clock time in seconds Duration *int64 `json:"duration,omitempty"` // Event that triggered the build EventType *string `json:"event_type,omitempty"` // State of the previous build (useful to see if state changed) PreviousState *string `json:"previous_state,omitempty"` // Title of the build's pull request PullRequestTitle *string `json:"pull_request_title,omitempty"` // Number of the build's pull request PullRequestNumber *uint `json:"pull_request_number,omitempty"` // When the build started StartedAt *string `json:"started_at,omitempty"` // When the build finished FinishedAt *string `json:"finished_at,omitempty"` // The last time the build was updated UpdatedAt *string `json:"updated_at,omitempty"` // Whether or not the build is private Private *bool `json:"private,omitempty"` // GitHub repository the build is associated with Repository *Repository `json:"repository,omitempty"` // The branch the build is associated with Branch *Branch `json:"branch,omitempty"` // The build's tag Tag *Tag `json:"tag,omitempty"` // The commit the build is associated with Commit *Commit `json:"commit,omitempty"` // List of jobs that are part of the build's matrix Jobs []*Job `json:"jobs,omitempty"` // The stages of the build Stages []*Stage `json:"stages,omitempty"` // The User or Organization that created the build CreatedBy *Owner `json:"created_by,omitempty"` *Metadata }
Build represents a Travis CI build
Travis CI API docs: https://developer.travis-ci.com/resource/build#standard-representation
type BuildOption ¶ added in v0.2.0
type BuildOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
BuildOption specifies the optional parameters for build endpoint
type BuildsByRepoOption ¶ added in v0.1.4
type BuildsByRepoOption struct { // Filters builds by name of the git branch BranchName []string `url:"branch.name,omitempty,comma"` // The User or Organization that created the build CreatedBy []string `url:"created_by,omitempty,comma"` // Event that triggered the build EventType []string `url:"event_type,omitempty,comma"` // State of the previous build (useful to see if state changed) PreviousState []string `url:"previous_state,omitempty,comma"` // Current state of the build State []string `url:"state,omitempty,comma"` // How many builds to include in the response Limit int `url:"limit,omitempty"` // How many builds to skip before the first entry in the response Offset int `url:"offset,omitempty"` // Attributes to sort builds by SortBy string `url:"sort_by,omitempty"` // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
BuildsByRepoOption specifies the optional parameters for builds endpoint
type BuildsOption ¶
type BuildsOption struct { // How many builds to include in the response Limit int `url:"limit,omitempty"` // How many builds to skip before the first entry in the response Offset int `url:"offset,omitempty"` // Attributes to sort builds by SortBy string `url:"sort_by,omitempty"` // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
BuildsOption specifies the optional parameters for builds endpoint
type BuildsService ¶
type BuildsService struct {
// contains filtered or unexported fields
}
BuildsService handles communication with the builds related methods of the Travis CI API.
func (*BuildsService) Cancel ¶ added in v0.0.7
Cancel cancels a build based on the provided build id
Travis CI API docs: https://developer.travis-ci.com/resource/build#cancel
func (*BuildsService) Find ¶
func (bs *BuildsService) Find(ctx context.Context, id uint, opt *BuildOption) (*Build, *http.Response, error)
Find fetches a build based on the provided build id
Travis CI API docs: https://developer.travis-ci.com/resource/build#find
func (*BuildsService) List ¶ added in v0.0.7
func (bs *BuildsService) List(ctx context.Context, opt *BuildsOption) ([]*Build, *http.Response, error)
List fetches current user's builds based on the provided options
Travis CI API docs: https://developer.travis-ci.com/resource/builds#for_current_user
func (*BuildsService) ListByRepoId ¶ added in v0.0.7
func (bs *BuildsService) ListByRepoId(ctx context.Context, repoId uint, opt *BuildsByRepoOption) ([]*Build, *http.Response, error)
ListByRepoId fetches current user's builds based on the repository id and options
Travis CI API docs: https://developer.travis-ci.com/resource/builds#find
func (*BuildsService) ListByRepoSlug ¶ added in v0.0.7
func (bs *BuildsService) ListByRepoSlug(ctx context.Context, repoSlug string, opt *BuildsByRepoOption) ([]*Build, *http.Response, error)
ListByRepoSlug fetches current user's builds based on the repository slug and options
Travis CI API docs: https://developer.travis-ci.com/resource/builds#find
type Cache ¶ added in v0.0.4
type Cache struct { // The branch the cache belongs to Branch *string `json:"branch,omitempty"` // The string to match against the cache name Match *string `json:"match,omitempty"` *Metadata }
Cache is a standard representation of a cache on Travis CI
Travis CI API docs: https://developer.travis-ci.com/resource/caches#attributes
type CachesService ¶ added in v0.0.4
type CachesService struct {
// contains filtered or unexported fields
}
CachesService handles communication with the caches endpoints of Travis CI API
func (*CachesService) DeleteByRepoId ¶ added in v0.0.4
func (cs *CachesService) DeleteByRepoId(ctx context.Context, repoId uint) ([]*Cache, *http.Response, error)
DeleteByRepoId deletes caches based on the given repository id
Travis CI API docs: https://developer.travis-ci.com/resource/caches#delete
func (*CachesService) DeleteByRepoSlug ¶ added in v0.0.4
func (cs *CachesService) DeleteByRepoSlug(ctx context.Context, repoSlug string) ([]*Cache, *http.Response, error)
DeleteByRepoSlug deletes caches based on the given repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/caches#delete
func (*CachesService) ListByRepoId ¶ added in v0.0.7
func (cs *CachesService) ListByRepoId(ctx context.Context, repoId uint) ([]*Cache, *http.Response, error)
ListByRepoId fetches caches based on the given repository id
Travis CI API docs: https://developer.travis-ci.com/resource/caches#find
func (*CachesService) ListByRepoSlug ¶ added in v0.0.7
func (cs *CachesService) ListByRepoSlug(ctx context.Context, repoSlug string) ([]*Cache, *http.Response, error)
ListByRepoSlug fetches caches based on the given repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/caches#find
type Client ¶
type Client struct { // HTTP client used to communicate with the API HTTPClient *http.Client // Headers to attach to every requests made with the client. // As a default, Headers will be used to provide Travis API authentication // token and other necessary headers. // However these could be updated per-request through a parameters. Headers map[string]string // Base URL for api requests. Defaults to the public Travis API, but // can be set to an alternative endpoint to use with Travis Pro or Enterprise. // BaseURL should always be terminated by a slash. BaseURL *url.URL // User agent used when communicating with the Travis API UserAgent string // Services used to manipulate API entities Active *ActiveService BetaFeatures *BetaFeaturesService BetaMigrationRequests *BetaMigrationRequestsService Branches *BranchesService Broadcasts *BroadcastsService Builds *BuildsService Caches *CachesService Crons *CronsService EmailSubscriptions *EmailSubscriptionsService EnvVars *EnvVarsService GeneratedKeyPair *GeneratedKeyPairService Installations *InstallationsService KeyPair *KeyPairService Jobs *JobsService Lint *LintService Logs *LogsService Messages *MessagesService Organizations *OrganizationsService Owner *OwnerService Preferences *PreferencesService Repositories *RepositoriesService Requests *RequestsService Settings *SettingsService Stages *StagesService User *UserService }
A Client manages communication with the Travis CI API.
func NewClient ¶
NewClient returns a new Travis API client. If travisToken is not provided, the client can be authenticated at any time, using it's Authentication exposed service.
func NewDefaultClient ¶
NewDefaultClient returns a new Travis API client bound to the public travis API. If travisToken is not provided, the client can be authenticated at any time, using it's Authentication exposed service.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
The provided ctx must be non-nil. If it is canceled or times out, ctx.Err() will be returned.
func (*Client) IsAuthenticated ¶
IsAuthenticated indicates if Authorization headers were found in Client.Headers mapping.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(method, urlStr string, body interface{}, headers map[string]string) (*http.Request, error)
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body. If specified, the map provided by headers will be used to udate request headers.
type Commit ¶ added in v0.2.0
type Commit struct { // Value uniquely identifying the commit Id *uint `json:"id,omitempty"` // Checksum the commit has in git and is identified by Sha *string `json:"sha,omitempty"` // Named reference the commit has in git. Ref *string `json:"ref,omitempty"` // Commit message Message *string `json:"message,omitempty"` // URL to the commit's diff on GitHub CompareUrl *string `json:"compare_url,omitempty"` // Commit date from git CommittedAt *string `json:"committed_at,omitempty"` // Committer of the commit Committer *Committer `json:"committer,omitempty"` // Author of the commit Author *Author `json:"author,omitempty"` *Metadata }
Commit is a standard representation of a GitHub commit as seen by Travis CI
Travis CI API docs: https://developer.travis-ci.com/resource/commit#standard-representation
type Committer ¶ added in v0.2.0
type Committer struct { Name string `json:"name,omitempty"` AvatarURL string `json:"avatar_url,omitempty"` }
Committer is a committer of the commit
type Config ¶ added in v0.2.4
type Config struct { Os *string `json:"os,omitempty"` Env *string `json:"env,omitempty"` Rvm *string `json:"rvm,omitempty"` Dist *string `json:"dist,omitempty"` Sudo *bool `json:"sudo,omitempty"` Cache *map[string]bool `json:"cache,omitempty"` Group *string `json:"group,omitempty"` Addons *map[string]string `json:"addons,omitempty"` Script *[]string `json:"script,omitempty"` Result *string `json:".result,omitempty"` Language *string `json:"language,omitempty"` Services *[]string `json:"services,omitempty"` GlobalEnv *string `json:"global_env,omitempty"` BeforeScript *[]string `json:"before_script,omitempty"` BeforeInstall *[]string `json:"before_install,omitempty"` }
Config represents Travis CI job's configuration
type Cron ¶ added in v0.0.4
type Cron struct { // Value uniquely identifying the cron Id *uint `json:"id,omitempty"` // Github repository to which this cron belongs Repository *Repository `json:"repository,omitempty"` // Git branch of repository to which this cron belongs Branch *Branch `json:"branch,omitempty"` // Interval at which the cron will run (can be "daily", "weekly" or "monthly") Interval *string `json:"interval,omitempty"` // Whether a cron build should run if there has been a build on this branch in the last 24 hours DontRunIfRecentBuildExists *bool `json:"dont_run_if_recent_build_exists,omitempty"` // When the cron ran last LastRun *string `json:"last_run,omitempty"` // When the cron is scheduled to run next NextRun *string `json:"next_run,omitempty"` // When the cron was created CreatedAt *string `json:"created_at,omitempty"` // Whether the cron is active or not Active *bool `json:"active,omitempty"` *Metadata }
Cron is a standard representation of an individual cron
Travis CI API docs: https://developer.travis-ci.com/resource/cron#standard-representation
type CronBody ¶ added in v0.0.4
type CronBody struct { // Interval at which the cron will run (can be "daily", "weekly" or "monthly") Interval string `json:"cron.interval,omitempty"` // Whether a cron build should run if there has been a build on this branch in the last 24 hours DontRunIfRecentBuildExists bool `json:"cron.dont_run_if_recent_build_exists"` }
CronBody specifies body for creating cron.
type CronOption ¶ added in v0.2.0
type CronOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
CronOption specifies options for fetching cron.
type CronsOption ¶ added in v0.0.4
type CronsOption struct { // How many crons to include in the response Limit int `url:"limit,omitempty"` // How many crons to skip before the first entry in the response Offset int `url:"offset,omitempty"` // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
CronsOption specifies options for fetching crons.
type CronsService ¶ added in v0.0.4
type CronsService struct {
// contains filtered or unexported fields
}
CronsService handles communication with the crons related methods of the Travis CI API.
func (*CronsService) CreateByRepoId ¶ added in v0.0.7
func (cs *CronsService) CreateByRepoId(ctx context.Context, repoId uint, branchName string, cron *CronBody) (*Cron, *http.Response, error)
CreateByRepoId creates a cron based on the provided repository id and branch name
Travis CI API docs: https://developer.travis-ci.com/resource/cron#create
func (*CronsService) CreateByRepoSlug ¶ added in v0.0.7
func (cs *CronsService) CreateByRepoSlug(ctx context.Context, repoSlug string, branchName string, cron *CronBody) (*Cron, *http.Response, error)
CreateByRepoSlug creates a cron based on the provided repository slug and branch name
Travis CI API docs: https://developer.travis-ci.com/resource/cron#create
func (*CronsService) Delete ¶ added in v0.0.7
Delete deletes a cron based on the provided id
Travis CI API docs: https://developer.travis-ci.com/resource/cron#delete
func (*CronsService) Find ¶ added in v0.0.7
func (cs *CronsService) Find(ctx context.Context, id uint, opt *CronOption) (*Cron, *http.Response, error)
Find fetches a cron based on the provided id
Travis CI API docs: https://developer.travis-ci.com/resource/cron#find
func (*CronsService) FindByRepoId ¶ added in v0.0.4
func (cs *CronsService) FindByRepoId(ctx context.Context, repoId uint, branch string, opt *CronOption) (*Cron, *http.Response, error)
FindByRepoId fetches a cron based on the provided repository id and branch name
Travis CI API docs: https://developer.travis-ci.com/resource/cron#for_branch
func (*CronsService) FindByRepoSlug ¶ added in v0.0.4
func (cs *CronsService) FindByRepoSlug(ctx context.Context, repoSlug string, branch string, opt *CronOption) (*Cron, *http.Response, error)
FindByRepoSlug fetches a cron based on the provided repository slug and branch name
Travis CI API docs: https://developer.travis-ci.com/resource/cron#for_branch
func (*CronsService) ListByRepoId ¶ added in v0.0.7
func (cs *CronsService) ListByRepoId(ctx context.Context, repoId uint, opt *CronsOption) ([]*Cron, *http.Response, error)
ListByRepoId fetches crons based on the provided repository id
Travis CI API docs: https://developer.travis-ci.com/resource/crons#for_repository
func (*CronsService) ListByRepoSlug ¶ added in v0.0.7
func (cs *CronsService) ListByRepoSlug(ctx context.Context, repoSlug string, opt *CronsOption) ([]*Cron, *http.Response, error)
ListByRepoSlug fetches crons based on the provided repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/crons#for_repository
type EmailSubscriptionsService ¶ added in v0.0.7
type EmailSubscriptionsService struct {
// contains filtered or unexported fields
}
EmailSubscriptionService handles communication with the email subscription related methods of the Travis CI API.
func (*EmailSubscriptionsService) SubscribeByRepoId ¶ added in v0.0.7
func (es *EmailSubscriptionsService) SubscribeByRepoId(ctx context.Context, repoId uint) (*http.Response, error)
SubscribeByRepoId enables an email subscription of the repository based on the provided repository id
Travis CI API docs: https://developer.travis-ci.com/resource/email_subscription#resubscribe
func (*EmailSubscriptionsService) SubscribeByRepoSlug ¶ added in v0.0.7
func (es *EmailSubscriptionsService) SubscribeByRepoSlug(ctx context.Context, repoSlug string) (*http.Response, error)
SubscribeByRepoSlug enables an email subscription of the repository based on the provided repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/email_subscription#resubscribe
func (*EmailSubscriptionsService) UnsubscribeByRepoId ¶ added in v0.0.7
func (es *EmailSubscriptionsService) UnsubscribeByRepoId(ctx context.Context, repoId uint) (*http.Response, error)
UnsubscribeByRepoId disables an email subscription of the repository based on the provided repository id
Travis CI API docs: https://developer.travis-ci.com/resource/email_subscription#unsubscribe
func (*EmailSubscriptionsService) UnsubscribeByRepoSlug ¶ added in v0.0.7
func (es *EmailSubscriptionsService) UnsubscribeByRepoSlug(ctx context.Context, repoSlug string) (*http.Response, error)
UnsubscribeByRepoSlug disables an email subscription of the repository based on the provided repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/email_subscription#unsubscribe
type EnvVar ¶ added in v0.0.3
type EnvVar struct { // The environment variable id Id *string `json:"id,omitempty"` // The environment variable name, e.g. FOO Name *string `json:"name,omitempty"` // The environment variable's value, e.g. bar Value *string `json:"value,omitempty"` // Whether this environment variable should be publicly visible or not Public *bool `json:"public,omitempty"` // The env_var's branch. Branch *string `json:"branch,omitempty"` *Metadata }
EnvVar is a standard representation of a environment variable on Travis CI
Travis CI API docs: https://developer.travis-ci.com/resource/env_var#standard-representation
type EnvVarBody ¶ added in v0.0.4
type EnvVarBody struct { // The environment variable name, e.g. FOO Name string `json:"env_var.name,omitempty"` // The environment variable's value, e.g. bar Value string `json:"env_var.value,omitempty"` // Whether this environment variable should be publicly visible or not Public bool `json:"env_var.public"` // The env_var's branch. Branch string `json:"env_var.branch,omitempty"` }
EnvVarBody specifies options for creating and updating env var.
type EnvVarsService ¶ added in v0.0.3
type EnvVarsService struct {
// contains filtered or unexported fields
}
EnvVarsService handles communication with the env vars endpoints of Travis CI API
func (*EnvVarsService) CreateByRepoId ¶ added in v0.0.3
func (es *EnvVarsService) CreateByRepoId(ctx context.Context, repoId uint, envVar *EnvVarBody) (*EnvVar, *http.Response, error)
CreateByRepoId creates environment variable based on the given repository id
Travis CI API docs: https://developer.travis-ci.com/resource/env_vars#create
func (*EnvVarsService) CreateByRepoSlug ¶ added in v0.0.3
func (es *EnvVarsService) CreateByRepoSlug(ctx context.Context, repoSlug string, envVar *EnvVarBody) (*EnvVar, *http.Response, error)
CreateByRepoSlug creates environment variable based on the given repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/env_vars#create
func (*EnvVarsService) DeleteByRepoId ¶ added in v0.0.7
func (es *EnvVarsService) DeleteByRepoId(ctx context.Context, repoId uint, id string) (*http.Response, error)
DeleteByRepoId deletes environment variable based on the given repository id and the env var id
Travis CI API docs: https://developer.travis-ci.com/resource/env_var#delete
func (*EnvVarsService) DeleteByRepoSlug ¶ added in v0.0.7
func (es *EnvVarsService) DeleteByRepoSlug(ctx context.Context, repoSlug string, id string) (*http.Response, error)
DeleteByRepoSlug deletes environment variable based on the given repository slug and the env var id
Travis CI API docs: https://developer.travis-ci.com/resource/env_var#delete
func (*EnvVarsService) FindByRepoId ¶ added in v0.0.3
func (es *EnvVarsService) FindByRepoId(ctx context.Context, repoId uint, id string) (*EnvVar, *http.Response, error)
FindByRepoId fetches environment variable based on the given repository id and env var id
Travis CI API docs: https://developer.travis-ci.com/resource/env_var#find
func (*EnvVarsService) FindByRepoSlug ¶ added in v0.0.3
func (es *EnvVarsService) FindByRepoSlug(ctx context.Context, repoSlug string, id string) (*EnvVar, *http.Response, error)
FindByRepoSlug fetches environment variable based on the given repository slug and env var id
Travis CI API docs: https://developer.travis-ci.com/resource/env_var#find
func (*EnvVarsService) ListByRepoId ¶ added in v0.0.7
func (es *EnvVarsService) ListByRepoId(ctx context.Context, repoId uint) ([]*EnvVar, *http.Response, error)
ListByRepoId fetches environment variables based on the given repository id
Travis CI API docs: https://developer.travis-ci.com/resource/env_vars#for_repository
func (*EnvVarsService) ListByRepoSlug ¶ added in v0.0.7
func (es *EnvVarsService) ListByRepoSlug(ctx context.Context, repoSlug string) ([]*EnvVar, *http.Response, error)
ListByRepoSlug fetches environment variables based on the given repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/env_vars#for_repository
func (*EnvVarsService) UpdateByRepoId ¶ added in v0.0.7
func (es *EnvVarsService) UpdateByRepoId(ctx context.Context, repoId uint, id string, envVar *EnvVarBody) (*EnvVar, *http.Response, error)
UpdateByRepoId updates environment variable based on the given option
Travis CI API docs: https://developer.travis-ci.com/resource/env_var#update
func (*EnvVarsService) UpdateByRepoSlug ¶ added in v0.0.7
func (es *EnvVarsService) UpdateByRepoSlug(ctx context.Context, repoSlug string, id string, envVar *EnvVarBody) (*EnvVar, *http.Response, error)
UpdateByRepoSlug updates environment variable based on the given option
Travis CI API docs: https://developer.travis-ci.com/resource/env_var#update
type ErrorResponse ¶
type ErrorResponse struct { // HTTP response that caused this error Response *http.Response // The error's type ErrorType string `json:"error_type"` // The error's message ErrorMessage string `json:"error_message"` // The error's resource type ResourceType string `json:"resource_type"` // The error's permission Permission string `json:"permission"` }
ErrorResponse reports an error caused by an API request. ErrorResponse implemented the Error interface.
Travis CI API docs: https://developer.travis-ci.com/resource/error#error
func (*ErrorResponse) Error ¶
func (er *ErrorResponse) Error() string
type GeneratedKeyPairService ¶ added in v0.2.1
type GeneratedKeyPairService struct {
// contains filtered or unexported fields
}
GeneratedKeyPairService handles communication with the key pair (generated) endpoints of Travis CI API
func (*GeneratedKeyPairService) CreateByRepoId ¶ added in v0.2.1
func (ks *GeneratedKeyPairService) CreateByRepoId(ctx context.Context, repoId uint) (*KeyPair, *http.Response, error)
CreateByRepoId creates the new default key pair based on the given repository id
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair_generated#create
func (*GeneratedKeyPairService) CreateByRepoSlug ¶ added in v0.2.1
func (ks *GeneratedKeyPairService) CreateByRepoSlug(ctx context.Context, repoSlug string) (*KeyPair, *http.Response, error)
CreateByRepoSlug creates the new default key pair based on the given repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair_generated#create
func (*GeneratedKeyPairService) FindByRepoId ¶ added in v0.2.1
func (ks *GeneratedKeyPairService) FindByRepoId(ctx context.Context, repoId uint) (*KeyPair, *http.Response, error)
FindByRepoId fetches the default key pair based on the given repository id
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair_generated#find
func (*GeneratedKeyPairService) FindByRepoSlug ¶ added in v0.2.1
func (ks *GeneratedKeyPairService) FindByRepoSlug(ctx context.Context, repoSlug string) (*KeyPair, *http.Response, error)
FindByRepoSlug fetches the default key pair based on the given repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair_generated#find
type Installation ¶ added in v0.0.6
type Installation struct { // The installation id Id *uint `json:"id,omitempty"` // The installation's id on GitHub GitHubId *uint `json:"github_id,omitempty"` // GitHub user or organization the installation belongs to Owner *Owner `json:"owner,omitempty"` *Metadata }
Installation represents a GitHub App installation
Travis CI API docs: https://developer.travis-ci.com/resource/installation#standard-representation
type InstallationOption ¶ added in v0.2.0
type InstallationOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
InstallationOption is query parameters to one can specify to find installation
type InstallationsService ¶ added in v0.0.7
type InstallationsService struct {
// contains filtered or unexported fields
}
InstallationsService handles communication with the installation related methods of the Travis CI API.
func (*InstallationsService) Find ¶ added in v0.0.7
func (is *InstallationsService) Find(ctx context.Context, id uint, opt *InstallationOption) (*Installation, *http.Response, error)
Find fetches a single GitHub installation based on the provided id.
Travis CI API docs: https://developer.travis-ci.com/resource/installation#find
type Job ¶
type Job struct { // Value uniquely identifying the job Id *uint `json:"id,omitempty"` // The job's allow_failure AllowFailure *bool `json:"allow_failure,omitempty"` // Incremental number for a repository's builds Number *string `json:"number,omitempty"` // Current state of the job State *string `json:"state,omitempty"` // When the job started StartedAt *string `json:"started_at,omitempty"` // When the job finished FinishedAt *string `json:"finished_at,omitempty"` // The build the job is associated with Build *Build `json:"build,omitempty"` // Worker queue this job is/was scheduled on Queue *string `json:"queue,omitempty"` // GitHub repository the job is associated with Repository *Repository `json:"repository,omitempty"` // The commit the job is associated with Commit *Commit `json:"commit,omitempty"` // GitHub user or organization the job belongs to Owner *Owner `json:"owner,omitempty"` // The stages of the job Stage *Stage `json:"stage,omitempty"` // When the job was created CreatedAt *string `json:"created_at,omitempty"` // When the job was updated UpdatedAt *string `json:"updated_at,omitempty"` // Whether or not the job is private Private *bool `json:"private,omitempty"` // The job's config Config *Config `json:"config,omitempty"` *Metadata }
Job represents a Travis CI job
Travis CI API docs: https://developer.travis-ci.com/resource/job#standard-representation
type JobOption ¶ added in v0.2.0
type JobOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
JobOption is query parameters to one can specify to find job
type JobsOption ¶
type JobsOption struct { // How many jobs to include in the response Limit int `url:"limit,omitempty"` // How many jobs to skip before the first entry in the response Offset int `url:"offset,omitempty"` // Attributes to sort jobs by SortBy []string `url:"sort_by,omitempty,comma"` // // Current state of the job State []string `url:"state,omitempty,comma"` // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
JobsOption is query parameters to one can specify to find jobs
type JobsService ¶
type JobsService struct {
// contains filtered or unexported fields
}
JobsService handles communication with the jobs related methods of the Travis CI API.
func (*JobsService) Cancel ¶ added in v0.0.7
Cancel cancels a job based on the provided job id
Travis CI API docs: https://developer.travis-ci.com/resource/job#cancel
func (*JobsService) Debug ¶ added in v0.0.7
Debug restarts a job in debug mode based on the provided job id Debug is only available on the travis-ci.com domain, and you need to enable the debug feature
Travis CI API docs: https://developer.travis-ci.com/resource/job#debug
func (*JobsService) Find ¶
func (js *JobsService) Find(ctx context.Context, id uint, opt *JobOption) (*Job, *http.Response, error)
Find fetches a job based on the provided job id
Travis CI API docs: https://developer.travis-ci.com/resource/job#find
func (*JobsService) List ¶ added in v0.0.7
func (js *JobsService) List(ctx context.Context, opt *JobsOption) ([]*Job, *http.Response, error)
List fetches current user's jobs based on the provided options As of 2018/9/4, this endpoint returns 500 and does not seem to work correctly See jobs_integration_test.go, TestJobsService_Find
Travis CI API docs: https://developer.travis-ci.com/resource/jobs#find
func (*JobsService) ListByBuild ¶ added in v0.0.7
func (js *JobsService) ListByBuild(ctx context.Context, buildId uint) ([]*Job, *http.Response, error)
ListByBuild fetches jobs based on the provided build id
Travis CI API docs: https://developer.travis-ci.csom/resource/jobs#find
type KeyPair ¶ added in v0.2.1
type KeyPair struct { // A text description. Description *string `json:"description,omitempty"` // The public key. PublicKey *string `json:"public_key,omitempty"` // The fingerprint. Fingerprint *string `json:"fingerprint,omitempty"` *Metadata }
KeyPair is a standard representation of a public/private RSA key pair on Travis CI
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair#standard-representation
type KeyPairBody ¶ added in v0.2.1
type KeyPairBody struct { // A text description. Description string `json:"key_pair.description,omitempty"` // The private key. Value string `json:"key_pair.value,omitempty"` }
KeyPairBody specifies options for creating and updating key pair.
type KeyPairService ¶ added in v0.2.1
type KeyPairService struct {
// contains filtered or unexported fields
}
KeyPairService handles communication with the key pair endpoints of Travis CI API
func (*KeyPairService) CreateByRepoId ¶ added in v0.2.1
func (ks *KeyPairService) CreateByRepoId(ctx context.Context, repoId uint, keyPair *KeyPairBody) (*KeyPair, *http.Response, error)
CreateByRepoId creates the key pair based on the given repository id
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair#create
func (*KeyPairService) CreateByRepoSlug ¶ added in v0.2.1
func (ks *KeyPairService) CreateByRepoSlug(ctx context.Context, repoSlug string, keyPair *KeyPairBody) (*KeyPair, *http.Response, error)
CreateByRepoSlug creates a new key pair based on the given repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair#create
func (*KeyPairService) DeleteByRepoId ¶ added in v0.2.1
DeleteByRepoId deletes the key pair based on the given repository id and
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair#delete
func (*KeyPairService) DeleteByRepoSlug ¶ added in v0.2.1
func (ks *KeyPairService) DeleteByRepoSlug(ctx context.Context, repoSlug string) (*http.Response, error)
DeleteByRepoSlug deletes the key pair based on the given repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair#delete
func (*KeyPairService) FindByRepoId ¶ added in v0.2.1
func (ks *KeyPairService) FindByRepoId(ctx context.Context, repoId uint) (*KeyPair, *http.Response, error)
FindByRepoId fetches the key pair based on the given repository id
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair#find
func (*KeyPairService) FindByRepoSlug ¶ added in v0.2.1
func (ks *KeyPairService) FindByRepoSlug(ctx context.Context, repoSlug string) (*KeyPair, *http.Response, error)
FindByRepoSlug fetches the key pair based on the given repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair#find
func (*KeyPairService) UpdateByRepoId ¶ added in v0.2.1
func (ks *KeyPairService) UpdateByRepoId(ctx context.Context, repoId uint, keyPair *KeyPairBody) (*KeyPair, *http.Response, error)
UpdateByRepoId updates the key pair variable based on the given option
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair#update
func (*KeyPairService) UpdateByRepoSlug ¶ added in v0.2.1
func (ks *KeyPairService) UpdateByRepoSlug(ctx context.Context, repoSlug string, keyPair *KeyPairBody) (*KeyPair, *http.Response, error)
UpdateByRepoSlug updates the key pair variable based on the given option
Travis CI API docs: https://developer.travis-ci.com/resource/key_pair#update
type LintService ¶ added in v0.0.5
type LintService struct {
// contains filtered or unexported fields
}
LintService handles communication with the lint endpoint of Travis CI API
type Log ¶
type Log struct { // The log's id Id *uint `json:"id,omitempty"` // The content of the log Content *string `json:"content,omitempty"` // The log parts that form the log LogParts []*LogPart `json:"log_parts,omitempty"` *Metadata }
Log represents a Travis CI job log
type LogPart ¶
type LogPart struct { Content *string `json:"content,omitempty"` Final *bool `json:"final,omitempty"` Number *uint `json:"number,omitempty"` }
LogPart is parts that form the log
type LogsService ¶ added in v0.0.7
type LogsService struct {
// contains filtered or unexported fields
}
LogsService handles communication with the logs related methods of the Travis CI API.
func (*LogsService) DeleteByJobId ¶ added in v0.2.0
DeleteByJobId fetches a job's log based on it's provided id.
Travis CI API docs: https://developer.travis-ci.com/resource/log#delete
func (*LogsService) FindByJobId ¶ added in v0.2.0
FindByJobId fetches a job's log based on it's provided id.
Travis CI API docs: https://developer.travis-ci.com/resource/log#find
type Message ¶ added in v0.2.0
type Message struct { // The message's id Id *uint `json:"id"` // The message's level Level *string `json:"level"` // The message's key Key *string `json:"key"` // The message's code Code *string `json:"code"` // The message's args Args json.RawMessage `json:"args"` *Metadata }
Message represents an individual Message.
Travis CI API docs: https://developer.travis-ci.com/resource/message#message
type MessagesOption ¶ added in v0.2.0
type MessagesOption struct { // How many messages to include in the response Limit int `url:"limit,omitempty"` // How many messages to skip before the first entry in the response Offset int `url:"offset,omitempty"` }
MessagesOption specifies the optional parameters for messages endpoint
type MessagesService ¶ added in v0.2.0
type MessagesService struct {
// contains filtered or unexported fields
}
MessagesService handles communication with the Message related methods of the Travis CI API.
func (*MessagesService) ListByRepoId ¶ added in v0.2.0
func (ms *MessagesService) ListByRepoId(ctx context.Context, repoId uint, requestId uint, opt *MessagesOption) ([]*Message, *http.Response, error)
ListByRepoId returns a list of messages created by travis-yml for a request, if any exist.
Travis CI API docs: https://developer.travis-ci.com/resource/messages#for_request
func (*MessagesService) ListByRepoSlug ¶ added in v0.2.0
func (ms *MessagesService) ListByRepoSlug(ctx context.Context, repoSlug string, requestId uint, opt *MessagesOption) ([]*Message, *http.Response, error)
ListByRepoSlug returns a list of messages created by travis-yml for a request, if any exist.
Travis CI API docs: https://developer.travis-ci.com/resource/messages#for_request
type Metadata ¶ added in v0.0.8
type Metadata struct { // The type of data returned from the API Type *string `json:"@type,omitempty"` // The link for data returned from the API Href *string `json:"@href,omitempty"` // The representation of data returned from the API, standard or minimal Representation *string `json:"@representation,omitempty"` // The permissions of data returned from the API Permissions *Permissions `json:"@permissions,omitempty"` }
Metadata is a metadata returned from the Travis CI API
func (*Metadata) IsMinimal ¶ added in v0.2.0
IsStandard tells if the struct is in a minimal representation
func (*Metadata) IsStandard ¶ added in v0.2.0
IsStandard tells if the struct is in a standard representation
type Organization ¶ added in v0.1.0
type Organization struct { // Value uniquely identifying the organization Id *uint `json:"id,omitempty"` // Login set on GitHub Login *string `json:"login,omitempty"` // Name set on GitHub Name *string `json:"name,omitempty"` // Id set on GitHub GithubId *uint `json:"github_id,omitempty"` // Avatar_url set on GitHub AvatarUrl *string `json:"avatar_url,omitempty"` // Whether or not the organization has an education account Education *bool `json:"education,omitempty"` // Repositories belonging to this organization. Repositories []*Repository `json:"repositories,omitempty"` // Installation belonging to the organization Installation *Installation `json:"installation,omitempty"` *Metadata }
Organization is a standard representation of an individual organization
Travis CI API docs: https://developer.travis-ci.com/resource/organization#standard-representation
type OrganizationOption ¶ added in v0.2.0
type OrganizationOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
OrganizationOption specifies the optional parameters for organization endpoint
type OrganizationsOption ¶ added in v0.1.0
type OrganizationsOption struct { // How many organizations to include in the response Limit int `url:"limit,omitempty"` // How many organizations to skip before the first entry in the response Offset int `url:"offset,omitempty"` // Attributes to sort organizations by SortBy string `url:"sort_by,omitempty"` // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
OrganizationsOption specifies the optional parameters for organizations endpoint
type OrganizationsService ¶ added in v0.1.0
type OrganizationsService struct {
// contains filtered or unexported fields
}
OrganizationsService handles communication with the organization related methods of the Travis CI API.
func (*OrganizationsService) Find ¶ added in v0.1.0
func (os *OrganizationsService) Find(ctx context.Context, id uint, opt *OrganizationOption) (*Organization, *http.Response, error)
Find fetches an organization with the given id
Travis CI API docs: https://developer.travis-ci.com/resource/organization#find
func (*OrganizationsService) List ¶ added in v0.1.0
func (os *OrganizationsService) List(ctx context.Context, opt *OrganizationsOption) ([]*Organization, *http.Response, error)
List fetches a list of organizations the current user is a member of
Travis CI API docs: https://developer.travis-ci.com/resource/organizations#for_current_user
type Owner ¶
type Owner struct { // Value uniquely identifying the owner Id *uint `json:"id"` // User or organization login set on GitHub Login *string `json:"login"` // User or organization name set on GitHub Name *string `json:"name"` // User or organization id set on GitHub GitHubId *uint `json:"github_id"` // Link to user or organization avatar (image) set on GitHub AvatarUrl *string `json:"avatar_url"` // Whether or not the owner has an education account Education *bool `json:"education"` // Repositories belonging to this account Repositories []*Repository `json:"repositories"` // Installation belonging to the owner Installation *Installation `json:"installation"` *Metadata }
Owner represents a GitHub Repository
Travis CI API docs: https://developer.travis-ci.com/resource/owner#standard-representation
type OwnerOption ¶ added in v0.2.0
type OwnerOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
OwnerOption specifies the optional parameters for owner endpoint
type OwnerService ¶
type OwnerService struct {
// contains filtered or unexported fields
}
OwnerService handles communication with the GitHub owner related methods of the Travis CI API.
func (*OwnerService) FindByGitHubId ¶
func (os *OwnerService) FindByGitHubId(ctx context.Context, githubId uint, opt *OwnerOption) (*Owner, *http.Response, error)
Find fetches a owner based on the provided GitHub id
Travis CI API docs: https://developer.travis-ci.com/resource/owner#find
func (*OwnerService) FindByLogin ¶
func (os *OwnerService) FindByLogin(ctx context.Context, login string, opt *OwnerOption) (*Owner, *http.Response, error)
Find fetches a owner based on the provided login Login is user or organization login set on GitHub
Travis CI API docs: https://developer.travis-ci.com/resource/owner#find
type Permissions ¶ added in v0.0.9
Permissions represents permissions of Travis CI API
type Preference ¶ added in v0.0.6
type Preference struct { // The preference's name Name *string `json:"name,omitempty"` // The preference's value Value interface{} `json:"value"` *Metadata }
Preference is a standard representation of an individual preference
Travis CI API docs: https://developer.travis-ci.com/resource/preference#standard-representation
type PreferenceBody ¶ added in v0.2.0
type PreferenceBody struct { // The preference's name Name string `json:"name,omitempty"` // The preference's value Value interface{} `json:"value"` }
PreferenceBody is body for creating preference
type PreferencesService ¶ added in v0.0.6
type PreferencesService struct {
// contains filtered or unexported fields
}
PreferencesService handles communication with the preferences related methods of the Travis CI API.
func (*PreferencesService) Find ¶ added in v0.0.6
func (ps *PreferencesService) Find(ctx context.Context, name string) (*Preference, *http.Response, error)
Find fetches the current user's preference based on the provided preference name
Travis CI API docs: https://developer.travis-ci.com/resource/preference#find
func (*PreferencesService) List ¶ added in v0.0.7
func (ps *PreferencesService) List(ctx context.Context) ([]*Preference, *http.Response, error)
List fetches the current user's preferences
Travis CI API docs: https://developer.travis-ci.com/resource/preferences#for_user
func (*PreferencesService) Update ¶ added in v0.0.7
func (ps *PreferencesService) Update(ctx context.Context, preference *PreferenceBody) (*Preference, *http.Response, error)
Update updates the current user's preference based on the provided preference property
Travis CI API docs: https://developer.travis-ci.com/resource/preference#update
type RepositoriesOption ¶ added in v0.2.0
type RepositoriesOption struct { // Filters repositories by whether or not this repository is currently enabled on Travis CI. Active bool `url:"active,omitempty"` // Filters repositories by whether or not this repository runs builds on travis-ci.org (may also be null). ActiveOnOrg bool `url:"active_on_org,omitempty"` // Filters repositories by whether or not this repository is managed by a GitHub App installation. ManagedByInstallation bool `url:"managed_by_installation,omitempty"` // Filters repositories by whether or not this repository is private. Private bool `url:"private,omitempty"` // Filters repositories by whether or not this repository is starred. Starred bool `url:"starred,omitempty"` // How many repositories to include in the response Limit int `url:"limit,omitempty"` // How many repositories to skip before the first entry in the response Offset int `url:"offset,omitempty"` // Attributes to sort repositories by SortBy string `url:"sort_by,omitempty"` // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
RepositoriesOption is query parameters to one can specify to find repositories
type RepositoriesService ¶ added in v0.0.7
type RepositoriesService struct {
// contains filtered or unexported fields
}
RepositoriesService handles communication with the builds related methods of the Travis CI API.
func (*RepositoriesService) Activate ¶ added in v0.0.7
func (rs *RepositoriesService) Activate(ctx context.Context, slug string) (*Repository, *http.Response, error)
Activate activates Travis CI on the specified repository
Travis CI API docs: https://developer.travis-ci.com/resource/repository#activate
func (*RepositoriesService) Deactivate ¶ added in v0.0.7
func (rs *RepositoriesService) Deactivate(ctx context.Context, slug string) (*Repository, *http.Response, error)
Deactivate deactivates Travis CI on the specified repository
Travis CI API docs: https://developer.travis-ci.com/resource/repository#deactivate
func (*RepositoriesService) Find ¶ added in v0.0.7
func (rs *RepositoriesService) Find(ctx context.Context, slug string, opt *RepositoryOption) (*Repository, *http.Response, error)
Find fetches a repository based on the provided slug
Travis CI API docs: https://developer.travis-ci.com/resource/repository#find
func (*RepositoriesService) List ¶ added in v0.2.0
func (rs *RepositoriesService) List(ctx context.Context, opt *RepositoriesOption) ([]*Repository, *http.Response, error)
List fetches repositories of current user
Travis CI API docs: https://developer.travis-ci.com/resource/repositories#for_current_user
func (*RepositoriesService) ListByGitHubId ¶ added in v0.2.0
func (rs *RepositoriesService) ListByGitHubId(ctx context.Context, id uint, opt *RepositoriesOption) ([]*Repository, *http.Response, error)
ListByGitHubId fetches repositories base on the provided GitHub Id
Travis CI API docs: https://developer.travis-ci.com/resource/repositories#for_owner
func (*RepositoriesService) ListByOwner ¶ added in v0.2.0
func (rs *RepositoriesService) ListByOwner(ctx context.Context, owner string, opt *RepositoriesOption) ([]*Repository, *http.Response, error)
ListByOwner fetches repositories base on the provided owner
Travis CI API docs: https://developer.travis-ci.com/resource/repositories#for_owner
func (*RepositoriesService) Migrate ¶ added in v0.2.0
func (rs *RepositoriesService) Migrate(ctx context.Context, slug string) (*Repository, *http.Response, error)
Migrate migrates a repository
Travis CI API docs: https://developer.travis-ci.com/resource/repository#migrate
func (*RepositoriesService) Star ¶ added in v0.0.7
func (rs *RepositoriesService) Star(ctx context.Context, slug string) (*Repository, *http.Response, error)
Star stars a repository based on the currently logged in user
Travis CI API docs: https://developer.travis-ci.com/resource/repository#star
func (*RepositoriesService) Unstar ¶ added in v0.0.7
func (rs *RepositoriesService) Unstar(ctx context.Context, slug string) (*Repository, *http.Response, error)
Unstar unstars a repository based on the currently logged in user
Travis CI API docs: https://developer.travis-ci.com/resource/repository#unstar
type Repository ¶
type Repository struct { // Value uniquely identifying the repository Id *uint `json:"id"` // The repository's name on GitHub Name *string `json:"name"` // Same as {repository.owner.name}/{repository.name} Slug *string `json:"slug"` // The repository's description from GitHub Description *string `json:"description"` // The repository's id on GitHub GitHubId *uint `json:"github_id"` // The main programming language used according to GitHub GitHubLanguage *string `json:"github_language"` // Whether or not this repository is currently enabled on Travis CI Active *bool `json:"active"` // Whether or not this repository is private Private *bool `json:"private"` // GitHub user or organization the repository belongs to Owner *Owner `json:"owner"` // The default branch on GitHub DefaultBranch *Branch `json:"default_branch"` // Whether or not this repository is starred Starred *bool `json:"starred"` // Whether or not this repository is managed by a GitHub App installation ManagedByInstallation *bool `json:"managed_by_installation"` // Whether or not this repository runs builds on travis-ci.org (may also be null) ActiveOnOrg *bool `json:"active_on_org"` // The repository's migration_status MigrationStatus *string `json:"migration_status"` // The repository's allow_migration AllowMigration *bool `json:"allow_migration"` *Metadata }
Repository represents a Travis CI repository
Travis CI API docs: https://developer.travis-ci.com/resource/repository#standard-representation
type RepositoryOption ¶ added in v0.2.0
type RepositoryOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
RepositoryOption is query parameters to one can specify to find repository
type Request ¶
type Request struct { // Value uniquely identifying the request Id *uint `json:"id,omitempty"` // The state of a request (eg. whether it has been processed or not) State *string `json:"state,omitempty"` // The result of the request (eg. rejected or approved) Result *string `json:"result,omitempty"` // Travis-ci status message attached to the request. Message *string `json:"message,omitempty"` // GitHub user or organization the request belongs to Repository *Repository `json:"repository,omitempty"` // Name of the branch requested to be built BranchName *string `json:"branch_name,omitempty"` // The commit the request is associated with Commit *Commit `json:"commit,omitempty"` // The request's builds Builds []*Build `json:"builds,omitempty"` // GitHub user or organization the request belongs to Owner *Owner `json:"owner,omitempty"` // When Travis CI created the request CreatedAt *string `json:"created_at,omitempty"` // Origin of request (push, pull request, api) EventType *string `json:"event_type,omitempty"` // The base commit the request is associated with BaseCommit *string `json:"base_commit,omitempty"` // The head commit the request is associated with HeadCommit *string `json:"head_commit,omitempty"` *Metadata }
Request represents a Travis CI request. They can be used to see if and why a GitHub even has or has not triggered a new build.
// Travis CI API docs: https://developer.travis-ci.com/resource/request#standard-representation
type RequestBody ¶ added in v0.0.4
type RequestBody struct { // Build configuration (as parsed from .travis.yml) Config interface{} `json:"config,omitempty"` // Travis-ci status message attached to the request Message string `json:"message,omitempty"` // Branch requested to be built Branch string `json:"branch,omitempty"` // Travis token associated with webhook on GitHub (DEPRECATED) Token string `json:"token,omitempty"` }
RequestBody specifies body for creating request.
type RequestOption ¶ added in v0.2.0
type RequestOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
RequestOption specifies options for finding a request.
type RequestsOption ¶ added in v0.2.0
type RequestsOption struct { // How many requests to include in the response Limit int `url:"limit,omitempty"` // How many requests to skip before the first entry in the response Offset int `url:"offset,omitempty"` // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
RequestsOption specifies options for listing requests.
type RequestsService ¶
type RequestsService struct {
// contains filtered or unexported fields
}
RequestsService handles communication with the requests related methods of the Travis CI API.
func (*RequestsService) CreateByRepoId ¶
func (rs *RequestsService) CreateByRepoId(ctx context.Context, repoId uint, request *RequestBody) (*Request, *http.Response, error)
CreateByRepoId create requests of given repository id and provided options
Travis CI API docs: https://developer.travis-ci.com/resource/requests#create
func (*RequestsService) CreateByRepoSlug ¶
func (rs *RequestsService) CreateByRepoSlug(ctx context.Context, repoSlug string, request *RequestBody) (*Request, *http.Response, error)
CreateByRepoSlug create requests of given repository slug and provided options
Travis CI API docs: https://developer.travis-ci.com/resource/requests#create
func (*RequestsService) FindByRepoId ¶
func (rs *RequestsService) FindByRepoId(ctx context.Context, repoId uint, id uint, opt *RequestOption) (*Request, *http.Response, error)
FindByRepoId fetches request of given repository id and request id
Travis CI API docs: https://developer.travis-ci.com/resource/request#find
func (*RequestsService) FindByRepoSlug ¶
func (rs *RequestsService) FindByRepoSlug(ctx context.Context, repoSlug string, id uint, opt *RequestOption) (*Request, *http.Response, error)
FindByRepoSlug fetches request of given repository slug and request id
Travis CI API docs: https://developer.travis-ci.com/resource/request#find
func (*RequestsService) ListByRepoId ¶ added in v0.0.7
func (rs *RequestsService) ListByRepoId(ctx context.Context, repoId uint, opt *RequestsOption) ([]*Request, *http.Response, error)
ListByRepoId fetches requests of given repository id
Travis CI API docs: https://developer.travis-ci.com/resource/requests#find
func (*RequestsService) ListByRepoSlug ¶ added in v0.0.7
func (rs *RequestsService) ListByRepoSlug(ctx context.Context, repoSlug string, opt *RequestsOption) ([]*Request, *http.Response, error)
ListByRepoSlug fetches requests of given repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/requests#find
type Setting ¶ added in v0.0.8
type Setting struct { // The setting's name Name *string `json:"name,omitempty"` // The setting's value // Currently value can be boolean or integer Value interface{} `json:"value,omitempty"` *Metadata }
Setting represents a Travis CI setting.
Travis CI API docs: https://developer.travis-ci.com/resource/setting#standard-representation
type SettingBody ¶ added in v0.2.0
type SettingBody struct { Name string `json:"name,omitempty"` Value interface{} `json:"value,omitempty"` }
SettingBody is a body to update setting
type SettingsService ¶ added in v0.0.8
type SettingsService struct {
// contains filtered or unexported fields
}
SettingsService handles communication with the setting related methods of the Travis CI API.
func (*SettingsService) FindByRepoId ¶ added in v0.0.8
func (ss *SettingsService) FindByRepoId(ctx context.Context, repoId uint, name string) (*Setting, *http.Response, error)
FindByRepoId fetches a setting of given repository id and setting name
Travis CI API docs: https://developer.travis-ci.com/resource/setting#find
func (*SettingsService) FindByRepoSlug ¶ added in v0.0.8
func (ss *SettingsService) FindByRepoSlug(ctx context.Context, repoSlug string, name string) (*Setting, *http.Response, error)
FindByRepoSlug fetches a setting of given repository slug and setting name
Travis CI API docs: https://developer.travis-ci.com/resource/setting#find
func (*SettingsService) ListByRepoId ¶ added in v0.0.8
func (ss *SettingsService) ListByRepoId(ctx context.Context, repoId uint) ([]*Setting, *http.Response, error)
ListByRepoId fetches a list of settings of given repository id
Travis CI API docs: https://developer.travis-ci.com/resource/settings#for_repository
func (*SettingsService) ListByRepoSlug ¶ added in v0.0.8
func (ss *SettingsService) ListByRepoSlug(ctx context.Context, repoSlug string) ([]*Setting, *http.Response, error)
ListByRepoSlug fetches a list of settings of given repository slug
Travis CI API docs: https://developer.travis-ci.com/resource/settings#for_repository
func (*SettingsService) UpdateByRepoId ¶ added in v0.0.8
func (ss *SettingsService) UpdateByRepoId(ctx context.Context, repoId uint, setting *SettingBody) (*Setting, *http.Response, error)
UpdateByRepoId updates a setting with setting property
Travis CI API docs: https://developer.travis-ci.com/resource/setting#update
func (*SettingsService) UpdateByRepoSlug ¶ added in v0.0.8
func (ss *SettingsService) UpdateByRepoSlug(ctx context.Context, repoSlug string, setting *SettingBody) (*Setting, *http.Response, error)
UpdateByRepoSlug updates a setting with setting property
Travis CI API docs: https://developer.travis-ci.com/resource/setting#update
type Stage ¶ added in v0.2.0
type Stage struct { // Value uniquely identifying the stage Id *uint `json:"id,omitempty"` // Incremental number for a stage Number *uint `json:"number,omitempty"` // The name of the stage Name *string `json:"name,omitempty"` // Current state of the stage State *string `json:"state,omitempty"` // When the stage started StartedAt *string `json:"started_at,omitempty"` // When the stage finished FinishedAt *string `json:"finished_at,omitempty"` // The jobs of a stage. Jobs []*Job `json:"jobs,omitempty"` *Metadata }
Stage is a standard representation of an individual stage
Travis CI API docs: https://developer.travis-ci.com/resource/stage#standard-representation
type StagesOption ¶ added in v0.2.0
type StagesOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
StagesOption is query parameters to one can specify to list stages
type StagesService ¶ added in v0.2.0
type StagesService struct {
// contains filtered or unexported fields
}
StagesService handles communication with the stage related methods of the Travis CI API.
func (*StagesService) ListByBuild ¶ added in v0.2.0
func (ss *StagesService) ListByBuild(ctx context.Context, buildId uint, opt *StagesOption) ([]*Stage, *http.Response, error)
ListByBuild fetches stages of the build
Travis CI API docs: https://developer.travis-ci.com/resource/stages#find
type Tag ¶ added in v0.2.0
type Tag struct { // Value uniquely identifying a repository of the build belongs to RepositoryId *uint `json:"repository_id"` // Name of the tag Name *string `json:"name,omitempty"` // Id of a last build on the branch LastBuildId *uint `json:"last_build_id"` *Metadata }
Tag is a standard representation of a Travis CI tag
type TravisYml ¶ added in v0.0.5
type TravisYml struct {
Content string `json:"content,omitempty"`
}
type User ¶
type User struct { // Value uniquely identifying the user Id *uint `json:"id,omitempty"` // Login set on Github Login *string `json:"login,omitempty"` // Name set on GitHub Name *string `json:"name,omitempty"` // Id set on GitHub GithubId *uint `json:"github_id,omitempty"` // Avatar URL set on GitHub AvatarUrl *string `json:"avatar_url,omitempty"` // Whether or not the user has an education account Education *bool `json:"education,omitempty"` // Whether or not the user is currently being synced with Github IsSyncing *bool `json:"is_syncing,omitempty"` // The last time the user was synced with GitHub SyncedAt *string `json:"synced_at,omitempty"` // Repositories belonging to this user Repositories []*Repository `json:"repositories,omitempty"` // Installation belonging to the user Installation []*Repository `json:"installation,omitempty"` // The user's emails Emails []*string `json:"emails,omitempty"` *Metadata }
User represents a Travis CI user.
Travis CI API docs: https://developer.travis-ci.com/resource/user#standard-representation
type UserOption ¶ added in v0.2.0
type UserOption struct { // List of attributes to eager load Include []string `url:"include,omitempty,comma"` }
UserOption is query parameters to one can specify to find a user
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
UserService handles communication with the users related methods of the Travis CI API.
func (*UserService) Current ¶
func (us *UserService) Current(ctx context.Context, opt *UserOption) (*User, *http.Response, error)
Current fetches the currently authenticated user from Travis CI API.
Travis CI API docs: https://developer.travis-ci.com/resource/user#current
func (*UserService) Find ¶
func (us *UserService) Find(ctx context.Context, id uint, opt *UserOption) (*User, *http.Response, error)
Get fetches the user with the provided id from the Travis CI API.
Travis CI API docs: https://developer.travis-ci.com/resource/user#find
Source Files ¶
- active.go
- beta_features.go
- beta_migration_requests.go
- branches.go
- broadcasts.go
- builds.go
- caches.go
- commits.go
- config.go
- crons.go
- email_subscriptions.go
- env_vars.go
- installatios.go
- jobs.go
- key_pair.go
- lint.go
- logs.go
- messages.go
- metadata.go
- organizations.go
- owners.go
- preferences.go
- repositories.go
- requests.go
- settings.go
- stages.go
- tags.go
- travis.go
- users.go
- version.go