Documentation ¶
Index ¶
- Constants
- Variables
- func Abbreviate(path string) string
- func AssertDir(dname string) error
- func AssertFile(fname string) error
- func IsDir(dname string) bool
- func IsFile(fname string) bool
- func IsURL(s string) bool
- func PkgInstallDir(url string) string
- func PrivatePkgInstallDir(url string) string
- func PublicPkgInstallDir(url string) string
- func ReadPrivateSSHKey() (string, error)
- func ResolvePackages(startFile string) error
- 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 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 DependencyConfig
- type FetchFunc
- type Lang
- type Package
- type PackageConfig
- type PathLang
- type SSGConfig
- type SemVer
- type SemVerRange
Constants ¶
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 ( JS_MODE = false VERBOSITY = 0 )
View Source
var AddCacheDependency func(fname string, dep string) = nil
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 HasUpstreamCacheDependency func(thisPath string, upstreamPath string) bool = nil
View Source
var LATEST bool = false
View Source
var StartCacheUpdate func(fname string) = nil
Functions ¶
func Abbreviate ¶
func AssertFile ¶
func PkgInstallDir ¶ added in v0.5.1
func PrivatePkgInstallDir ¶ added in v0.5.1
func PublicPkgInstallDir ¶ added in v0.5.1
func ReadPrivateSSHKey ¶ added in v0.5.1
func ResolvePackages ¶
func SyncPackages ¶ added in v0.2.0
Types ¶
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 ¶ added in v0.5.1
func (*Package) SSGSemVerRange ¶ added in v0.5.1
func (pkg *Package) SSGSemVerRange() *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"` SSG SSGConfig `json:"ssg"` }
func NewEmptyPackageConfig ¶
func NewEmptyPackageConfig() *PackageConfig
type SemVerRange ¶
type SemVerRange struct {
// contains filtered or unexported fields
}
func NewSemVerRange ¶ added in v0.2.0
func NewSemVerRange(min *SemVer, max *SemVer) *SemVerRange
func (*SemVerRange) Contains ¶ added in v0.2.0
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 ¶ added in v0.2.0
func (sr *SemVerRange) Max() *SemVer
func (*SemVerRange) Min ¶ added in v0.2.0
func (sr *SemVerRange) Min() *SemVer
Click to show internal directories.
Click to hide internal directories.