Help us shape the future of Go! Take the 2026 Go Developer Survey

system

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceName         string
	User                string
	MemoryLimit         string
	CPUQuota            string
	IOReadBandwidthMax  string
	IOWriteBandwidthMax string
	LimitCORE           string
	DeployDir           string
	DisableSendSigkill  bool
	GrantCapNetRaw      bool
	// Takes one of no, on-success, on-failure, on-abnormal, on-watchdog, on-abort, or always.
	// The Template set as always if this is not setted.
	Restart string
}

Config represent the data to generate systemd config

func NewConfig

func NewConfig(service, user, deployDir string) *Config

NewConfig returns a Config with given arguments

func (*Config) Config

func (c *Config) Config() ([]byte, error)

Config generate the config file data.

func (*Config) ConfigToFile

func (c *Config) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*Config) ConfigWithTemplate

func (c *Config) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate generate the system config content by tpl

func (*Config) WithCPUQuota

func (c *Config) WithCPUQuota(cpu string) *Config

WithCPUQuota set the CPUQuota field of Config

func (*Config) WithIOReadBandwidthMax

func (c *Config) WithIOReadBandwidthMax(io string) *Config

WithIOReadBandwidthMax set the IOReadBandwidthMax field of Config

func (*Config) WithIOWriteBandwidthMax

func (c *Config) WithIOWriteBandwidthMax(io string) *Config

WithIOWriteBandwidthMax set the IOWriteBandwidthMax field of Config

func (*Config) WithLimitCORE added in v1.2.0

func (c *Config) WithLimitCORE(core string) *Config

WithLimitCORE set the LimitCORE field of Config

func (*Config) WithMemoryLimit

func (c *Config) WithMemoryLimit(mem string) *Config

WithMemoryLimit set the MemoryLimit field of Config

type TiSparkConfig added in v1.0.9

type TiSparkConfig struct {
	ServiceName string
	User        string
	DeployDir   string
	JavaHome    string
	// Takes one of no, on-success, on-failure, on-abnormal, on-watchdog, on-abort, or always.
	// The Template set as always if this is not setted.
	Restart string
}

TiSparkConfig represent the data to generate systemd config

func NewTiSparkConfig added in v1.0.9

func NewTiSparkConfig(service, user, deployDir, javaHome string) *TiSparkConfig

NewTiSparkConfig returns a Config with given arguments

func (*TiSparkConfig) Config added in v1.0.9

func (c *TiSparkConfig) Config() ([]byte, error)

Config generate the config file data.

func (*TiSparkConfig) ConfigToFile added in v1.0.9

func (c *TiSparkConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*TiSparkConfig) ConfigWithTemplate added in v1.0.9

func (c *TiSparkConfig) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate generate the system config content by tpl

Jump to

Keyboard shortcuts

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