config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = Config{
	Path:     "/belgic",
	Port:     "8080",
	Backends: "max",
	Attempts: 5,
}

Default configuration object.

Functions

func CheckConfigPath

func CheckConfigPath(path string) error

CheckConfigPath Checks that the path to create the configuration file is correct.

func Create

func Create(path string) error

Create the default configuration file.

func GetFreePort

func GetFreePort() (int, error)

GetFreePort retrieves a free (available) to set as option in R before launching application.

Types

type Backend

type Backend struct {
	Port  int
	Path  string
	Rpath string
	Mu    *sync.RWMutex
}

RCommand represents a single R command.

func (*Backend) ExecuteCommand

func (back *Backend) ExecuteCommand(port int, rprog, script string, stdout chan string)

func (*Backend) RunApp

func (back *Backend) RunApp(stdout chan string) error

runApp run a single application.

type Config

type Config struct {
	Path     string `json:"path"`       // path to application
	Port     string `json:"port"`       // port to server apps on
	Backends string `json:"background"` // number of backends to run
	Attempts int    `json:"attempts"`   // maximum number of attempts
}

Config structure.

func Read

func Read() (Config, error)

Read the configuration file.

Jump to

Keyboard shortcuts

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