utils

package
v0.0.121 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const FILE_WRITE_PERMS = 0755

Variables

This section is empty.

Functions

func BuildTemplateFromPath

func BuildTemplateFromPath(tmplPath string, profile *ProfileConf, buildPath string, templateExtension string, removeTemplateAfterProcessing bool)

func BuildTemplatesFromPath

func BuildTemplatesFromPath(profile *ProfileConf, buildPath string, templateExtension string, removeTemplateAfterProcessing bool)

func CmdOnDir

func CmdOnDir(cmdStr string, cmdDesc string, cmdDir string) string

CmdOnDir d

func CmdOnDirToStdOut added in v0.0.67

func CmdOnDirToStdOut(cmdStr string, cmdDesc string, cmdDir string, env []string)

func CmdOnDirWithEnv added in v0.0.26

func CmdOnDirWithEnv(cmdStr string, cmdDesc string, cmdDir string, env []string) string

func CopyStaticFile

func CopyStaticFile(
	filePathToRead string,
	filePathToWrite string,
) error

func GCPZoneToRegion added in v0.0.65

func GCPZoneToRegion(zone interface{}) string

func GetStaticFile

func GetStaticFile(file string) (string, error)

func IsWindowsServer added in v0.0.112

func IsWindowsServer() bool

func LogDebug added in v0.0.58

func LogDebug(message string)

func LogError added in v0.0.58

func LogError(message string)

func LogFatal added in v0.0.58

func LogFatal(message string)

func LogInfo added in v0.0.58

func LogInfo(message string)

func LogTrace added in v0.0.58

func LogTrace(message string)

func LogWarn added in v0.0.58

func LogWarn(message string)

func RemoteGCPCommand added in v0.0.108

func RemoteGCPCommand(cmd string, dir string, profile *ProfileConf)

func SetEnvLogLevel added in v0.0.58

func SetEnvLogLevel(logLevel LogLevel)

Sets environment log level variable, used for tests

func SetLogFn added in v0.0.58

func SetLogFn(_logFn func(v ...any))

Sets Logger.logFn for tests

func SetPrintFn added in v0.0.58

func SetPrintFn(_printFn func(v ...any) (n int, err error))

Sets Logger.printFn for tests

func StrToCamel

func StrToCamel(text string) string

func StrToMd5

func StrToMd5(text string) string

func StrToUpperSnake

func StrToUpperSnake(text string) string

Types

type ClientBuilder added in v0.0.73

type ClientBuilder struct {
	Profile             *ProfileConf
	CmdOnDirWithEnv     func(string, string, string, []string) string
	Targets             string
	CopyStaticDirectory func(string, string) error
}

func (*ClientBuilder) Build added in v0.0.73

func (cb *ClientBuilder) Build()

type GCPConfig added in v0.0.87

type GCPConfig struct {
	Project   string `yaml:"project"`
	Zone      string `yaml:"zone"`
	Bucket    string `yaml:"bucket"`
	CredsFile string `yaml:"creds-file"`
}

type GameConfig added in v0.0.73

type GameConfig struct {
	Targets []GameTargetConfig `yaml:"targets"`
}

type GameTargetConfig added in v0.0.88

type GameTargetConfig struct {
	BuildService string `yaml:"build-service"`
	Copy         string `yaml:"copy"`
	To           string `yaml:"to"`
}

type InfraChange

type InfraChange struct {
	OutputDir       string
	Profile         *ProfileConf
	CmdOnDir        func(string, string, string) string
	CmdOnDirWithEnv func(string, string, string, []string) string
	SkipCleanup     bool
}

func (*InfraChange) InstanceDestroy added in v0.0.102

func (infraChange *InfraChange) InstanceDestroy()

func (*InfraChange) InstanceSetup added in v0.0.102

func (infraChange *InfraChange) InstanceSetup()

func (*InfraChange) PerformCleanup added in v0.0.70

func (infraChange *InfraChange) PerformCleanup()

func (*InfraChange) ProjectDestroy added in v0.0.60

func (infraChange *InfraChange) ProjectDestroy()

func (*InfraChange) ProjectSetup added in v0.0.59

func (infraChange *InfraChange) ProjectSetup()

type LogLevel added in v0.0.58

type LogLevel int
const (
	FATAL_LOG LogLevel = iota
	ERROR_LOG LogLevel = iota
	WARN_LOG  LogLevel = iota
	INFO_LOG  LogLevel = iota
	DEBUG_LOG LogLevel = iota
	TRACE_LOG LogLevel = iota
)

func GetEnvLogLevel added in v0.0.58

func GetEnvLogLevel() LogLevel

Gets log level being used

type OMGDConfig added in v0.0.73

type OMGDConfig struct {
	Name    string        `yaml:"name"`
	Game    GameConfig    `yaml:"game"`
	Servers ServersConfig `yaml:"servers"`
	GCP     GCPConfig     `yaml:"gcp"`
}

type PortConfig added in v0.0.90

type PortConfig struct {
	TCP string `yaml:"tcp"`
	UDP string `yaml:"udp"`
}

type ProfileConf

type ProfileConf struct {
	Name        string
	OMGD        OMGDConfig `yaml:"omgd"`
	OMGDProfile *ProfileConf
	// contains filtered or unexported fields
}

func GetProfile

func GetProfile(path string) *ProfileConf

func GetProfileFromDir added in v0.0.37

func GetProfileFromDir(path string, dir string) *ProfileConf

func (ProfileConf) Get

func (profile ProfileConf) Get(key string) interface{}

func (ProfileConf) GetArray

func (profile ProfileConf) GetArray(key string) []interface{}

func (ProfileConf) GetProfileAsMap

func (pc ProfileConf) GetProfileAsMap() map[interface{}]interface{}

func (ProfileConf) LoadProfile added in v0.0.87

func (profile ProfileConf) LoadProfile() *ProfileConf

func (ProfileConf) SaveProfileFromMap

func (profile ProfileConf) SaveProfileFromMap(profileMap *map[interface{}]interface{})

func (ProfileConf) UpdateProfile

func (profile ProfileConf) UpdateProfile(key string, val interface{})

type ServerService added in v0.0.96

type ServerService struct {
	BuildService string `yaml:"build-service"`
}

type ServersChange added in v0.0.106

type ServersChange struct {
	OutputDir       string
	Profile         *ProfileConf
	CmdOnDir        func(string, string, string) string
	CmdOnDirWithEnv func(string, string, string, []string) string
	SkipCleanup     bool
}

func (*ServersChange) Deploy added in v0.0.106

func (serversChange *ServersChange) Deploy()

func (*ServersChange) PerformCleanup added in v0.0.106

func (serversChange *ServersChange) PerformCleanup()

type ServersConfig added in v0.0.83

type ServersConfig struct {
	Services []ServerService `yaml:"services"`
	Ports    PortConfig      `yaml:"ports"`
	Host     string          `yaml:"host"`
}

type StaticCodeCopyPlan

type StaticCodeCopyPlan struct {
	// contains filtered or unexported fields
}

func (*StaticCodeCopyPlan) CopyStaticDirectory

func (sccp *StaticCodeCopyPlan) CopyStaticDirectory(pathToCopy string, pathToCopyTo string) error

type StaticCodeFilePathAlteration

type StaticCodeFilePathAlteration struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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