Documentation
¶
Index ¶
- Constants
- Variables
- func Abbreviate(path string) string
- func AddDep(this string, dep string)
- func AssertDir(dname string) error
- func AssertFile(fname string) error
- func Exists(name string) bool
- func HasUpstreamDep(thisPath string, upstreamPath string) bool
- func IsDir(dname string) bool
- func IsFile(fname string) bool
- func IsURL(s string) bool
- func LoadDepTree(target string, globals string, forceRebuild bool)
- func PkgInstallDir(url string) string
- func PrivatePkgInstallDir(url string) string
- func PublicPkgInstallDir(url string) string
- func ReadPrivateSSHKey() (string, error)
- func RequiresDepUpdate(this string, parameters string) bool
- func ResolvePackages(startFile string) error
- func SaveDepTree()
- func Search(callerPath string, srcPath string) (string, error)
- func SearchPackage(caller string, pkgPath string, lang Lang) (string, error)
- func SearchScript(caller string, path string) (string, error)
- func SearchShader(caller string, path string) (string, error)
- func SearchTemplate(caller string, path string) (string, error)
- func StartDepUpdate(name string, parameters string)
- func StartDstUpdate(dst string, parameters string)
- func SyncPackages(startFile string, fetcher FetchFunc) error
- func WalkFiles(dir string, ext string, fn func(string) error) error
- func WriteFile(path string, target string, content []byte) error
- type DepNode
- type DepTree
- type DependencyConfig
- type FetchFunc
- type Lang
- type Package
- type PackageConfig
- type PathLang
- type SemVer
- type SemVerRange
- type SuiteVersionConfig
Constants ¶
View Source
const ( CACHE_DIR_ENV_KEY = "WTCACHE" CACHE_REL_DIR = ".cache/wtsuite" )
View Source
const ( SCRIPT Lang = "script" TEMPLATE = "template" SHADER = "shader" )
View Source
const ( PACKAGE_JSON = "package.json" USER_DIR_ENV_KEY = "WTPATH" USER_REL_DIR = ".local/share/wtsuite/private" SHARE_DIR_ENV_KEY = "WTSHARE" SHARE_REL_DIR = ".local/share/wtsuite/public" PRIVSSH_ENV_KEY = "WTSSHKEY" PRIVSSH_REL_PATH = ".ssh/id_rsa" )
View Source
const (
JSFILE_EXT = ".wts" // used by refactor and grapher
)
Variables ¶
View Source
var (
CACHE_PACKAGES = true // the wtaas server should set this to false though
)
View Source
var FetchPublicOrPrivate func(url string, smv *SemVerRange) (string, error) = nil
View Source
var LATEST bool = false
View Source
var (
VERBOSITY = 0
)
Functions ¶
func Abbreviate ¶
func AssertFile ¶
func HasUpstreamDep ¶
func LoadDepTree ¶
target can be a directory or a file
func PkgInstallDir ¶
func PrivatePkgInstallDir ¶
func PublicPkgInstallDir ¶
func ReadPrivateSSHKey ¶
func RequiresDepUpdate ¶
dst is the actual file path!
func ResolvePackages ¶
func SaveDepTree ¶
func SaveDepTree()
func StartDepUpdate ¶
func StartDstUpdate ¶
func SyncPackages ¶
Types ¶
type DepNode ¶
type DepNode struct { IsDst bool Parameters string // if parameters change, node must be rebuilt Dependencies []string // if any dependencies c }
node rebuild is triggered by: * node not in tree * parameter change * any dependency not in tree * any dependency has later modification time
type DepTree ¶
type DepTree struct { Globals string Nodes map[string]DepNode // key is dst // contains filtered or unexported fields }
global rebuild is triggered by: * forceRebuild==true * tree not found * globals change
type DependencyConfig ¶
type FetchFunc ¶
type FetchFunc func(url string, svr *SemVerRange) (string, error)
returns the directory of the installed package
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
func LoadPackage ¶
func (*Package) SuiteSemVerRange ¶
func (pkg *Package) SuiteSemVerRange() *SemVerRange
type PackageConfig ¶
type PackageConfig struct { Dependencies map[string]DependencyConfig `json:"dependencies"` TemplateModules map[string]string `json:"templateModules"` ScriptModules map[string]string `json:"scriptModules"` ShaderModules map[string]string `json:"shaderModules"` SuiteVersion SuiteVersionConfig `json:"suiteVersion"` }
func NewEmptyPackageConfig ¶
func NewEmptyPackageConfig() *PackageConfig
type SemVerRange ¶
type SemVerRange struct {
// contains filtered or unexported fields
}
func NewSemVerRange ¶
func NewSemVerRange(min *SemVer, max *SemVer) *SemVerRange
func (*SemVerRange) Contains ¶
func (sr *SemVerRange) Contains(semVer *SemVer) bool
func (*SemVerRange) FindBestVersion ¶
func (sr *SemVerRange) FindBestVersion(dir string) (string, error)
returns empty string if no relevant version found not concatenated with dir!
func (*SemVerRange) Max ¶
func (sr *SemVerRange) Max() *SemVer
func (*SemVerRange) Min ¶
func (sr *SemVerRange) Min() *SemVer
type SuiteVersionConfig ¶
Click to show internal directories.
Click to hide internal directories.