structs

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrToolNotInstalled = errors.New("tool not installed")

Functions

This section is empty.

Types

type Include added in v0.25.0

type Include struct {
	Src  string   `json:"src"`
	Tags []string `json:"tags"`
}

func (Include) IsSame added in v0.25.0

func (i Include) IsSame(include Include) bool

func (*Include) UnmarshalJSON added in v0.25.0

func (i *Include) UnmarshalJSON(bb []byte) error

type Lock added in v0.25.0

type Lock struct {
	Tools   Tools        `json:"tools"`
	Remotes []RemoteSpec `json:"remotes"`
}

func (*Lock) FromSpec added in v0.25.0

func (l *Lock) FromSpec(spec *Spec)

type ModuleInfo

type ModuleInfo struct {
	Name        string // golangci-lint
	Mod         prog.Version
	BinDir      string // /home/user/bin/tools/.golangci-lint__v1.1.1
	BinPath     string // /home/user/bin/tools/.golangci-lint__v1.1.1/golangci-lint
	IsInstalled bool
	IsPrivate   bool
}

type RemoteSpec added in v0.25.0

type RemoteSpec struct {
	Source string   `json:"source"`
	Spec   Spec     `json:"spec"`
	Tags   []string `json:"tags"`
}

func (*RemoteSpec) UnmarshalJSON added in v0.25.0

func (r *RemoteSpec) UnmarshalJSON(bb []byte) error

type RunError added in v0.15.1

type RunError struct {
	ExitCode int
}

func (RunError) Error added in v0.15.1

func (e RunError) Error() string

type Spec added in v0.25.0

type Spec struct {
	// This dir is store all toolset-related files.
	// This directory should be managed by toolset only.
	Dir      string    `json:"dir"`
	Tools    Tools     `json:"tools"`
	Includes []Include `json:"includes"`
}

func (*Spec) AddInclude added in v0.25.0

func (s *Spec) AddInclude(include Include) bool

type Stats added in v0.25.0

type Stats struct {
	Version string               `json:"version"`
	Tools   map[string]time.Time `json:"tools"`
}

type Tool

type Tool struct {
	// Name of runtime
	Runtime string `json:"runtime"`
	// Path to module with version
	Module string `json:"module"`
	// Alias create a link in tools. Works like exposing some tools
	Alias optional.Val[string] `json:"alias"`
	Tags  []string             `json:"tags"`
}

func (Tool) ID added in v0.19.0

func (t Tool) ID() string

func (Tool) IsSame

func (t Tool) IsSame(tool Tool) bool

IsSame returns true when it detects that this is the same tools. It does not check tool version.

type ToolState added in v0.25.0

type ToolState struct {
	Module  ModuleInfo
	Tool    Tool
	LastUse optional.Val[time.Time]
}

ToolState describe a state of this tool.

type Tools

type Tools []Tool

func (*Tools) Add

func (tools *Tools) Add(tool Tool) bool

Add will add tool to list if that tool not exists yet. Returns true when tool was added.

func (*Tools) Filter

func (tools *Tools) Filter(tags []string) Tools

func (*Tools) Remove added in v0.22.0

func (tools *Tools) Remove(tool Tool) bool

func (*Tools) UpsertTool added in v0.25.0

func (tools *Tools) UpsertTool(tool Tool)

UpsertTool will add tool if not exists or replace to the given version.

Jump to

Keyboard shortcuts

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