Documentation
¶
Index ¶
Constants ¶
const ( EnvTokenKey = "GITHUB_TOKEN" ConfigFileName = "go-gists.ini" // Defaults DefaultMinTableWidth = 100 // narrower → compact list mode DefaultDescRatio = 55 // 55% description, 45% URL )
Variables ¶
This section is empty.
Functions ¶
func ConfigFilePath ¶
ConfigFilePath returns the resolved config file path.
func Save ¶
Save persists the token (and current display defaults if the file is new) to the config file without overwriting existing display settings.
func SaveDisplay ¶ added in v1.0.1
func SaveDisplay(d DisplayConfig) error
SaveDisplay writes only the display settings to the config file.
Types ¶
type Config ¶
type Config struct {
Token string
Display DisplayConfig
}
Config holds the full application configuration.
type DisplayConfig ¶ added in v1.0.1
type DisplayConfig struct {
// MinTableWidth is the terminal width (columns) below which compact list
// mode is used instead of the full 4-column table.
MinTableWidth int
// DescRatio is the percentage of the flexible width (after # and ID columns
// are accounted for) that is allocated to the Description column.
// The remaining percentage goes to URL. Range: 1–99.
DescRatio int
}
DisplayConfig controls how the list output is rendered.
type ErrTokenNotFound ¶
type ErrTokenNotFound struct{ Path string }
ErrTokenNotFound is returned when no token can be resolved.
func (ErrTokenNotFound) Error ¶
func (e ErrTokenNotFound) Error() string