internal

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

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(href string, text string) string

func GetCurrentGitProjectName

func GetCurrentGitProjectName() (string, string, error)

func GetCurrentGitRef

func GetCurrentGitRef() (string, error)

Types

type Credentials

type Credentials struct {
	User    string
	Service string
	// contains filtered or unexported fields
}

func (*Credentials) CliFlags

func (c *Credentials) CliFlags() []cli.Flag

func (*Credentials) Parse

func (c *Credentials) Parse(cCtx *cli.Context) error

func (*Credentials) Token

func (c *Credentials) Token() string

type GitlabInfo

type GitlabInfo struct {
	GitlabHost  string
	RefName     string
	ProjectName string
}

func (*GitlabInfo) CliFlags

func (g *GitlabInfo) CliFlags() []cli.Flag

func (*GitlabInfo) Parse

func (g *GitlabInfo) Parse(cCtx *cli.Context) error

type GitlabJob

type GitlabJob struct {
	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 string) ([]GitlabJob, error)

func GetLatestTriggeredJobs

func GetLatestTriggeredJobs(host, project string, pipelineID int, token string) ([]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, token string) (GitlabPipeline, error)

type StatusProps

type StatusProps struct {
	Emoji string
	Style lipgloss.Style
}

StatusProps a structure for status properties

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL