config

package
v4.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigYamlFileName = "config.yaml"
View Source
const ConfigYmlFileName = "config.yml"
View Source
const DEFAULT_XDG_CONFIG_DIRNAME = ".config"
View Source
const DashDir = "gh-dash"

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorTheme

type ColorTheme struct {
	Text       ColorThemeText       `yaml:"text"       validate:"required"`
	Background ColorThemeBackground `yaml:"background" validate:"required"`
	Border     ColorThemeBorder     `yaml:"border"     validate:"required"`
}

type ColorThemeBackground

type ColorThemeBackground struct {
	Selected HexColor `yaml:"selected" validate:"hexcolor"`
}

type ColorThemeBorder

type ColorThemeBorder struct {
	Primary   HexColor `yaml:"primary"   validate:"hexcolor"`
	Secondary HexColor `yaml:"secondary" validate:"hexcolor"`
	Faint     HexColor `yaml:"faint"     validate:"hexcolor"`
}

type ColorThemeConfig

type ColorThemeConfig struct {
	Inline ColorTheme `yaml:",inline"`
}

type ColorThemeText

type ColorThemeText struct {
	Primary   HexColor `yaml:"primary"   validate:"hexcolor"`
	Secondary HexColor `yaml:"secondary" validate:"hexcolor"`
	Inverted  HexColor `yaml:"inverted"  validate:"hexcolor"`
	Faint     HexColor `yaml:"faint"     validate:"hexcolor"`
	Warning   HexColor `yaml:"warning"   validate:"hexcolor"`
	Success   HexColor `yaml:"success"   validate:"hexcolor"`
}

type ColumnConfig

type ColumnConfig struct {
	Width  *int  `yaml:"width,omitempty"  validate:"omitempty,gt=0"`
	Hidden *bool `yaml:"hidden,omitempty"`
}

func MergeColumnConfigs

func MergeColumnConfigs(defaultCfg, sectionCfg ColumnConfig) ColumnConfig

type Config

type Config struct {
	PRSections     []PrsSectionConfig    `yaml:"prSections"`
	IssuesSections []IssuesSectionConfig `yaml:"issuesSections"`
	Defaults       Defaults              `yaml:"defaults"`
	Keybindings    Keybindings           `yaml:"keybindings"`
	RepoPaths      map[string]string     `yaml:"repoPaths"`
	Theme          *ThemeConfig          `yaml:"theme,omitempty" validate:"omitempty"`
	Pager          Pager                 `yaml:"pager"`
	ConfirmQuit    bool                  `yaml:"confirmQuit"`
}

func ParseConfig

func ParseConfig(path string) (Config, error)

func (Config) GetFullScreenDiffPagerEnv

func (cfg Config) GetFullScreenDiffPagerEnv() []string

type ConfigParser

type ConfigParser struct{}

type Defaults

type Defaults struct {
	Preview                PreviewConfig `yaml:"preview"`
	PrsLimit               int           `yaml:"prsLimit"`
	IssuesLimit            int           `yaml:"issuesLimit"`
	View                   ViewType      `yaml:"view"`
	Layout                 LayoutConfig  `yaml:"layout,omitempty"`
	RefetchIntervalMinutes int           `yaml:"refetchIntervalMinutes,omitempty"`
	DateFormat             string        `yaml:"dateFormat,omitempty"`
}

type HexColor

type HexColor string

type IssuesLayoutConfig

type IssuesLayoutConfig struct {
	UpdatedAt ColumnConfig `yaml:"updatedAt,omitempty"`
	State     ColumnConfig `yaml:"state,omitempty"`
	Repo      ColumnConfig `yaml:"repo,omitempty"`
	Title     ColumnConfig `yaml:"title,omitempty"`
	Creator   ColumnConfig `yaml:"creator,omitempty"`
	Assignees ColumnConfig `yaml:"assignees,omitempty"`
	Comments  ColumnConfig `yaml:"comments,omitempty"`
	Reactions ColumnConfig `yaml:"reactions,omitempty"`
}

type IssuesSectionConfig

type IssuesSectionConfig struct {
	Title   string
	Filters string
	Limit   *int               `yaml:"limit,omitempty"`
	Layout  IssuesLayoutConfig `yaml:"layout,omitempty"`
}

func (IssuesSectionConfig) ToSectionConfig

func (cfg IssuesSectionConfig) ToSectionConfig() SectionConfig

type Keybinding

type Keybinding struct {
	Key     string `yaml:"key"`
	Command string `yaml:"command"`
	Builtin string `yaml:"builtin"`
}

func (Keybinding) NewBinding added in v4.2.0

func (kb Keybinding) NewBinding(previous *key.Binding) key.Binding

type Keybindings

type Keybindings struct {
	Universal []Keybinding `yaml:"universal"`
	Issues    []Keybinding `yaml:"issues"`
	Prs       []Keybinding `yaml:"prs"`
}

type LayoutConfig

type LayoutConfig struct {
	Prs    PrsLayoutConfig    `yaml:"prs,omitempty"`
	Issues IssuesLayoutConfig `yaml:"issues,omitempty"`
}

type Pager

type Pager struct {
	Diff string `yaml:"diff"`
}

type PreviewConfig

type PreviewConfig struct {
	Open  bool
	Width int
}

type PrsLayoutConfig

type PrsLayoutConfig struct {
	UpdatedAt    ColumnConfig `yaml:"updatedAt,omitempty"`
	Repo         ColumnConfig `yaml:"repo,omitempty"`
	Author       ColumnConfig `yaml:"author,omitempty"`
	Assignees    ColumnConfig `yaml:"assignees,omitempty"`
	Title        ColumnConfig `yaml:"title,omitempty"`
	Base         ColumnConfig `yaml:"base,omitempty"`
	ReviewStatus ColumnConfig `yaml:"reviewStatus,omitempty"`
	State        ColumnConfig `yaml:"state,omitempty"`
	Ci           ColumnConfig `yaml:"ci,omitempty"`
	Lines        ColumnConfig `yaml:"lines,omitempty"`
}

type PrsSectionConfig

type PrsSectionConfig struct {
	Title   string
	Filters string
	Limit   *int            `yaml:"limit,omitempty"`
	Layout  PrsLayoutConfig `yaml:"layout,omitempty"`
}

func (PrsSectionConfig) ToSectionConfig

func (cfg PrsSectionConfig) ToSectionConfig() SectionConfig

type SectionConfig

type SectionConfig struct {
	Title   string
	Filters string
	Limit   *int `yaml:"limit,omitempty"`
}

type TableUIThemeConfig

type TableUIThemeConfig struct {
	ShowSeparator bool `yaml:"showSeparator" default:"true"`
	Compact       bool `yaml:"compact" default:"false"`
}

type ThemeConfig

type ThemeConfig struct {
	Ui     UIThemeConfig     `yaml:"ui,omitempty"     validate:"omitempty"`
	Colors *ColorThemeConfig `yaml:"colors,omitempty" validate:"omitempty"`
}

type UIThemeConfig

type UIThemeConfig struct {
	SectionsShowCount bool               `yaml:"sectionsShowCount" default:"true"`
	Table             TableUIThemeConfig `yaml:"table"`
}

type ViewType

type ViewType string
const (
	PRsView    ViewType = "prs"
	IssuesView ViewType = "issues"
)

Jump to

Keyboard shortcuts

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