Documentation ¶
Index ¶
- Constants
- Variables
- func ComputeJVMHeapSizeInBytes(hostProcessorCount int, cgroupMemoryLimitInBytes uint64) (uint64, error)
- func GetConfigsFromFiles(staticConfigFile string, customConfigFile string, stdout io.Writer) (PrimaryStaticLauncherConfig, PrimaryCustomLauncherConfig, error)
- func IsPidAlive(pid int) bool
- func IsProcessAlive(process *os.Process) bool
- func MkDirs(dirs []string, stdout io.Writer) error
- func SignalPid(pid int, sign os.Signal) error
- type AllowedLauncherConfigValues
- type CGroupMemoryLimit
- type CGroupName
- type CGroupPather
- type CGroupV1Pather
- type CGroupV1ProcessorCounter
- type CreateLogger
- type CustomLauncherConfig
- type ExperimentalLauncherConfig
- type JavaConfig
- type MemoryLimit
- type NoopClosingWriter
- type PrimaryCustomLauncherConfig
- type PrimaryStaticLauncherConfig
- type ProcessMonitor
- type ProcessorCounter
- type ServiceCmds
- type ServiceLoggers
- type SimpleWriterLogger
- type StaticLauncherConfig
- type TypedConfig
- type VersionedConfig
Constants ¶
View Source
const ( TemplateDelimsOpen = "{{" TemplateDelimsClose = "}}" // ExecPathBlackListRegex matches characters disallowed in paths we allow to be passed to exec() ExecPathBlackListRegex = `[^\w.\/_\-]` BytesInMebibyte = 1048576 )
View Source
const (
CheckPeriod = 5 * time.Second
)
Variables ¶
View Source
var DefaultCGroupV1Pather = CGroupV1Pather{ // contains filtered or unexported fields }
View Source
var DefaultCGroupV1ProcessorCounter = CGroupV1ProcessorCounter{ // contains filtered or unexported fields }
View Source
var DefaultMemoryLimit = NewCGroupMemoryLimit(os.DirFS("/"))
Functions ¶
func ComputeJVMHeapSizeInBytes ¶ added in v1.93.0
func ComputeJVMHeapSizeInBytes(hostProcessorCount int, cgroupMemoryLimitInBytes uint64) (uint64, error)
ComputeJVMHeapSizeInBytes If the experimental `ContainerV2` is set to `true` (which it is by default), compute the heap size to be 75% of the heap minus 3mb per processor, with a minimum value of 50% of the heap.
func GetConfigsFromFiles ¶
func GetConfigsFromFiles( staticConfigFile string, customConfigFile string, stdout io.Writer) ( PrimaryStaticLauncherConfig, PrimaryCustomLauncherConfig, error)
func IsPidAlive ¶
func IsProcessAlive ¶
Types ¶
type CGroupMemoryLimit ¶ added in v1.93.0
type CGroupMemoryLimit struct {
// contains filtered or unexported fields
}
func (CGroupMemoryLimit) MemoryLimitInBytes ¶ added in v1.93.0
func (c CGroupMemoryLimit) MemoryLimitInBytes() (uint64, error)
type CGroupName ¶ added in v1.63.0
type CGroupName string
type CGroupPather ¶ added in v1.63.0
type CGroupPather interface {
Path(name CGroupName) (string, error)
}
func NewCGroupV1Pather ¶ added in v1.63.0
func NewCGroupV1Pather(filesystem fs.FS) CGroupPather
type CGroupV1Pather ¶ added in v1.63.0
type CGroupV1Pather struct {
// contains filtered or unexported fields
}
func (CGroupV1Pather) Path ¶ added in v1.63.0
func (c CGroupV1Pather) Path(name CGroupName) (string, error)
Path implements CGroupPather
type CGroupV1ProcessorCounter ¶ added in v1.61.0
type CGroupV1ProcessorCounter struct {
// contains filtered or unexported fields
}
func (CGroupV1ProcessorCounter) ProcessorCount ¶ added in v1.61.0
func (c CGroupV1ProcessorCounter) ProcessorCount() (uint, error)
type CreateLogger ¶
type CreateLogger func() (io.WriteCloser, error)
type CustomLauncherConfig ¶
type CustomLauncherConfig struct { TypedConfig `yaml:",inline"` JvmOpts []string `yaml:"jvmOpts"` Env map[string]string `yaml:"env"` Experimental ExperimentalLauncherConfig `yaml:"experimental"` DisableContainerSupport bool `yaml:"dangerousDisableContainerSupport"` }
type ExperimentalLauncherConfig ¶ added in v1.61.0
type ExperimentalLauncherConfig struct {
ContainerV2 *bool `yaml:"containerV2"`
}
type JavaConfig ¶
type MemoryLimit ¶ added in v1.93.0
func NewCGroupMemoryLimit ¶ added in v1.93.0
func NewCGroupMemoryLimit(filesystem fs.FS) MemoryLimit
type NoopClosingWriter ¶
func (*NoopClosingWriter) Close ¶
func (n *NoopClosingWriter) Close() error
type PrimaryCustomLauncherConfig ¶
type PrimaryCustomLauncherConfig struct { VersionedConfig `yaml:",inline"` CustomLauncherConfig `yaml:",inline"` SubProcesses map[string]CustomLauncherConfig `yaml:"subProcesses"` CgroupsV1 map[string]string `yaml:"cgroupsV1"` }
type PrimaryStaticLauncherConfig ¶
type PrimaryStaticLauncherConfig struct { VersionedConfig `yaml:",inline"` ServiceName string `yaml:"serviceName"` StaticLauncherConfig `yaml:",inline"` SubProcesses map[string]StaticLauncherConfig `yaml:"subProcesses"` }
type ProcessMonitor ¶
func (*ProcessMonitor) ForwardSignals ¶
func (m *ProcessMonitor) ForwardSignals()
func (*ProcessMonitor) KillSubProcesses ¶
func (m *ProcessMonitor) KillSubProcesses() error
func (*ProcessMonitor) Run ¶
func (m *ProcessMonitor) Run() error
func (*ProcessMonitor) SignalSubProcesses ¶
func (m *ProcessMonitor) SignalSubProcesses(sign os.Signal) error
func (*ProcessMonitor) TermProcessGroupOnDeath ¶
func (m *ProcessMonitor) TermProcessGroupOnDeath() error
type ProcessorCounter ¶ added in v1.61.0
func NewCGroupV1ProcessorCounter ¶ added in v1.61.0
func NewCGroupV1ProcessorCounter(filesystem fs.FS) ProcessorCounter
type ServiceCmds ¶
func CompileCmdsFromConfig ¶
func CompileCmdsFromConfig( staticConfig *PrimaryStaticLauncherConfig, customConfig *PrimaryCustomLauncherConfig, loggers ServiceLoggers) ( serviceCmds *ServiceCmds, err error)
type ServiceLoggers ¶
type ServiceLoggers interface { PrimaryLogger() (io.WriteCloser, error) SubProcessLogger(name string) CreateLogger }
type SimpleWriterLogger ¶
type SimpleWriterLogger struct {
// contains filtered or unexported fields
}
func NewSimpleWriterLogger ¶
func NewSimpleWriterLogger(writer io.Writer) *SimpleWriterLogger
func (*SimpleWriterLogger) PrimaryLogger ¶
func (s *SimpleWriterLogger) PrimaryLogger() (io.WriteCloser, error)
func (*SimpleWriterLogger) SubProcessLogger ¶
func (s *SimpleWriterLogger) SubProcessLogger(name string) CreateLogger
type StaticLauncherConfig ¶
type StaticLauncherConfig struct { TypedConfig `yaml:",inline"` JavaConfig `yaml:",inline"` Env map[string]string `yaml:"env"` Executable string `yaml:"executable,omitempty"` Args []string `yaml:"args"` Dirs []string `yaml:"dirs"` }
type TypedConfig ¶
type TypedConfig struct {
Type string `yaml:"configType"`
}
type VersionedConfig ¶
type VersionedConfig struct {
Version int `yaml:"configVersion"`
}
Click to show internal directories.
Click to hide internal directories.