Documentation ¶
Index ¶
- Constants
- Variables
- func References(path string, conf GitStyle) (tui.Suggestions, error)
- func Remotes(path string) (map[string][]string, error)
- type AppVeyorClient
- type AzurePipelinesClient
- func (c AzurePipelinesClient) BuildFromURL(ctx context.Context, u string) (Pipeline, error)
- func (c AzurePipelinesClient) Host() string
- func (c AzurePipelinesClient) ID() string
- func (c AzurePipelinesClient) Log(ctx context.Context, step Step) (string, error)
- func (c AzurePipelinesClient) Name() string
- type CIProvider
- type Cache
- func (c Cache) Commit(ref string) (Commit, bool)
- func (c *Cache) Log(ctx context.Context, key PipelineKey, stepIDs []string) (string, error)
- func (c *Cache) MonitorPipelines(ctx context.Context, repositoryURLs map[string][]string, ref Ref, ...) error
- func (c *Cache) Pipeline(key PipelineKey) (Pipeline, bool)
- func (c Cache) Pipelines(ref string) []Pipeline
- func (c *Cache) SaveCommit(ref string, commit Commit)
- func (c *Cache) SavePipeline(sha string, p Pipeline) (PipelineChanges, error)
- func (c *Cache) Step(key PipelineKey, stepIDs []string) (Step, bool)
- type CircleCIClient
- type Commit
- type Configuration
- type GitHubClient
- type GitLabClient
- func (c GitLabClient) BuildFromURL(ctx context.Context, u string) (Pipeline, error)
- func (c GitLabClient) Commit(ctx context.Context, repo string, ref string) (Commit, error)
- func (c GitLabClient) Host() string
- func (c GitLabClient) ID() string
- func (c GitLabClient) Log(ctx context.Context, step Step) (string, error)
- func (c GitLabClient) Name() string
- func (c GitLabClient) RefStatuses(ctx context.Context, url string, ref string, sha string) ([]string, error)
- type GitStyle
- type HTTPError
- type Log
- type Pipeline
- func (p Pipeline) Compare(other tui.TableNode, id tui.ColumnID, i interface{}) int
- func (p Pipeline) Diff(other Pipeline) string
- func (p Pipeline) InheritedValues() []tui.ColumnID
- func (p Pipeline) Key() PipelineKey
- func (p Pipeline) NodeID() interface{}
- func (p Pipeline) StatusDiff(before Pipeline) PipelineChanges
- func (p Pipeline) Values(v interface{}) map[tui.ColumnID]tui.StyledString
- type PipelineChanges
- type PipelineKey
- type Pipelines
- type Provider
- type Ref
- type SourceProvider
- type State
- type Step
- func (s Step) Compare(t tui.TableNode, id tui.ColumnID, i interface{}) int
- func (s Step) Diff(other Step) string
- func (s Step) InheritedValues() []tui.ColumnID
- func (s Step) Map(f func(Step) Step) Step
- func (s Step) NodeChildren() []tui.TableNode
- func (s Step) NodeID() interface{}
- func (s Step) Values(v interface{}) map[tui.ColumnID]tui.StyledString
- type StepStatusChanges
- type StepStyle
- type StepType
- type TravisClient
Constants ¶
View Source
const ( StepPipeline = iota StepStage StepJob StepTask )
View Source
const ( ColumnRef tui.ColumnID = iota ColumnPipeline ColumnType ColumnState ColumnCreated ColumnStarted ColumnFinished ColumnDuration ColumnName ColumnWebURL ColumnAllowedFailure )
Variables ¶
View Source
var CircleCIURL = url.URL{
Scheme: "https",
Host: "circleci.com",
Path: "api/v1.1",
RawPath: "api/v1.1",
}
View Source
var ErrNoLogHere = errors.New("no log is associated to this row")
View Source
var ErrNoProvider = errors.New("list of providers must not be empty")
View Source
var ErrObsoleteBuild = errors.New("build to save is older than current build in cache")
View Source
var ErrUnknownGitReference = errors.New("unknown git reference")
View Source
var ErrUnknownPipelineURL = errors.New("unknown pipeline url")
View Source
var ErrUnknownRepositoryURL = errors.New("unknown repository url")
View Source
var TravisComURL = url.URL{Scheme: "https", Host: "api.travis-ci.com"}
View Source
var TravisOrgURL = url.URL{Scheme: "https", Host: "api.travis-ci.org"}
Functions ¶
func References ¶
func References(path string, conf GitStyle) (tui.Suggestions, error)
Types ¶
type AppVeyorClient ¶
type AppVeyorClient struct {
// contains filtered or unexported fields
}
func NewAppVeyorClient ¶
func NewAppVeyorClient(id string, name string, token string, requestsPerSecond float64) AppVeyorClient
func (AppVeyorClient) BuildFromURL ¶
func (AppVeyorClient) Host ¶
func (c AppVeyorClient) Host() string
func (AppVeyorClient) ID ¶
func (c AppVeyorClient) ID() string
func (AppVeyorClient) Name ¶
func (c AppVeyorClient) Name() string
type AzurePipelinesClient ¶
type AzurePipelinesClient struct {
// contains filtered or unexported fields
}
func NewAzurePipelinesClient ¶
func NewAzurePipelinesClient(id string, name string, token string, requestsPerSecond float64) AzurePipelinesClient
func (AzurePipelinesClient) BuildFromURL ¶
func (AzurePipelinesClient) Host ¶
func (c AzurePipelinesClient) Host() string
func (AzurePipelinesClient) ID ¶
func (c AzurePipelinesClient) ID() string
func (AzurePipelinesClient) Name ¶
func (c AzurePipelinesClient) Name() string
type CIProvider ¶
type CIProvider interface { // Unique identifier of the Provider instance among all other instances ID() string // Host part of the url of the Provider Host() string // Display name of the Provider Name() string // FIXME Replace stepID by stepIDs Log(ctx context.Context, step Step) (string, error) BuildFromURL(ctx context.Context, u string) (Pipeline, error) }
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func NewCache ¶
func NewCache(CIProviders []CIProvider, sourceProviders []SourceProvider, strategy utils.PollingStrategy) Cache
func (*Cache) MonitorPipelines ¶
func (c *Cache) MonitorPipelines(ctx context.Context, repositoryURLs map[string][]string, ref Ref, updates chan<- PipelineChanges) error
Monitor CI pipelines associated to the git reference 'ref'. Every time the cache is updated with new data, a message is sent on the 'updates' channel. This function may return ErrUnknownRepositoryURL if none of the source providers is able to handle 'repositoryURL'.
func (*Cache) SaveCommit ¶
Store commit in If a commit with the same SHA exists, merge both commits.
func (*Cache) SavePipeline ¶
func (c *Cache) SavePipeline(sha string, p Pipeline) (PipelineChanges, error)
Store build in If a build from the same Provider and with the same ID is already stored in cache, it will be overwritten if the build to save is more recent than the build in If the build to save is older than the build in cache, SavePipeline will return ErrObsoleteBuild.
type CircleCIClient ¶
type CircleCIClient struct {
// contains filtered or unexported fields
}
func NewCircleCIClient ¶
func NewCircleCIClient(id string, name string, token string, requestsPerSecond float64) CircleCIClient
func (CircleCIClient) BuildFromURL ¶
func (CircleCIClient) Host ¶
func (c CircleCIClient) Host() string
func (CircleCIClient) ID ¶
func (c CircleCIClient) ID() string
func (CircleCIClient) Name ¶
func (c CircleCIClient) Name() string
type Commit ¶
type Commit struct { Sha string Author string Date time.Time Message string Branches []string Tags []string Head string Statuses []string }
func (Commit) StyledStrings ¶
func (c Commit) StyledStrings(conf GitStyle) []tui.StyledString
type Configuration ¶
type Configuration struct { Polling struct { InitialInterval int `toml:"initial-interval"` MaxInterval int `toml:"max-interval"` Forever bool `toml:"forever"` } GitLab []struct { Name string `toml:"name" default:"gitlab"` URL string `toml:"url"` SSHHost string `toml:"ssh-host"` Token string `toml:"token"` TokenFromProcess []string `toml:"token-from-process"` RequestsPerSecond float64 `toml:"max-requests-per-second"` } GitHub []struct { Token string `toml:"token"` TokenFromProcess []string `toml:"token-from-process"` } CircleCI []struct { Name string `toml:"name" default:"circleci"` Token string `toml:"token"` TokenFromProcess []string `toml:"token-from-process"` RequestsPerSecond float64 `toml:"max-requests-per-second"` } Travis []struct { Name string `toml:"name" default:"travis"` URL string `toml:"url"` Token string `toml:"token"` TokenFromProcess []string `toml:"token-from-process"` RequestsPerSecond float64 `toml:"max-requests-per-second"` } AppVeyor []struct { Name string `toml:"name" default:"appveyor"` Token string `toml:"token"` TokenFromProcess []string `toml:"token-from-process"` RequestsPerSecond float64 `toml:"max-requests-per-second"` } Azure []struct { Name string `toml:"name" default:"azure"` Token string `toml:"token"` TokenFromProcess []string `toml:"token-from-process"` RequestsPerSecond float64 `toml:"max-requests-per-second"` } }
type GitHubClient ¶
type GitHubClient struct {
// contains filtered or unexported fields
}
func NewGitHubClient ¶
func NewGitHubClient(ctx context.Context, id string, token *string) GitHubClient
func (GitHubClient) ID ¶
func (c GitHubClient) ID() string
func (GitHubClient) RefStatuses ¶
type GitLabClient ¶
type GitLabClient struct {
// contains filtered or unexported fields
}
func NewGitLabClient ¶
func (GitLabClient) BuildFromURL ¶
func (GitLabClient) Host ¶
func (c GitLabClient) Host() string
func (GitLabClient) ID ¶
func (c GitLabClient) ID() string
func (GitLabClient) Name ¶
func (c GitLabClient) Name() string
func (GitLabClient) RefStatuses ¶
type GitStyle ¶
type GitStyle struct { Location *time.Location SHA tui.StyleTransform Head tui.StyleTransform Branch tui.StyleTransform Tag tui.StyleTransform }
type Log ¶
type Log struct { Key string Content utils.NullString }
type Pipeline ¶
type Pipeline struct { Number string ProviderHost string ProviderName string Ref string IsTag bool Step // contains filtered or unexported fields }
func (Pipeline) InheritedValues ¶
func (Pipeline) Key ¶
func (p Pipeline) Key() PipelineKey
func (Pipeline) StatusDiff ¶
func (p Pipeline) StatusDiff(before Pipeline) PipelineChanges
type PipelineChanges ¶
type PipelineChanges struct { Valid bool PipelineKey Changes map[StepType]*StepStatusChanges }
type PipelineKey ¶
type SourceProvider ¶
type Step ¶
type Step struct { ID string Name string Type StepType State State AllowFailure bool CreatedAt utils.NullTime StartedAt utils.NullTime FinishedAt utils.NullTime UpdatedAt utils.NullTime Duration utils.NullDuration WebURL utils.NullString Log Log Children []Step }
func (Step) InheritedValues ¶
func (Step) NodeChildren ¶
type StepStatusChanges ¶
type StepStyle ¶
type StepStyle struct { GitStyle Provider tui.StyleTransform Status struct { Failed tui.StyleTransform Canceled tui.StyleTransform Passed tui.StyleTransform Running tui.StyleTransform Pending tui.StyleTransform Skipped tui.StyleTransform Manual tui.StyleTransform } }
type TravisClient ¶
type TravisClient struct {
// contains filtered or unexported fields
}
func NewTravisClient ¶
func (TravisClient) BuildFromURL ¶
func (TravisClient) Host ¶
func (c TravisClient) Host() string
func (TravisClient) ID ¶
func (c TravisClient) ID() string
func (TravisClient) Name ¶
func (c TravisClient) Name() string
Click to show internal directories.
Click to hide internal directories.