source

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKey = map[S]string{
	Npm:       "https://registry.npmjs.org/",
	Yarn:      "https://registry.yarnpkg.com/",
	Tencent:   "https://mirrors.cloud.tencent.com/npm/",
	NpmMirror: "https://registry.npmmirror.com/",
}
View Source
var DefaultSource = map[string]S{
	"https://registry.npmjs.org/":            Npm,
	"https://registry.yarnpkg.com/":          Yarn,
	"https://mirrors.cloud.tencent.com/npm/": Tencent,
	"https://registry.npmmirror.com/":        NpmMirror,
}
View Source
var SourceToString = []string{
	"npm",
	"yarn",
	"tencet",
	"npmMirror",
	"system",
}

Functions

func ReadConf added in v0.9.2

func ReadConf(path string) (url string, err error)

Types

type GrmConfig

type GrmConfig struct {
	BaseDir  string
	ConfPath string
	Paths    []string
	// contains filtered or unexported fields
}

func NewGrmConf

func NewGrmConf() *GrmConfig

func (*GrmConfig) Files added in v0.9.2

func (g *GrmConfig) Files() map[string]string

func (*GrmConfig) GetCurrentConf

func (g *GrmConfig) GetCurrentConf() string

func (*GrmConfig) GetCurrentPath

func (g *GrmConfig) GetCurrentPath() string

func (*GrmConfig) ListAllPath

func (g *GrmConfig) ListAllPath()

func (*GrmConfig) MergePaths

func (g *GrmConfig) MergePaths(userConf map[string]string) map[string]string

func (*GrmConfig) ScannerUserConf

func (g *GrmConfig) ScannerUserConf() (source, key map[string]string)

func (*GrmConfig) SetCurrentPath

func (g *GrmConfig) SetCurrentPath(target string) bool

type GrmIni

type GrmIni struct {
	Path string
	// contains filtered or unexported fields
}

func NewGrmIniParse

func NewGrmIniParse(conf *GrmConfig) *GrmIni

func (*GrmIni) Get

func (i *GrmIni) Get(k string)

func (*GrmIni) Set

func (i *GrmIni) Set(k, v string) bool

func (*GrmIni) ToString

func (i *GrmIni) ToString() string

type S

type S uint8
const (
	Npm S = iota
	Yarn
	Tencent
	NpmMirror
	System
)

func EnsureDefaultKey

func EnsureDefaultKey(input string) S

func (S) String

func (s S) String() string

Jump to

Keyboard shortcuts

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