fs

package
v0.0.0-...-8150c2d Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2019 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VarDir         = "var"
	WwwDir         = "www"
	AssetsDir      = "assets"
	DbDir          = "db"
	KTDir          = "kt"
	ProjectDir     = "project"
	ModelDir       = "model"
	LibDir         = "lib"
	OutDir         = "out"
	TmpDir         = "tmp"
	LogDir         = "log"
	DirPerm        = 0755
	FilePerm       = 0666
	KTPerm         = 0600
	PackExt        = ".steam"
	KindEngine     = "engine"
	KindFile       = "file"
	KindExperiment = "module"
)

Variables

This section is empty.

Functions

func DirExists

func DirExists(p string) bool

func Download

func Download(p, u string, preserveFilename bool) (int64, string, error)

func FileExists

func FileExists(p string) bool

func GetAssetsPath

func GetAssetsPath(wd, asset string) string

func GetBasenameWithoutExt

func GetBasenameWithoutExt(p string) string

func GetDeepwaterDepPath

func GetDeepwaterDepPath(wd string, modelId int64) string

func GetExternalHost

func GetExternalHost() (string, error)

func GetExternalIP

func GetExternalIP(fallback string) string

func GetGenModelPath

func GetGenModelPath(wd string, modelId int64) string

func GetIP

func GetIP(addr string) string

func GetJavaModelPath

func GetJavaModelPath(wd string, modelId int64, logicalName string) string

func GetJobLogFilePath

func GetJobLogFilePath(wd, id, suffix string) string

func GetLogFilePath

func GetLogFilePath(wd, name string) string

func GetMOJOPath

func GetMOJOPath(wd string, modelId int64, logcialName string) string

func GetModelDirs

func GetModelDirs(wd string, modelId int64) ([]string, error)

func GetModelJarFilePath

func GetModelJarFilePath(wd string, modelId int64, logicalName string) string

func GetModelPath

func GetModelPath(wd string, modelId int64) string

func GetOutPath

func GetOutPath(wd, jobID string) string

func GetPack

func GetPack(wd, kind, pack string) (string, bool)

func GetPackDir

func GetPackDir(packPath string) string

func GetPackPath

func GetPackPath(wd, kind, pack string) string

func GetPackUrl

func GetPackUrl(host, kind, pack string) string

func GetPackageAttributes

func GetPackageAttributes(wd string, projectId int64, packageName string) ([]byte, error)

func GetPackagePath

func GetPackagePath(wd string, projectId int64, packageName string) string

func GetPackageRelativePath

func GetPackageRelativePath(wd string, projectId int64, packageName, relativePath string) (string, error)

func GetProjectPath

func GetProjectPath(wd string, projectId int64) string

func GetPythonWarFilePath

func GetPythonWarFilePath(wd string, modelId int64, logicalName string) string

func GetTmpFilePath

func GetTmpFilePath(wd, filename string) string

func GetWarFilePath

func GetWarFilePath(wd string, modelId int64, logicalName string) string

func GetWwwRoot

func GetWwwRoot(wd string) string

func JsonToMap

func JsonToMap(b []byte) (map[string]string, error)

func ListDirs

func ListDirs(p string) ([]string, error)

func ListFiles

func ListFiles(p string) ([]string, error)

func MapToJson

func MapToJson(attrs map[string]string) ([]byte, error)

func MkWorkingDirectory

func MkWorkingDirectory(p string) (string, error)

func Mkdir

func Mkdir(p string) error

func NewID

func NewID() (string, error)

func ResolvePath

func ResolvePath(p string) (string, error)

func Rm

func Rm(p string) error

func Rmdir

func Rmdir(p string) error

func SetPackageAttributes

func SetPackageAttributes(wd string, projectId int64, packageName string, b []byte) error

func Tail

func Tail(filename string, lines int) (string, error)

func ValidateName

func ValidateName(name string) error

Types

type ByModTime

type ByModTime []os.FileInfo

func (ByModTime) Len

func (s ByModTime) Len() int

func (ByModTime) Less

func (s ByModTime) Less(i, j int) bool

func (ByModTime) Swap

func (s ByModTime) Swap(i, j int)

type Log

type Log struct {
	Name       string
	ModifiedAt time.Time
}

func ListLogs

func ListLogs(wd string, offset, limit int) ([]*Log, error)

type Package

type Package struct {
	Name       string
	ModifiedAt time.Time
}

func GetPacks

func GetPacks(wd, kind string) ([]*Package, error)

Jump to

Keyboard shortcuts

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