Documentation
¶
Index ¶
- Constants
- Variables
- type Basic
- func (it Basic) AsJsonContractsBinder() corejson.JsonContractsBinder
- func (it *Basic) By(osType osmixtype.Variant) *Specific
- func (it *Basic) ByEnv(envType enuminf.EnvironmentTyper) *Specific
- func (it *Basic) ByEnvFlagOs(isTestEnv bool, osType osmixtype.Variant) *Specific
- func (it *Basic) ByEnvOs(envVariant envtype.Variant, osType osmixtype.Variant) *Specific
- func (it *Basic) CurrentOs() *Specific
- func (it *Basic) DefaultConfigFilePath() string
- func (it *Basic) JoinWithAppConfigRoot(relativePaths ...string) string
- func (it *Basic) JoinWithDefaultInstructionsRoot(relativePaths ...string) string
- func (it *Basic) JoinWithInstructionTempRoot(relativePaths ...string) string
- func (it *Basic) JoinWithTempRoot(relativePaths ...string) string
- func (it *Basic) JoinWithVarAppRoot(relativePaths ...string) string
- func (it *Basic) Json() corejson.Result
- func (it *Basic) JsonParseSelfInject(jsonResult *corejson.Result) error
- func (it *Basic) JsonPtr() *corejson.Result
- func (it *Basic) PrettyJsonString() string
- func (it *Basic) ReflectSetTo(toPtr interface{}) error
- func (it *Basic) ReflectSetToErrWrap(toPtr interface{}) *errorwrapper.Wrapper
- func (it *Basic) TestBy(osType osmixtype.Variant) *Specific
- func (it *Basic) TestCurrentOs() *Specific
- func (it *Basic) ToNonPtr() Basic
- func (it Basic) ToPtr() *Basic
- type Segment
- type Specific
- func (it Specific) AsJsonContractsBinder() corejson.JsonContractsBinder
- func (it *Specific) Clone() Specific
- func (it *Specific) ClonePtr() *Specific
- func (it *Specific) CloneReplacerMap() map[string]string
- func (it *Specific) ExecutableDirPath() string
- func (it *Specific) IsDefined() bool
- func (it *Specific) IsNull() bool
- func (it *Specific) JoinNormalized(baseDir string, relativePaths ...string) string
- func (it *Specific) JoinNormalizedExpand(baseDir string, relativePaths ...string) string
- func (it *Specific) JoinSimpleWith(baseDir string, relativePaths ...string) string
- func (it *Specific) JoinWith(baseDir string, relativePaths ...string) string
- func (it *Specific) JoinWithAppConfigRoot(relativePaths ...string) string
- func (it *Specific) JoinWithAppDbRoot(relativePaths ...string) string
- func (it *Specific) JoinWithAppTempRoot(relativePaths ...string) string
- func (it *Specific) JoinWithArchiveRoot(relativePaths ...string) string
- func (it *Specific) JoinWithBackupRoot(relativePaths ...string) string
- func (it *Specific) JoinWithCacheTempRoot(relativePaths ...string) string
- func (it *Specific) JoinWithDecompressRoot(relativePaths ...string) string
- func (it *Specific) JoinWithDefaultEnvPathRoot(relativePaths ...string) string
- func (it *Specific) JoinWithDefaultEnvRoot(relativePaths ...string) string
- func (it *Specific) JoinWithDefaultInstructionsRoot(relativePaths ...string) string
- func (it *Specific) JoinWithDownloadsRoot(relativePaths ...string) string
- func (it *Specific) JoinWithEtcAppRoot(relativePaths ...string) string
- func (it *Specific) JoinWithExecutableDirPath(relativePaths ...string) string
- func (it *Specific) JoinWithInstructionTempRoot(relativePaths ...string) string
- func (it *Specific) JoinWithLogAppRoot(relativePaths ...string) string
- func (it *Specific) JoinWithMigrationCacheRoot(relativePaths ...string) string
- func (it *Specific) JoinWithOptions(isSkipEmpty bool, isNormalize bool, isExpand bool, baseDir string, ...) string
- func (it *Specific) JoinWithPackageTempRoot(relativePaths ...string) string
- func (it *Specific) JoinWithPackagesDownloadRoot(relativePaths ...string) string
- func (it *Specific) JoinWithPackagesRoot(relativePaths ...string) string
- func (it *Specific) JoinWithPublicRoot(relativePaths ...string) string
- func (it *Specific) JoinWithScriptsRoot(relativePaths ...string) string
- func (it *Specific) JoinWithSnapshotsRoot(relativePaths ...string) string
- func (it *Specific) JoinWithSslRoot(relativePaths ...string) string
- func (it *Specific) JoinWithTempRoot(relativePaths ...string) string
- func (it *Specific) JoinWithTempWithoutApp(relativePaths ...string) string
- func (it *Specific) JoinWithUserTempRoot(relativePaths ...string) string
- func (it *Specific) JoinWithVarAppRoot(relativePaths ...string) string
- func (it *Specific) JoinWithVarCacheRoot(relativePaths ...string) string
- func (it *Specific) JoinWithZipsRoot(relativePaths ...string) string
- func (it *Specific) Json() corejson.Result
- func (it *Specific) JsonParseSelfInject(jsonResult *corejson.Result) error
- func (it *Specific) JsonPtr() *corejson.Result
- func (it *Specific) PrettyJsonString() string
- func (it *Specific) ReflectSetTo(toPtr interface{}) error
- func (it *Specific) ReflectSetToErrWrap(toPtr interface{}) *errorwrapper.Wrapper
- func (it *Specific) ToNonPtr() Specific
- func (it Specific) ToPtr() *Specific
- type Suffixes
Constants ¶
View Source
const ( AppName = pathsconst.AppName AppNameLower = pathsconst.AppNameLower )
Variables ¶
View Source
var ( TempAppTestRoot = pathsconst.TempAppTestRoot // /tmp/{app-name}-test-env/ TempAppRoot = pathsconst.TempAppRoot // /var/tmp/{app-name} AppWindowsUserSpecificTempRoot = pathsconst.AppWindowsUserSpecificTempRoot // %temp%\{app-name} CurrentOsType = osmixtype.CurrentOsMixType() DefaultApp = Basic{ AppName: AppName, AppNameLower: AppNameLower, ProductionMap: map[osmixtype.Variant]*Specific{ osmixtype.AnyOs: &UnixOs, osmixtype.Ubuntu: &UnixOs, osmixtype.Windows: &WindowsOs, }, TestMap: map[osmixtype.Variant]*Specific{ osmixtype.AnyOs: &AnyOsTest, }, } )
View Source
var AnyOsTest = Specific{ Name: "AnyOs Test", Description: "all os test paths", Url: "", ReplacerMap: nil, SpecificPathFileLocation: TempAppTestRoot + DefaultSuffix.SpecificPathFileLocation, VarAppRoot: TempAppTestRoot, EtcAppRoot: TempAppTestRoot + "/etc/", EtcAppConfigRoot: TempAppTestRoot + "/etc/config", AppDbRoot: TempAppTestRoot + DefaultSuffix.AppDbRoot, TempRoot: TempAppTestRoot + pathsconst.UnixTemp, UserTempRoot: TempAppTestRoot + pathsconst.UnixTemp + DefaultSuffix.UserTempRoot, CacheTempRoot: TempAppTestRoot + pathsconst.UnixTemp + DefaultSuffix.CacheTempRoot, InstructionTempRoot: TempAppTestRoot + pathsconst.UnixTemp + DefaultSuffix.InstructionTempRoot, MigrationCacheRoot: TempAppTestRoot + pathsconst.UnixTemp + DefaultSuffix.MigrationCacheRoot, PackageTempRoot: TempAppTestRoot + pathsconst.UnixTemp + DefaultSuffix.PackageTempRoot, LogAppRoot: TempAppTestRoot + pathsconst.VarLog, VarCacheRoot: TempAppTestRoot + pathsconst.VarOpt + DefaultSuffix.VarCacheRoot, DownloadsRoot: TempAppTestRoot + pathsconst.VarOpt + DefaultSuffix.DownloadsRoot, ScriptsRoot: TempAppTestRoot + DefaultSuffix.ScriptsRoot, DecompressRoot: TempAppTestRoot + DefaultSuffix.DecompressRoot, PackagesRoot: TempAppTestRoot + DefaultSuffix.PackagesRoot, PackagesDownloadRoot: TempAppTestRoot + DefaultSuffix.PackagesDownloadRoot, DefaultInstructionsRoot: TempAppTestRoot + DefaultSuffix.DefaultInstructionsRoot, DefaultEnvRoot: TempAppTestRoot + DefaultSuffix.DefaultEnvRoot, DefaultEnvPathRoot: TempAppTestRoot + DefaultSuffix.DefaultEnvPathRoot, BackupRoot: TempAppTestRoot + DefaultSuffix.BackupRoot, ArchiveRoot: TempAppTestRoot + DefaultSuffix.ArchiveRoot, ZipsRoot: TempAppTestRoot + DefaultSuffix.ZipsRoot, DefaultConfigFilePath: TempAppTestRoot + DefaultSuffix.DefaultConfigFilePath, SnapshotsRoot: TempAppTestRoot + "/all" + DefaultSuffix.SnapshotsRoot, PublicRoot: TempAppTestRoot + "/var/" + DefaultSuffix.PublicRoot, SslRoot: TempAppTestRoot + "/all" + DefaultSuffix.SslRoot, }
View Source
var DefaultSuffix = Suffixes{ Specific{ Name: "Suffix map", Description: "Only suffix", SpecificPathFileLocation: "/defined-paths/paths.json", VarAppRoot: AppNameLower, EtcAppRoot: AppNameLower, EtcAppConfigRoot: defaultConfigRootSuffix, AppDbRoot: "/databases/", TempRoot: AppNameLower, UserTempRoot: "/users/", CacheTempRoot: "/cache/", InstructionTempRoot: instructionDirName, MigrationCacheRoot: "/migration-cache/", PackageTempRoot: packagesDirName, LogAppRoot: AppNameLower, VarCacheRoot: "/cache/", DownloadsRoot: "/downloads/", ScriptsRoot: "/scripts/", DecompressRoot: "/decompress/", PackagesRoot: packagesDirName, PackagesDownloadRoot: "/packages-downloaded/", DefaultInstructionsRoot: instructionDirName, DefaultEnvRoot: "/env/", DefaultEnvPathRoot: "/env-paths/", BackupRoot: "/backups/", ArchiveRoot: "/archived/", ZipsRoot: "/compressed/", DefaultConfigFilePath: defaultConfigRootSuffix + "/default-config.json", SnapshotsRoot: "-snapshots/", PublicRoot: "www/", SslRoot: "-ssl/", }, }
View Source
var UnixOs = Specific{ Name: "Unix", Description: "all unix(ubuntu, debian, linux, darwin ...) related os paths", SpecificPathFileLocation: unixVarAppRoot + DefaultSuffix.SpecificPathFileLocation, VarAppRoot: unixVarAppRoot, EtcAppRoot: etcApp, EtcAppConfigRoot: unixConfigRoot, AppDbRoot: unixVarAppRoot + DefaultSuffix.AppDbRoot, TempRoot: TempAppRoot, UserTempRoot: TempAppRoot + DefaultSuffix.UserTempRoot, CacheTempRoot: TempAppRoot + DefaultSuffix.CacheTempRoot, InstructionTempRoot: TempAppRoot + DefaultSuffix.InstructionTempRoot, MigrationCacheRoot: TempAppRoot + DefaultSuffix.MigrationCacheRoot, PackageTempRoot: TempAppRoot + DefaultSuffix.PackageTempRoot, LogAppRoot: unixLogAppRoot, VarCacheRoot: unixVarAppRoot + DefaultSuffix.VarCacheRoot, DownloadsRoot: unixVarAppRoot + DefaultSuffix.DownloadsRoot, ScriptsRoot: unixVarAppRoot + DefaultSuffix.ScriptsRoot, DecompressRoot: TempAppRoot + DefaultSuffix.DecompressRoot, PackagesRoot: etcApp + DefaultSuffix.PackagesRoot, PackagesDownloadRoot: unixVarAppRoot + DefaultSuffix.PackagesDownloadRoot, DefaultInstructionsRoot: unixVarAppRoot + DefaultSuffix.DefaultInstructionsRoot, DefaultEnvRoot: unixVarAppRoot + DefaultSuffix.DefaultEnvRoot, DefaultEnvPathRoot: unixVarAppRoot + DefaultSuffix.DefaultEnvPathRoot, BackupRoot: unixVarAppRoot + DefaultSuffix.BackupRoot, ArchiveRoot: unixVarAppRoot + DefaultSuffix.ArchiveRoot, ZipsRoot: unixVarAppRoot + DefaultSuffix.ZipsRoot, DefaultConfigFilePath: etcApp + DefaultSuffix.DefaultConfigFilePath, SnapshotsRoot: unixVarAppRoot + DefaultSuffix.SnapshotsRoot, PublicRoot: "/var/" + DefaultSuffix.PublicRoot, SslRoot: unixVarAppRoot + DefaultSuffix.SslRoot, }
View Source
var WindowsOs = Specific{ Name: "Windows", Description: "all windows related os paths", Url: "", SpecificPathFileLocation: windowsProductionDefault + DefaultSuffix.SpecificPathFileLocation, VarAppRoot: windowsProductionDefault, EtcAppRoot: windowsProductionDefault, EtcAppConfigRoot: windowsProductionDefault + DefaultSuffix.EtcAppConfigRoot, AppDbRoot: windowsProductionDefault + DefaultSuffix.AppDbRoot, TempRoot: AppWindowsUserSpecificTempRoot, UserTempRoot: AppWindowsUserSpecificTempRoot + DefaultSuffix.UserTempRoot, CacheTempRoot: AppWindowsUserSpecificTempRoot + DefaultSuffix.CacheTempRoot, InstructionTempRoot: AppWindowsUserSpecificTempRoot + DefaultSuffix.InstructionTempRoot, MigrationCacheRoot: AppWindowsUserSpecificTempRoot + DefaultSuffix.MigrationCacheRoot, PackageTempRoot: AppWindowsUserSpecificTempRoot + DefaultSuffix.PackageTempRoot, LogAppRoot: windowsProductionDefault + "\\logs", VarCacheRoot: windowsProductionDefault + DefaultSuffix.VarCacheRoot, DownloadsRoot: TempAppRoot + DefaultSuffix.DownloadsRoot, ScriptsRoot: windowsProductionDefault + DefaultSuffix.ScriptsRoot, DecompressRoot: TempAppRoot + DefaultSuffix.DecompressRoot, PackagesRoot: windowsProductionDefault + DefaultSuffix.PackagesRoot, PackagesDownloadRoot: windowsProductionDefault + DefaultSuffix.PackagesDownloadRoot, DefaultInstructionsRoot: windowsProductionDefault + DefaultSuffix.DefaultInstructionsRoot, DefaultEnvRoot: windowsProductionDefault + DefaultSuffix.DefaultEnvRoot, DefaultEnvPathRoot: windowsProductionDefault + DefaultSuffix.DefaultEnvPathRoot, BackupRoot: windowsProductionDefault + DefaultSuffix.BackupRoot, ArchiveRoot: windowsProductionDefault + DefaultSuffix.ArchiveRoot, ZipsRoot: windowsProductionDefault + DefaultSuffix.ZipsRoot, DefaultConfigFilePath: windowsProductionDefault + DefaultSuffix.DefaultConfigFilePath, SnapshotsRoot: windowsProductionDefault + "\\config" + DefaultSuffix.SnapshotsRoot, PublicRoot: osconsts.WindowsCDrive + "public_root\\" + DefaultSuffix.PublicRoot, SslRoot: windowsProductionDefault + "\\all" + DefaultSuffix.SslRoot, }
Functions ¶
This section is empty.
Types ¶
type Basic ¶
type Basic struct { AppName string AppNameLower string ProductionMap map[osmixtype.Variant]*Specific TestMap map[osmixtype.Variant]*Specific }
func (Basic) AsJsonContractsBinder ¶
func (it Basic) AsJsonContractsBinder() corejson.JsonContractsBinder
func (*Basic) ByEnvFlagOs ¶ added in v0.7.8
func (*Basic) DefaultConfigFilePath ¶
DefaultConfigFilePath
eg. unix : pathsconst.UnixVarAppRoot + "/config/default-config.json" => "/var/opt/{app-name}/config/default-config.json"
func (*Basic) JoinWithAppConfigRoot ¶
func (*Basic) JoinWithDefaultInstructionsRoot ¶
func (*Basic) JoinWithInstructionTempRoot ¶
func (*Basic) JoinWithTempRoot ¶
func (*Basic) JoinWithVarAppRoot ¶
func (*Basic) JsonParseSelfInject ¶
func (*Basic) PrettyJsonString ¶
func (*Basic) ReflectSetTo ¶
func (*Basic) ReflectSetToErrWrap ¶
func (it *Basic) ReflectSetToErrWrap(toPtr interface{}) *errorwrapper.Wrapper
func (*Basic) TestCurrentOs ¶
type Segment ¶
type Segment struct {
Name, Format string
// contains filtered or unexported fields
}
type Specific ¶
type Specific struct { Name string `json:"Name,omitempty"` Description string `json:"Description,omitempty"` Url string `json:"Url,omitempty"` ReplacerMap map[string]string `json:"ReplacerMap,omitempty"` // todo later add dynamic way of getting format path SpecificPathFileLocation string // eg. self saving location, unix : "/var/opt/{app-name}/defined-paths/paths.json" VarAppRoot string // eg. unix : "/var/opt/{app-name}" EtcAppRoot string // eg. unix : "/etc/{app-name}" EtcAppConfigRoot string // eg. unix : "/etc/{app-name}/config" AppDbRoot string // eg. unix : "/var/opt/{app-name}/databases" TempRoot string // eg. unix : TempAppRoot => TempPermanentDir + AppNameLower => "/{os-temp}/{app-name}" UserTempRoot string // eg. unix : "/{os-temp}/{app-name}/users/" CacheTempRoot string // eg. unix : "/{os-temp}/{app-name}/cache/" InstructionTempRoot string // eg. unix : "/{os-temp}/{app-name}/instructions/" MigrationCacheRoot string // eg. unix : "/{os-temp}/{app-name}/migration-cache/" PackageTempRoot string // eg. unix : "/{os-temp}/{app-name}/packages/" LogAppRoot string // eg. unix : pathsconst.UnixLogAppRoot + {app-name} => "/var/log/{app-name}/" VarCacheRoot string // eg. unix : pathsconst.UnixVarAppRoot + "cache" => "/var/opt/{app-name}/cache" DownloadsRoot string // eg. unix : pathsconst.UnixVarAppRoot + "downloads" => "/var/opt/{app-name}/downloads" ScriptsRoot string // eg. unix : pathsconst.UnixVarAppRoot + "scripts" => "/var/opt/{app-name}/scripts" DecompressRoot string // eg. unix : pathsconst.UnixVarAppRoot + "decompress" => "/var/opt/{app-name}/decompress" PackagesRoot string // eg. unix : pathsconst.UnixVarAppRoot + "packages" => "/var/opt/{app-name}/packages" PackagesDownloadRoot string // eg. unix : pathsconst.UnixVarAppRoot + "packages-downloaded" => "/var/opt/{app-name}/packages-downloaded/" DefaultInstructionsRoot string // eg. unix : pathsconst.UnixVarAppRoot + "/instructions/" => "/var/opt/{app-name}/instructions/" DefaultEnvRoot string // eg. unix : pathsconst.UnixVarAppRoot + "/env/" => "/var/opt/{app-name}/env/" DefaultEnvPathRoot string // eg. unix : pathsconst.UnixVarAppRoot + "/env-paths/" => "/var/opt/{app-name}/env-paths/" BackupRoot string // eg. unix : pathsconst.UnixVarAppRoot + "/backups/" => "/var/opt/{app-name}/backups/" ArchiveRoot string // eg. unix : pathsconst.UnixVarAppRoot + "/archived/" => "/var/opt/{app-name}/archived/" ZipsRoot string // eg. unix : pathsconst.UnixVarAppRoot + "/compressed/" => "/var/opt/{app-name}/compressed/" DefaultConfigFilePath string // eg. unix : pathsconst.UnixVarAppRoot + "/config/default-config.json" => "/var/opt/{app-name}/config/default-config.json" SnapshotsRoot string // eg. unix : "/var/opt/{app-name}-snapshots/" PublicRoot string // eg. unix : "/var/www" SslRoot string // eg. unix : "/var/opt/{app-name}-ssl/" }
func (Specific) AsJsonContractsBinder ¶
func (it Specific) AsJsonContractsBinder() corejson.JsonContractsBinder
func (*Specific) CloneReplacerMap ¶
func (*Specific) ExecutableDirPath ¶
func (*Specific) JoinNormalized ¶
func (*Specific) JoinNormalizedExpand ¶
func (*Specific) JoinSimpleWith ¶
func (*Specific) JoinWithAppConfigRoot ¶
func (*Specific) JoinWithAppDbRoot ¶
func (*Specific) JoinWithAppTempRoot ¶
func (*Specific) JoinWithArchiveRoot ¶
func (*Specific) JoinWithBackupRoot ¶
func (*Specific) JoinWithCacheTempRoot ¶
func (*Specific) JoinWithDecompressRoot ¶
func (*Specific) JoinWithDefaultEnvPathRoot ¶
func (*Specific) JoinWithDefaultEnvRoot ¶
func (*Specific) JoinWithDefaultInstructionsRoot ¶
func (*Specific) JoinWithDownloadsRoot ¶
func (*Specific) JoinWithEtcAppRoot ¶
func (*Specific) JoinWithExecutableDirPath ¶
func (*Specific) JoinWithInstructionTempRoot ¶
func (*Specific) JoinWithLogAppRoot ¶
func (*Specific) JoinWithMigrationCacheRoot ¶
func (*Specific) JoinWithOptions ¶
func (*Specific) JoinWithPackageTempRoot ¶
func (*Specific) JoinWithPackagesDownloadRoot ¶
func (*Specific) JoinWithPackagesRoot ¶
func (*Specific) JoinWithPublicRoot ¶ added in v0.7.6
func (*Specific) JoinWithScriptsRoot ¶
func (*Specific) JoinWithSnapshotsRoot ¶ added in v0.7.6
func (*Specific) JoinWithSslRoot ¶ added in v0.7.6
func (*Specific) JoinWithTempRoot ¶
func (*Specific) JoinWithTempWithoutApp ¶
func (*Specific) JoinWithUserTempRoot ¶
func (*Specific) JoinWithVarAppRoot ¶
func (*Specific) JoinWithVarCacheRoot ¶
func (*Specific) JoinWithZipsRoot ¶
func (*Specific) JsonParseSelfInject ¶
func (*Specific) PrettyJsonString ¶
func (*Specific) ReflectSetTo ¶
func (*Specific) ReflectSetToErrWrap ¶
func (it *Specific) ReflectSetToErrWrap(toPtr interface{}) *errorwrapper.Wrapper
Click to show internal directories.
Click to hide internal directories.