Documentation ¶
Index ¶
- Constants
- func IsDir(pth ...string) (bool, error)
- func IsFile(pth ...string) (bool, error)
- func MkdirAll(pth ...string) error
- func PathGlobCompile(s string) (g glob.Glob, err error)
- func TimeString(t time.Time) string
- type BackupFile
- func (b *BackupFile) Each(cb func(header *tar.Header, reader *tar.Reader) error) error
- func (b *BackupFile) EachRoot(rootName string, cb func(header *tar.Header, reader *tar.Reader) error) error
- func (b *BackupFile) Extract(rootName, target string, options ExtractOptions) error
- func (b *BackupFile) GetRootName() (name string, err error)
- type BackupOptions
- type ExtractOptions
- type GoBinVersion
- type GoEnv
- func (env *GoEnv) ActivateCode(name string) (string, error)
- func (env *GoEnv) Backup(name string, options *BackupOptions) (string, error)
- func (env *GoEnv) CreateActivate(pth, goRoot string) error
- func (env *GoEnv) GetCheck(name string) (pth string, err error)
- func (env *GoEnv) GetPath(name string, require bool) (pth string, err error)
- func (env *GoEnv) Init(name, goroot string) (err error)
- func (env *GoEnv) Ls() (names []string, err error)
- func (env *GoEnv) Restore(options *RestoreOptions) (string, error)
- func (env *GoEnv) Rm(name string, delete bool) (string, error)
- func (env *GoEnv) SetGoVersion(envName, goRoot string) error
- func (env *GoEnv) TempDir() (pth string, err error)
- type GoEnvCmd
- func (cmd *GoEnvCmd) ActivateCode(name string) error
- func (env *GoEnvCmd) Backup(name string, options *BackupOptions) error
- func (cmd *GoEnvCmd) Init(names ...string) (err error)
- func (cmd *GoEnvCmd) Ls() error
- func (env *GoEnvCmd) Restore(options *RestoreOptions) error
- func (cmd *GoEnvCmd) Rm(name string, delete bool) error
- func (cmd *GoEnvCmd) Setup() error
- func (cmd *GoEnvCmd) Update(envs []string) error
- func (cmd *GoEnvCmd) UpdateAll() error
- type GoVersion
- type GoVersions
- func (v *GoVersions) Available(desc bool, terms ...string) ([]*GoVersion, error)
- func (v *GoVersions) Dir() string
- func (v *GoVersions) DirExists() (pth string, exists bool, err error)
- func (v *GoVersions) Download(names ...string) (versions []*GoVersion, err error)
- func (vs *GoVersions) Install(names ...string) (versions []*GoVersion, err error)
- func (v *GoVersions) Ls() (vs []*GoVersion, err error)
- func (v *GoVersions) Set(versionName, envName string) (err error)
- type Header
- type Patterns
- type RestoreOptions
- type ValidFunc
Constants ¶
View Source
const VERSIONS_BASENAME = ".goversions"
Variables ¶
This section is empty.
Functions ¶
func TimeString ¶
Types ¶
type BackupFile ¶
func NewBackupReader ¶
func NewBackupReader(reader io.Reader, archive bool) (bkp *BackupFile, err error)
func (*BackupFile) Extract ¶
func (b *BackupFile) Extract(rootName, target string, options ExtractOptions) error
func (*BackupFile) GetRootName ¶
func (b *BackupFile) GetRootName() (name string, err error)
type BackupOptions ¶
type ExtractOptions ¶
type ExtractOptions int
const ( Verbose ExtractOptions = 1 << iota Trial )
func (ExtractOptions) IsTrial ¶
func (o ExtractOptions) IsTrial() bool
func (ExtractOptions) IsVerbose ¶
func (o ExtractOptions) IsVerbose() bool
type GoBinVersion ¶
func NewGoBinVersion ¶
func NewGoBinVersion(binName string) (*GoBinVersion, error)
type GoEnv ¶
type GoEnv struct {
DbDir string
}
func (*GoEnv) Backup ¶
func (env *GoEnv) Backup(name string, options *BackupOptions) (string, error)
func (*GoEnv) CreateActivate ¶
func (*GoEnv) SetGoVersion ¶
type GoEnvCmd ¶
type GoEnvCmd struct {
Env *GoEnv
}
func (*GoEnvCmd) ActivateCode ¶
func (*GoEnvCmd) Restore ¶
func (env *GoEnvCmd) Restore(options *RestoreOptions) error
type GoVersion ¶
type GoVersion struct { ID string Name string UpdatedAt time.Time Installed bool Root string System bool BinVersion *GoBinVersion // contains filtered or unexported fields }
func GetSystemGoVersion ¶
func NewGoVersion ¶
func (*GoVersion) DownloadPath ¶
func (*GoVersion) DownloadUrl ¶
type GoVersions ¶
type GoVersions struct {
Env *GoEnv
}
func NewGoVersions ¶
func NewGoVersions(env *GoEnv) *GoVersions
func (*GoVersions) Available ¶
func (v *GoVersions) Available(desc bool, terms ...string) ([]*GoVersion, error)
func (*GoVersions) Dir ¶
func (v *GoVersions) Dir() string
func (*GoVersions) DirExists ¶
func (v *GoVersions) DirExists() (pth string, exists bool, err error)
func (*GoVersions) Download ¶
func (v *GoVersions) Download(names ...string) (versions []*GoVersion, err error)
func (*GoVersions) Install ¶
func (vs *GoVersions) Install(names ...string) (versions []*GoVersion, err error)
func (*GoVersions) Ls ¶
func (v *GoVersions) Ls() (vs []*GoVersion, err error)
func (*GoVersions) Set ¶
func (v *GoVersions) Set(versionName, envName string) (err error)
type Header ¶
type Header struct { Comment string // comment Extra []byte // "extra data" ModTime time.Time // modification time Name string // file name OS byte // operating system type }
The gzip file stores a header giving metadata about the compressed file. That header is exposed as the fields of the Writer and Reader structs.
type Patterns ¶ added in v1.1.2
type Patterns struct {
// contains filtered or unexported fields
}
func (*Patterns) ExcludeFunc ¶ added in v1.1.2
type RestoreOptions ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.