config

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RED_CONFIG_REDMINE_URL        = "RED_CONFIG_REDMINE_URL"
	RED_CONFIG_REDMINE_API_KEY    = "RED_CONFIG_REDMINE_API_KEY"
	RED_CONFIG_REDMINE_PROJECT    = "RED_CONFIG_REDMINE_PROJECT"
	RED_CONFIG_REDMINE_PROJECT_ID = "RED_CONFIG_REDMINE_PROJECT_ID"
	RED_CONFIG_REDMINE_USER_ID    = "RED_CONFIG_REDMINE_USER_ID"
	RED_CONFIG_EDITOR             = "RED_CONFIG_EDITOR"
	RED_CONFIG_PAGER              = "RED_CONFIG_PAGER"
	RED_CONFIG_ISSUE_VIEW_JOURNAL = "RED_CONFIG_ISSUE_VIEW_JOURNAL"

	CONFIG_REDMINE_URL        = "server"
	CONFIG_REDMINE_API_KEY    = "api-key"
	CONFIG_REDMINE_PROJECT    = "project"
	CONFIG_REDMINE_PROJECT_ID = "project-id"
	CONFIG_REDMINE_USER_ID    = "user-id"
	CONFIG_EDITOR             = "editor"
	CONFIG_PAGER              = "pager"
	CONFIG_ISSUE              = "issue"

	CONFIG_FILE   = "config.json"
	CONFIG_FOLDER = ".red"

	DEBUG_FLAG   = "debug"
	DEBUG_FLAG_S = "d"

	ALL_FLAG = "all"
)

Variables

This section is empty.

Functions

func ConfigLocalPath

func ConfigLocalPath() (string, error)

func ConfigPath

func ConfigPath() (string, error)

func CreateTmpFile

func CreateTmpFile(body string) (string, error)

Types

type ConfigIssue_t

type ConfigIssue_t struct {
	ViewJournalAlways bool `json:"view-journal"`
}

type Config_t

type Config_t struct {
	Server    string        `json:"server"`
	ApiKey    string        `mapstructure:"api-key"`
	Project   string        `json:"project"`
	ProjectID int           `mapstructure:"project-id"`
	UserID    int           `mapstructure:"user-id"`
	Editor    string        `json:"editor"`
	Pager     string        `json:"pager"`
	Issue     ConfigIssue_t `json:"issue"`
}

type Red_t

type Red_t struct {
	Spinner *spinner.Spinner
	Client  *http.Client
	Debug   bool     `json:"debug"`
	All     bool     `json:"all"`
	Config  Config_t `json:"config"`
	Cmd     *cobra.Command
	Term    *terminal.Terminal
	Test    bool
}

func InitConfig

func InitConfig() *Red_t

func (*Red_t) ClearAll

func (r *Red_t) ClearAll()

func (*Red_t) IsConfigBad

func (r *Red_t) IsConfigBad() bool

func (*Red_t) LoadConfig

func (r *Red_t) LoadConfig() error

func (*Red_t) Save

func (r *Red_t) Save() error

func (*Red_t) SaveLocalProject

func (r *Red_t) SaveLocalProject(projectID int) error

func (*Red_t) SetApiKey

func (r *Red_t) SetApiKey(apiKey string)

func (*Red_t) SetEditor

func (r *Red_t) SetEditor(v string)

func (*Red_t) SetPager

func (r *Red_t) SetPager(v string)

func (*Red_t) SetProject

func (r *Red_t) SetProject(id string)

func (*Red_t) SetProjectID

func (r *Red_t) SetProjectID(id int)

func (*Red_t) SetServer

func (r *Red_t) SetServer(server string)

func (*Red_t) SetUserID

func (r *Red_t) SetUserID(id int)

Jump to

Keyboard shortcuts

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