config

package
v0.0.0-...-43eb7a3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLanguage = "en"
	DefaultCodeLang = "go"

	DefaultEditor = "neovim"
)

Variables

View Source
var (
	ErrConfigNotExist     = errors.New("no config found, try `leetgo config`")
	ErrInvalidLang        = errors.New("only cn or en language supported")
	ErrInvalidCodeLang    = errors.New("not supported code language")
	ErrUnSupporttedEditor = errors.New("only vim and neovim/nvim supported")

	CfgDir = "."
)

Functions

func DisplayLang

func DisplayLang(lang string) string

func GetCodeFileExt

func GetCodeFileExt(codeLang string) string

func GetEditorCmdOps

func GetEditorCmdOps(editor string) (string, []string)

func IsDefaultLang

func IsDefaultLang() bool

func IsGolang

func IsGolang(cfg *Config) bool

func LeetcodeLang

func LeetcodeLang(lang string) string

func SrpportedLang

func SrpportedLang(lang string) bool

func SupportedCodeLang

func SupportedCodeLang(codeLang string) bool

func SupportedEditor

func SupportedEditor(editor string) bool

Types

type Config

type Config struct {
	Language string `json:"language,omitempty"`
	CodeLang string `json:"codeLang,omitempty"`
	Editor   string `json:"editor,omitempty"`
}

func Get

func Get() (*Config, error)

func Write

func Write(cfg *Config) (*Config, error)

Jump to

Keyboard shortcuts

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