Documentation
¶
Index ¶
- Variables
- func AppContextPath(envar string, getDir func() (string, error), rel ...string) (string, error)
- func HookDir() (string, error)
- func LoadAlternative[T store.Content](ctx context.Context, initial func() T, loaders ...store.Loader[T]) (T, error)
- func LocationFormatter(v string) (repository.LocationFormat, error)
- func OverlayDir() (string, error)
- func ScriptDir() (string, error)
- type BundleDumpFlags
- type BundleRestoreFlags
- type CloneFlags
- type CreateFlags
- type CwdFlags
- type DefaultNameStore
- type DefaultNameStoreV0
- type ExtraStore
- type Flags
- type FlagsStore
- type FlagsStoreV0
- type ForkFlags
- type HookStore
- type ListFlags
- type OverlayContentStore
- func (cs *OverlayContentStore) Open(ctx context.Context, overlayID string) (io.ReadCloser, error)
- func (cs *OverlayContentStore) Remove(ctx context.Context, overlayID string) error
- func (cs *OverlayContentStore) Save(ctx context.Context, overlayID string, content io.Reader) error
- func (*OverlayContentStore) Source() (string, error)
- type OverlayStore
- type ReposFlags
- type ScriptSourceStore
- func (cs *ScriptSourceStore) Open(ctx context.Context, scriptID string) (io.ReadCloser, error)
- func (cs *ScriptSourceStore) Remove(ctx context.Context, scriptID string) error
- func (cs *ScriptSourceStore) Save(ctx context.Context, scriptID string, content io.Reader) error
- func (*ScriptSourceStore) Source() (string, error)
- type ScriptStore
- type TokenStore
- type TokenStoreV0
- type WorkspaceStore
- type WorkspaceStoreV0
Constants ¶
This section is empty.
Variables ¶
var AppContextPathFunc = AppContextPath
Functions ¶
func AppContextPath ¶ added in v4.0.2
AppContextPath returns the path to the app's configuration file.
If the environment variable `envar` is set, it returns that. Specify a function to get the parent directory where the file will be placed, such as os.UserConfigDir. The `rel` is the relative path to the file from the dir.
It will make the path that is formed as {getDir()}/{AppName=gogh}/{rel...}`
func LoadAlternative ¶
func LoadAlternative[T store.Content](ctx context.Context, initial func() T, loaders ...store.Loader[T]) (T, error)
LoadAlternative loads a value of type T using the provided loaders. It tries each loader in order until one succeeds or all fail. If all loaders fail, it returns the initial value provided by the initial function.
func LocationFormatter ¶
func LocationFormatter(v string) (repository.LocationFormat, error)
func OverlayDir ¶ added in v4.0.2
OverlayDir returns the path to the overlay directory.
Types ¶
type BundleDumpFlags ¶
type BundleDumpFlags struct {
File string `yaml:"file,omitempty" toml:"file,omitempty"`
}
BundleDumpFlags is a struct that contains flags for dumping a bundle.
type BundleRestoreFlags ¶
type BundleRestoreFlags struct {
File string `yaml:"file,omitempty" toml:"file,omitempty"`
CloneRetryTimeout time.Duration `yaml:"cloneRetryTimeout,omitempty" toml:"clone-retry-timeout,omitempty"`
CloneRetryLimit int `yaml:"cloneRetryLimit,omitempty" toml:"clone-retry-limit,omitempty"`
DryRun bool `yaml:"-" toml:"-"`
}
BundleRestoreFlags is a struct that contains flags for restoring a bundle.
type CloneFlags ¶
type CloneFlags struct {
CloneRetryTimeout time.Duration `yaml:"cloneRetryTimeout,omitempty" toml:"clone-retry-timeout,omitempty"`
DryRun bool `yaml:"-" toml:"-"`
}
CloneFlags is a struct that contains flags for cloning a repository.
type CreateFlags ¶
type CreateFlags struct {
Template string `yaml:"template,omitempty" toml:"template,omitempty"`
Description string `yaml:"-" toml:"-"`
Homepage string `yaml:"-" toml:"-"`
LicenseTemplate string `yaml:"licenseTemplate,omitempty" toml:"license-template,omitempty"`
GitignoreTemplate string `yaml:"gitignoreTemplate,omitempty" toml:"gitignore-template,omitempty"`
CloneRetryTimeout time.Duration `yaml:"cloneRetryTimeout,omitempty" toml:"clone-retry-timeout,omitempty"`
CloneRetryLimit int `yaml:"cloneRetryLimit,omitempty" toml:"clone-retry-limit,omitempty"`
DisableWiki bool `yaml:"disableWiki,omitempty" toml:"disable-wiki,omitempty"`
DisableDownloads bool `yaml:"disableDownloads,omitempty" toml:"disable-downloads,omitempty"`
IsTemplate bool `yaml:"-" toml:"-"`
AutoInit bool `yaml:"autoInit,omitempty" toml:"auto-init,omitempty"`
DisableProjects bool `yaml:"disableProjects,omitempty" toml:"disable-projects,omitempty"`
DisableIssues bool `yaml:"disableIssues,omitempty" toml:"disable-issues,omitempty"`
PreventSquashMerge bool `yaml:"preventSquashMerge,omitempty" toml:"prevent-squash-merge,omitempty"`
PreventMergeCommit bool `yaml:"preventMergeCommit,omitempty" toml:"prevent-merge-commit,omitempty"`
PreventRebaseMerge bool `yaml:"preventRebaseMerge,omitempty" toml:"prevent-rebase-merge,omitempty"`
DeleteBranchOnMerge bool `yaml:"deleteBranchOnMerge,omitempty" toml:"delete-branch-on-merge,omitempty"`
Private bool `yaml:"private,omitempty" toml:"private,omitempty"`
IncludeAllBranches bool `yaml:"includeAllBranches,omitempty" toml:"include-all-branches,omitempty"`
DryRun bool `yaml:"-" toml:"-"`
}
CreateFlags is a struct that contains flags for creating a repository.
type CwdFlags ¶
type CwdFlags struct {
Format string `yaml:"format,omitempty" toml:"format,omitempty"`
}
CwdFlags is a struct that contains flags for the cwd command.
type DefaultNameStore ¶
type DefaultNameStore struct{}
func NewDefaultNameStore ¶
func NewDefaultNameStore() *DefaultNameStore
func (*DefaultNameStore) Load ¶
func (d *DefaultNameStore) Load(ctx context.Context, initial func() repository.DefaultNameService) (repository.DefaultNameService, error)
Load implements repository.DefaultNameRepository.
func (*DefaultNameStore) Save ¶
func (d *DefaultNameStore) Save(ctx context.Context, ds repository.DefaultNameService, force bool) error
Save implements repository.DefaultNameRepository.
func (*DefaultNameStore) Source ¶
func (*DefaultNameStore) Source() (string, error)
type DefaultNameStoreV0 ¶
type DefaultNameStoreV0 struct{}
func NewDefaultNameStoreV0 ¶
func NewDefaultNameStoreV0() *DefaultNameStoreV0
func (*DefaultNameStoreV0) Load ¶
func (d *DefaultNameStoreV0) Load(ctx context.Context, initial func() repository.DefaultNameService) (repository.DefaultNameService, error)
Load implements store.Loader.
func (*DefaultNameStoreV0) Source ¶
func (*DefaultNameStoreV0) Source() (string, error)
type ExtraStore ¶ added in v4.0.2
type ExtraStore struct{}
ExtraStore stores extra configuration
func NewExtraStore ¶ added in v4.0.2
func NewExtraStore() *ExtraStore
NewExtraStore creates a new extra store
func (*ExtraStore) Load ¶ added in v4.0.2
func (s *ExtraStore) Load(ctx context.Context, initial func() extra.ExtraService) (extra.ExtraService, error)
Load loads extra configuration
func (*ExtraStore) Save ¶ added in v4.0.2
func (s *ExtraStore) Save(ctx context.Context, svc extra.ExtraService, force bool) error
Save saves extra configuration
func (*ExtraStore) Source ¶ added in v4.0.2
func (s *ExtraStore) Source() (string, error)
Source returns the path to the extra store file
type Flags ¶
type Flags struct {
RawHasChanges bool `yaml:"-" toml:"-"` // RawHasChanges is used to track if there are any changes in the flags.
BundleDump BundleDumpFlags `yaml:"bundleDump,omitempty" toml:"bundle-dump,omitempty"`
BundleRestore BundleRestoreFlags `yaml:"bundleRestore,omitempty" toml:"bundle-restore,omitempty"`
Clone CloneFlags `yaml:"clone,omitempty" toml:"clone"`
List ListFlags `yaml:"list,omitempty" toml:"list,omitempty"`
Cwd CwdFlags `yaml:"cwd,omitempty" toml:"cwd,omitempty"`
Create CreateFlags `yaml:"create,omitempty" toml:"create,omitempty"`
Repos ReposFlags `yaml:"repos,omitempty" toml:"repos,omitempty"`
Fork ForkFlags `yaml:"fork,omitempty" toml:"fork,omitempty"`
}
Flags is a struct that contains all the flags for the application.
func DefaultFlags ¶
func DefaultFlags() *Flags
func (*Flags) HasChanges ¶
HasChanges always returns false because Flags does not support saving.
type FlagsStore ¶
type FlagsStore struct{}
FlagsStore is a store for flags.
func (*FlagsStore) Source ¶
func (s *FlagsStore) Source() (string, error)
type FlagsStoreV0 ¶
type FlagsStoreV0 struct{}
func NewFlagsStoreV0 ¶
func NewFlagsStoreV0() *FlagsStoreV0
func (*FlagsStoreV0) Source ¶
func (d *FlagsStoreV0) Source() (string, error)
Source implements store.Loader
type ForkFlags ¶
type ForkFlags struct {
To string `yaml:"-" toml:"-"`
DefaultBranchOnly bool `yaml:"defaultBranchOnly,omitempty" toml:"default-branch-only,omitempty"`
CloneRetryTimeout time.Duration `yaml:"cloneRetryTimeout,omitempty" toml:"clone-retry-timeout,omitempty"`
CloneRetryLimit int `yaml:"cloneRetryLimit,omitempty" toml:"clone-retry-limit,omitempty"`
}
ForkFlags is a struct that contains flags for forking a repository.
type HookStore ¶ added in v4.0.2
type HookStore struct{}
func NewHookStore ¶ added in v4.0.2
func NewHookStore() *HookStore
func (*HookStore) Load ¶ added in v4.0.2
func (s *HookStore) Load(ctx context.Context, initial func() hook.HookService) (hook.HookService, error)
type ListFlags ¶
type ListFlags struct {
Limit int `yaml:"limit,omitempty" toml:"limit,omitempty"`
Patterns []string `yaml:"-" toml:"-"`
Format string `yaml:"format,omitempty" toml:"format,omitempty"`
Primary bool `yaml:"primary,omitempty" toml:"primary,omitempty"`
}
ListFlags is a struct that contains flags for listing repositories.
type OverlayContentStore ¶ added in v4.0.2
type OverlayContentStore struct{}
func NewOverlayContentStore ¶ added in v4.0.2
func NewOverlayContentStore() *OverlayContentStore
func (*OverlayContentStore) Open ¶ added in v4.0.2
func (cs *OverlayContentStore) Open(ctx context.Context, overlayID string) (io.ReadCloser, error)
func (*OverlayContentStore) Remove ¶ added in v4.0.2
func (cs *OverlayContentStore) Remove(ctx context.Context, overlayID string) error
func (*OverlayContentStore) Source ¶ added in v4.0.2
func (*OverlayContentStore) Source() (string, error)
type OverlayStore ¶ added in v4.0.2
type OverlayStore struct{}
OverlayStore implements overlay.OverlayStore and persists overlays as TOML.
func NewOverlayStore ¶ added in v4.0.2
func NewOverlayStore() *OverlayStore
func (*OverlayStore) Load ¶ added in v4.0.2
func (s *OverlayStore) Load(ctx context.Context, initial func() overlay.OverlayService) (overlay.OverlayService, error)
func (*OverlayStore) Save ¶ added in v4.0.2
func (s *OverlayStore) Save(ctx context.Context, svc overlay.OverlayService, force bool) error
func (*OverlayStore) Source ¶ added in v4.0.2
func (s *OverlayStore) Source() (string, error)
type ReposFlags ¶
type ReposFlags struct {
Limit int `yaml:"limit,omitempty" toml:"limit,omitempty"`
Privacy string `yaml:"privacy,omitempty" toml:"privacy,omitempty"`
Fork string `yaml:"fork,omitempty" toml:"fork,omitempty"`
Archive string `yaml:"archived,omitempty" toml:"archived,omitempty"`
Format string `yaml:"format,omitempty" toml:"format,omitempty"`
Color string `yaml:"color,omitempty" toml:"color,omitempty"`
Relation []string `yaml:"relation,omitempty" toml:"relation,omitempty"`
Sort string `yaml:"sort,omitempty" toml:"sort,omitempty"`
Order string `yaml:"order,omitempty" toml:"order,omitempty"`
}
ReposFlags is a struct that contains flags for the repos command.
type ScriptSourceStore ¶ added in v4.0.2
type ScriptSourceStore struct{}
func NewScriptSourceStore ¶ added in v4.0.2
func NewScriptSourceStore() *ScriptSourceStore
func (*ScriptSourceStore) Open ¶ added in v4.0.2
func (cs *ScriptSourceStore) Open(ctx context.Context, scriptID string) (io.ReadCloser, error)
func (*ScriptSourceStore) Remove ¶ added in v4.0.2
func (cs *ScriptSourceStore) Remove(ctx context.Context, scriptID string) error
func (*ScriptSourceStore) Source ¶ added in v4.0.2
func (*ScriptSourceStore) Source() (string, error)
type ScriptStore ¶ added in v4.0.2
type ScriptStore struct{}
func NewScriptStore ¶ added in v4.0.2
func NewScriptStore() *ScriptStore
func (*ScriptStore) Load ¶ added in v4.0.2
func (s *ScriptStore) Load(ctx context.Context, initial func() script.ScriptService) (script.ScriptService, error)
func (*ScriptStore) Save ¶ added in v4.0.2
func (s *ScriptStore) Save(ctx context.Context, svc script.ScriptService, force bool) error
func (*ScriptStore) Source ¶ added in v4.0.2
func (s *ScriptStore) Source() (string, error)
type TokenStore ¶
type TokenStore struct{}
TokenStore is a repository for managing token configuration.
func NewTokenStore ¶
func NewTokenStore() *TokenStore
func (*TokenStore) Load ¶
func (d *TokenStore) Load(ctx context.Context, initial func() auth.TokenService) (auth.TokenService, error)
Load implements store.Store.
func (*TokenStore) Save ¶
func (d *TokenStore) Save(ctx context.Context, ds auth.TokenService, force bool) error
Save implements store.Store.
func (*TokenStore) Source ¶
func (d *TokenStore) Source() (string, error)
type TokenStoreV0 ¶
type TokenStoreV0 struct{}
TokenStoreV0 is a repository for managing token configuration.
func NewTokenStoreV0 ¶
func NewTokenStoreV0() *TokenStoreV0
func (*TokenStoreV0) Load ¶
func (d *TokenStoreV0) Load(ctx context.Context, initial func() auth.TokenService) (auth.TokenService, error)
Load implements store.Loader
func (*TokenStoreV0) Source ¶
func (*TokenStoreV0) Source() (string, error)
type WorkspaceStore ¶
type WorkspaceStore struct{}
WorkspaceStore is a repository for managing workspace configuration.
func NewWorkspaceStore ¶
func NewWorkspaceStore() *WorkspaceStore
NewWorkspaceStore creates a new WorkspaceStore instance.
func (*WorkspaceStore) Load ¶
func (w *WorkspaceStore) Load(ctx context.Context, initial func() workspace.WorkspaceService) (workspace.WorkspaceService, error)
Load implements store.Store.
func (*WorkspaceStore) Save ¶
func (w *WorkspaceStore) Save(ctx context.Context, ws workspace.WorkspaceService, force bool) error
Save implements workspace.WorkspaceRepository.
func (*WorkspaceStore) Source ¶
func (*WorkspaceStore) Source() (string, error)
type WorkspaceStoreV0 ¶
type WorkspaceStoreV0 struct{}
WorkspaceStoreV0 is a repository for managing workspace configuration.
func NewWorkspaceStoreV0 ¶
func NewWorkspaceStoreV0() *WorkspaceStoreV0
NewWorkspaceStoreV0 creates a new WorkspaceStore instance.
func (*WorkspaceStoreV0) Load ¶
func (w *WorkspaceStoreV0) Load(ctx context.Context, initial func() workspace.WorkspaceService) (workspace.WorkspaceService, error)
Load implements store.Loader
func (*WorkspaceStoreV0) Source ¶
func (*WorkspaceStoreV0) Source() (string, error)