config

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Version of gmbh{Core,Procm,Data}
	Version = "0.9.6"

	// Code name of gmbh release
	Code = "launching"
)
View Source
const (
	// Localhost string
	Localhost = "localhost"

	// ServicePort is starting port for assignment to services
	ServicePort = 49502

	// CorePort ; the default core port
	CorePort = ":49500"

	// ProcmPort ; the default procm port
	ProcmPort = ":59500"

	// RemotePort is tarting port for assignment to procm remotes
	RemotePort = 59502
)
View Source
const (
	// ProcmLogName for log file at Log Path
	ProcmLogName = "procm.log"

	// CoreLogName for log file at Log Path
	CoreLogName = "coreData.log"

	// StdoutExt is the extensions for stdout files
	StdoutExt = "-stdout.log"

	// DefaultServiceLogName ;
	DefaultServiceLogName = "stdout.log"

	// LogStamp for output to logs
	LogStamp = "06/01/02 15:04"
)
View Source
const (
	// NodeInterpreter ; default for node services
	NodeInterpreter = "/usr/local/bin/node"

	// NodeInterpreterAlpine ; location to node in alpine images
	NodeInterpreterAlpine = "/usr/bin/node"

	// GoInterpreter ; default for go services
	GoInterpreter = "/usr/local/go/bin/go"
)
View Source
const Bash = `` /* 179-byte string literal not displayed */
View Source
const CheckBash = `check_error $?
`
View Source
const Compose = `` /* 258-byte string literal not displayed */
View Source
const ComposeDashboard = `
  dashboard:
    image: "gmbh-dashboard-image"
    ports:
      - "5001:5001"
    logging:
      driver: "none"
`
View Source
const ComposeNode = `
  node_%d:
    image: "gmbh-img-node_%d"%s
    environment:
      - "HOSTNAME=node_%d"
    env_file:
      - gmbh.env
`
View Source
const CoreDkr = `` /* 1060-byte string literal not displayed */

CoreDkr MUST SPECIFY THE CONFIG FILE USING SPRINTF

View Source
const Dashboard = `` /* 621-byte string literal not displayed */
View Source
const EnvFile = `ENV=C
PROCM=node_procm:59500
%s
CORE=node_0:49500
`
View Source
const EnvLog = `LOGGING=1`
View Source
const ProcMDkr = `` /* 912-byte string literal not displayed */

ProcMDkr procm dockerfile template

View Source
const ServiceDkr = `` /* 1065-byte string literal not displayed */

ServiceDkr docker template

Variables

View Source
var (
	// ProcmBinPathMac runtime.GOOS ==  darwin
	ProcmBinPathMac = os.Getenv("GOPATH") + "/bin/gmbhProcm"

	// CoreBinPathMac runtime.GOOS == darwin
	CoreBinPathMac = os.Getenv("GOPATH") + "/bin/gmbhCore"

	// ProcmBinPathLinux runtime.GOOS ==  linux
	ProcmBinPathLinux = os.Getenv("GOPATH") + "/bin/gmbhProcm"

	// CoreBinPathLinux runtime.GOOS == linux
	CoreBinPathLinux = os.Getenv("GOPATH") + "/bin/gmbhCore"
)
View Source
var (
	// InternalFiles is the relative path from a project config file to where
	// things should be stored such as manifests and logs
	InternalFiles = "gmbh"

	// LogPath is the path from the project directory in which logs should be stored
	LogPath = filepath.Join(InternalFiles, "logs")

	// ManifestPath is the path from the project directory in which manifest toml files
	// should be stored
	ManifestPath = filepath.Join(InternalFiles, "manifest")
)
View Source
var DefaultSystemConfig = SystemConfig{
	Core:       DefaultSystemCore,
	Procm:      DefaultSystemProcm,
	Service:    make([]*ServiceConfig, 0),
	MaxPerNode: 1,
}

DefaultSystemConfig is the complete default system config

View Source
var DefaultSystemCore = &SystemCore{
	Mode:      "local",
	Verbose:   true,
	Daemon:    false,
	Address:   "localhost:49500",
	KeepAlive: duration{time.Second * 45},
	BinPath:   filepath.Join(os.Getenv("$GOPATH"), "bin", "gmbhCore"),
}

DefaultSystemCore holds default core settings

View Source
var DefaultSystemProcm = &SystemProcm{
	Address:   "localhost:59500",
	KeepAlive: duration{time.Second * 45},
	Verbose:   true,
	BinPath:   filepath.Join(os.Getenv("$GOPATH"), "bin", "gmbhProcm"),
}

DefaultSystemProcm holds the default procm settings

Functions

This section is empty.

Types

type ServiceConfig

type ServiceConfig struct {
	ID          string   `toml:"id"`
	Args        []string `toml:"args"`
	Env         []string `toml:"env"`
	Language    string   `toml:"language"`
	BinPath     string   `toml:"bin_path"`
	SrcPath     string   `toml:"src_path"`
	Ports       []string `toml:"ports"`
	Interpreter string   `toml:"interpreter"`
	EntryPoint  string   `toml:"entry_point"`
	ProjPath    string
}

ServiceConfig is the static data needed to launch a service from the service launcher

func ParseServices added in v0.9.3

func ParseServices(configFile string) ([]*ServiceConfig, string, error)

ParseServices returns only the services and the fingerprint

func (*ServiceConfig) Verify added in v0.9.3

func (s *ServiceConfig) Verify() error

Verify that a service config is balid

type SystemConfig

type SystemConfig struct {
	Core        *SystemCore      `toml:"core"`
	Procm       *SystemProcm     `toml:"procm"`
	Service     []*ServiceConfig `toml:"service"`
	Fingerprint string           `toml:"fingerprint"`
	MaxPerNode  int              `toml:"max_services_per_node"`
	Dashboard   bool             `toml:"include_dashboard"`
}

SystemConfig - config for gmbh

func ParseSystemConfig

func ParseSystemConfig(configFile string) (*SystemConfig, error)

ParseSystemConfig parses the entire system config from the file passed in otherwise returns an error

type SystemCore

type SystemCore struct {
	Mode      string   `toml:"mode"`
	Verbose   bool     `toml:"verbose"`
	Daemon    bool     `toml:"daemon"`
	Address   string   `toml:"address"`
	KeepAlive duration `toml:"keep_alive"`
	BinPath   string   `toml:"core_bin"`
}

SystemCore stores gmbhCore settings

func ParseSystemCore

func ParseSystemCore(configFile string) (*SystemCore, error)

ParseSystemCore returns only the core settings

type SystemProcm

type SystemProcm struct {
	Address   string   `toml:"address"`
	KeepAlive duration `toml:"keep_alive"`
	Verbose   bool     `toml:"verbose"`
	BinPath   string   `toml:"core_bin"`
}

SystemProcm stores gmbhProcm settings

func ParseSystemProcm

func ParseSystemProcm(configFile string) (*SystemProcm, error)

ParseSystemProcm returns only the procm settings

Jump to

Keyboard shortcuts

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