Documentation
¶
Index ¶
- Variables
- func Bin(_ context.Context, ev Env) error
- func Cleanup(ev Env) error
- func ConfigGet(cfg *env.Config, optionName string) error
- func ConfigGetAll(_ Env, cfg *env.Config) error
- func ConfigSet(ev Env, cfg *env.Config, optionName, optionValue string) error
- func ConfigUnset(ev Env, cfg *env.Config, optionName string) error
- func Dump(ev Env, bundleFile string) error
- func Get(ctx context.Context, ev Env, spec gordon.VersionSpec) error
- func InitLog()
- func Initialize(_ context.Context, ev Env) error
- func Install(ctx context.Context, ev Env, spec gordon.VersionSpec) error
- func Restore(ctx context.Context, ev Env, bundle string) error
- func Setup(_ context.Context, ev Env, cfg *env.Config, force bool) error
- func Uninstall(ctx context.Context, ev Env, spec gordon.AppSpec) error
- func Update(ctx context.Context, ev Env, spec gordon.AppSpec) error
- func UpdateAll(ctx context.Context, ev Env) error
- type Env
- type HubClient
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TokenManager = hub.NewFileForHost
Functions ¶
func ConfigSet ¶ added in v0.0.4
Example ¶
package main
import (
"log"
"os"
"strings"
"github.com/kyoh86/gordon/internal/command"
"github.com/kyoh86/gordon/internal/env"
)
func main() {
source := strings.NewReader(`
hooks:
- /hook1
githubUser: userx1
githubHost: hostx1`)
config, access, err := env.GetAppenv(source, env.EnvarPrefix)
if err != nil {
log.Fatalln(err)
}
if err := command.ConfigSet(&access, &config, "github.host", "hostx2"); err != nil {
log.Fatalln(err)
}
if err := config.Save(os.Stdout); err != nil {
log.Fatalln(err)
}
if err := command.ConfigGetAll(nil, &config); err != nil {
log.Fatalln(err)
}
}
Output: hooks: - /hook1 githubHost: hostx2 githubUser: userx1 hooks: /hook1 github.host: hostx2 github.user: userx1 github.token: ***** architecture: os: cache: bin: man:
func ConfigUnset ¶
Example ¶
package main
import (
"log"
"os"
"strings"
"github.com/kyoh86/gordon/internal/command"
"github.com/kyoh86/gordon/internal/env"
)
func main() {
source := strings.NewReader(`
hooks:
- /hook1
githubUser: userx1
githubHost: hostx1`)
config, access, err := env.GetAppenv(source, env.EnvarPrefix)
if err != nil {
log.Fatalln(err)
}
if err := command.ConfigUnset(&access, &config, "github.host"); err != nil {
log.Fatalln(err)
}
if err := config.Save(os.Stdout); err != nil {
log.Fatalln(err)
}
if err := command.ConfigGetAll(nil, &config); err != nil {
log.Fatalln(err)
}
}
Output: hooks: - /hook1 githubUser: userx1 hooks: /hook1 github.host: github.user: userx1 github.token: ***** architecture: os: cache: bin: man:
Types ¶
type Env ¶ added in v0.0.4
type Env interface {
Architecture() string
Bin() string
Cache() string
GithubHost() string
GithubUser() string
Hooks() []string
Man() string
OS() string
}
Env is an interface generated for "github.com/kyoh86/gordon/internal/env.Access".
type HubClient ¶ added in v0.0.4
type HubClient interface {
Asset(context.Context, *gogh.Repo, int64) (io.ReadCloser, error)
LatestRelease(context.Context, *gogh.Repo) (*github.RepositoryRelease, error)
Release(context.Context, *gogh.Repo, string) (*github.RepositoryRelease, error)
}
HubClient is an interface generated for "github.com/kyoh86/gordon/internal/hub.Client".
Click to show internal directories.
Click to hide internal directories.