config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotExistErr = errors.New("config not exist")
)

Functions

func ConfDir

func ConfDir() string

func ConfFilePath

func ConfFilePath() string

func CustomConfigByName

func CustomConfigByName(name string) (*cmdInfo, error)

func GetConfig

func GetConfig() (*os.File, error)

func OpenConfDir

func OpenConfDir() error

func SSHConfigByName

func SSHConfigByName(sshName string) (internal.SSHConfig, error)

func WritStringToConfig

func WritStringToConfig(d string) (*os.File, error)

func WritTomlToConfig

func WritTomlToConfig(v interface{}) error

Types

type AppConfig

type AppConfig struct {
	SSHInfo sshInfoList `toml:"sshInfo"`
	CmdInfo cmdInfoList `toml:"cmdInfo"`
	// contains filtered or unexported fields
}
var AppConf *AppConfig

func ParseConfig

func ParseConfig() (*AppConfig, error)

func (*AppConfig) ConfigByName

func (a *AppConfig) ConfigByName(name string) (*sshInfo, error)

type Info

type Info interface {
	GetName() string
	GetDesc() string
}

type InfoCollection

type InfoCollection interface {
	GetIterator() InfoIterator
}

type InfoIterator

type InfoIterator interface {
	HasNext() bool
	Next() Info
}

Jump to

Keyboard shortcuts

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