Documentation
¶
Index ¶
- Constants
- Variables
- func EncodeHyperlink(href string, text string) string
- func GetCurrentGitProjectName() (string, string, error)
- func GetCurrentGitRef() (string, error)
- func GetHeadBranch() (string, error)
- func GetLastCommitMessage() (string, error)
- type CreatePRRequest
- type CreatePRResponse
- type Credentials
- type FakeTransport
- type GitlabJob
- type GitlabPipeline
- type HttpSettings
- type RetryJobResponse
- type RunJobResponse
- type ServiceInfo
- type StatusProps
Constants ¶
View Source
const ( Gitlab serviceKind = "gitlab-tools" Bitbucket serviceKind = "bitbucket-tools" )
Variables ¶
View Source
var ( // StatusStyles a map that combines emojis and styles StatusStyles = map[string]StatusProps{ "created": { Emoji: "🆕", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#bf87e6")), }, "pending": { Emoji: "⌛", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#FFA500")), }, "preparing": { Emoji: "⚙", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#FFFF00")), }, "waiting_for_resource": { Emoji: "⏳", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#00FFFF")), }, "running": { Emoji: "🏃", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#00FF00")), }, "running_with_artifacts": { Emoji: "📦", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#4682B4")), }, "success": { Emoji: "✅", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#00FF00")), }, "failed": { Emoji: "⛔", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#FF0000")), }, "failed_with_warnings": { Emoji: "⚠", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#FFA07A")), }, "canceled": { Emoji: "🚫", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#DC143C")), }, "skipped": { Emoji: "⏭", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#D3D3D3")), }, "manual": { Emoji: "✋", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#00CED1")), }, "scheduled": { Emoji: "⏰", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#1E90FF")), }, "deployed": { Emoji: "🚀", Style: lipgloss.NewStyle().Foreground(lipgloss.Color("#00FF00")), }, } TableBorderStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#660066")) FocusedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("205")) BlurredStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("240")) CursorStyle = FocusedStyle NoStyle = lipgloss.NewStyle() HelpStyle = BlurredStyle )
Functions ¶
func EncodeHyperlink ¶
func GetCurrentGitRef ¶
func GetHeadBranch ¶ added in v0.2.0
func GetLastCommitMessage ¶ added in v0.2.0
Types ¶
type CreatePRRequest ¶ added in v0.2.0
type CreatePRRequest struct {
Title string `json:"title"`
Source struct {
Branch struct {
Name string `json:"name"`
} `json:"branch"`
} `json:"source"`
Destination struct {
Branch struct {
Name string `json:"name"`
} `json:"branch"`
} `json:"destination"`
CloseSourceBranch bool `json:"close_source_branch"`
}
type CreatePRResponse ¶ added in v0.2.0
type CreatePRResponse struct {
Links struct {
Self struct {
Href string `json:"href"`
Name string `json:"name"`
} `json:"self"`
} `json:"links"`
}
func CreatePR ¶ added in v0.2.0
func CreatePR(host, project string, title, description, sourceBranch, destinationBranch string, token Credentials) (CreatePRResponse, error)
type Credentials ¶
type Credentials struct {
User string
Service serviceKind
// contains filtered or unexported fields
}
func (*Credentials) CliFlags ¶
func (c *Credentials) CliFlags() []cli.Flag
func (*Credentials) Token ¶
func (c *Credentials) Token() string
type FakeTransport ¶ added in v0.2.0
type FakeTransport struct{}
type GitlabJob ¶
type GitlabJob struct {
ID int64 `json:"id"`
Status string `json:"status"`
Stage string `json:"stage"`
Name string `json:"name"`
Coverage interface{} `json:"coverage"`
Duration *float64 `json:"duration"`
User struct {
Username string `json:"username"`
Name string `json:"name"`
} `json:"user"`
WebUrl string `json:"web_url"`
}
func GetLatestJobs ¶
func GetLatestJobs(host, project string, pipelineID int, token Credentials) ([]GitlabJob, error)
func GetLatestTriggeredJobs ¶
func GetLatestTriggeredJobs(host, project string, pipelineID int, token Credentials) ([]GitlabJob, error)
type GitlabPipeline ¶
type GitlabPipeline struct {
Id int `json:"id"`
Ref string `json:"ref"`
WebUrl string `json:"web_url"`
}
func GetLatestPipeline ¶
func GetLatestPipeline(host, project, ref string, token Credentials) (GitlabPipeline, error)
type HttpSettings ¶ added in v0.2.0
type HttpSettings struct {
WithFakeHttpTransport bool
}
func (*HttpSettings) CliFlags ¶ added in v0.2.0
func (c *HttpSettings) CliFlags() []cli.Flag
type RetryJobResponse ¶ added in v0.1.2
func RetryJob ¶ added in v0.1.2
func RetryJob(host, project string, jobID int64, token Credentials) (RetryJobResponse, error)
type RunJobResponse ¶ added in v0.1.2
func RunJob ¶ added in v0.1.2
func RunJob(host, project string, jobID int64, token Credentials) (RunJobResponse, error)
type ServiceInfo ¶ added in v0.2.0
type ServiceInfo struct {
Host string
RefName string
ProjectName string
LastCommitMsg string
HeadBranch string
}
func (*ServiceInfo) CliFlags ¶ added in v0.2.0
func (g *ServiceInfo) CliFlags() []cli.Flag
type StatusProps ¶
StatusProps a structure for status properties
Click to show internal directories.
Click to hide internal directories.