Documentation
¶
Index ¶
- Variables
- func Init(dir string) (string, error)
- type IRuntime
- type Include
- type Lock
- type RemoteSpec
- type SourceUri
- type SourceUriFile
- type SourceUriGit
- type SourceUriUrl
- type Spec
- type ToolState
- type Workdir
- func (c *Workdir) Add(ctx context.Context, runtime, program string, alias optional.Val[string], ...) (bool, string, error)
- func (c *Workdir) AddInclude(ctx context.Context, source string, tags []string) (int, error)
- func (c *Workdir) CopySource(ctx context.Context, source string, tags []string) (int, error)
- func (c *Workdir) FindTool(name string) (*structs.Tool, error)
- func (c *Workdir) GetTools(ctx context.Context) ([]ToolState, error)
- func (c *Workdir) RunTool(ctx context.Context, str string, args ...string) error
- func (c *Workdir) Save() error
- func (c *Workdir) Sync(ctx context.Context, maxWorkers int, tags []string) error
- func (c *Workdir) Upgrade(ctx context.Context, tags []string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrToolNotFoundInSpec = errors.New("tool not found in spec")
View Source
var ErrToolNotInstalled = errors.New("tool not installed")
Functions ¶
Types ¶
type IRuntime ¶ added in v0.14.1
type IRuntime interface {
// Parse will parse string with module name. It is used only on `toolset add` step.
// Parse should:
// 1) ensure that this program is valid, exists, and can be installed.
// 2) normalize program name and return a canonical name.
Parse(ctx context.Context, str string) (string, error)
// GetModule returns an information about module (parsed module).
GetModule(ctx context.Context, program string) (*structs.ModuleInfo, error)
// Install will install the program.
Install(ctx context.Context, program string) error
Run(ctx context.Context, program string, args ...string) error
GetLatest(ctx context.Context, module string) (string, bool, error)
}
type Include ¶ added in v0.12.0
func (*Include) UnmarshalJSON ¶ added in v0.14.0
type Lock ¶ added in v0.12.0
type Lock struct {
Tools structs.Tools `json:"tools"`
Remotes []RemoteSpec `json:"remotes"`
}
type RemoteSpec ¶ added in v0.12.0
type RemoteSpec struct {
Source string `json:"source"`
Spec Spec `json:"spec"`
Tags []string `json:"tags"`
}
func (*RemoteSpec) UnmarshalJSON ¶ added in v0.14.1
func (r *RemoteSpec) UnmarshalJSON(bb []byte) error
type SourceUri ¶ added in v0.13.0
type SourceUri interface {
// contains filtered or unexported methods
}
type SourceUriFile ¶ added in v0.13.0
type SourceUriFile struct {
Path string
}
type SourceUriGit ¶ added in v0.13.0
type SourceUriUrl ¶ added in v0.13.0
type SourceUriUrl struct {
URL string
}
type Spec ¶
type Spec struct {
Dir string `json:"dir"`
Tools structs.Tools `json:"tools"`
Includes []Include `json:"includes"`
}
func (*Spec) AddInclude ¶ added in v0.12.0
type ToolState ¶ added in v0.15.0
type ToolState struct {
Runtime string
OriginModule string
Module structs.ModuleInfo
Alias optional.Val[string]
Tags []string
}
ToolState describe a state of this tool.
type Workdir ¶ added in v0.14.1
type Workdir struct {
// contains filtered or unexported fields
}
func (*Workdir) AddInclude ¶ added in v0.14.1
func (*Workdir) CopySource ¶ added in v0.14.1
CopySource will add all tools from source. Source can be a path to file or a http url or git repo.
Click to show internal directories.
Click to hide internal directories.