common

package
v0.0.0-...-5e40cfc Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const InfoFileBase = ".info.json"

Variables

This section is empty.

Functions

func CacheDirPath

func CacheDirPath(h hash.Hash) (dir string, err error)

func CacheRootDirPath

func CacheRootDirPath() (cacheRootDirPath string, err error)

func CachedExePath

func CachedExePath(h hash.Hash, base string) (cachedExePath string, err error)

func Camel2Kebab

func Camel2Kebab(sIn string) (s string)

func InfoFilePath

func InfoFilePath(h hash.Hash) (infoFile string, err error)

func Kebab2Camel

func Kebab2Camel(sIn string) (s string)

func LinksDirPath

func LinksDirPath() (path string, err error)

func RegisterManagerFactory

func RegisterManagerFactory(name string, fn NewManagerFn, priorityWeight int)

func SetHomeDirPath

func SetHomeDirPath(dirPath string)

SetHomeDirPath should be available only for testing?

Types

type BuildInfo

type BuildInfo struct {
	Version string    `json:"version"`
	Args    []string  `json:"args"`
	Files   []string  `json:"files"`
	Hash    hash.Hash `json:"-"`
	HashStr string    `json:"hash"`
}

func NewBuildInfo

func NewBuildInfo(
	version string,
	args []string,
	fileInfoList []*FileInfo,
) *BuildInfo

type CommandBaseInfo

type CommandBaseInfo struct {
	CmdBase    string
	SourcePath string
}

type Factory

type Factory struct {
	Name           string
	PriorityWeight int
	NewManager     NewManagerFn
}

func Factories

func Factories() []*Factory

Factories returns a list of factories in descending order of priority weight.

type FileInfo

type FileInfo struct {
	Name    string
	Hash    hash.Hash
	HashStr string
	Size    int64
}

func GetFileInfo

func GetFileInfo(filePath string) (fileInfo *FileInfo, err error)

type Manager

type Manager interface {
	GetCommandBaseInfoList() []*CommandBaseInfo
	CanRun(cmdBase string) bool
	Run(args []string, shouldRebuild bool) error
}

type NewManagerFn

type NewManagerFn func(dirPath string) Manager

Jump to

Keyboard shortcuts

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