util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTLSConf

func GenerateTLSConf() (serverTLSConf *tls.Config, err error)

func PackBits

func PackBits(d0, d1, d2, d3, d4, d5, d6, d7 bool) byte

PackBits packs 8 bools into a byte. NOTE: d0 is the LSB, d7 is the MSB.

func TypeToPointer

func TypeToPointer[T any](t T) *T

func UnpackBits

func UnpackBits(b byte) (d0, d1, d2, d3, d4, d5, d6, d7 bool)

PackBits unpacks 8 bools from a byte. NOTE: d0 is the LSB, d7 is the MSB.

Types

type ProcessLogWrapper

type ProcessLogWrapper struct {
	Logger zerolog.Logger
	Level  zerolog.Level
}

func NewProcessLogWrapper

func NewProcessLogWrapper(logger zerolog.Logger, level zerolog.Level) *ProcessLogWrapper

func (*ProcessLogWrapper) Write

func (p *ProcessLogWrapper) Write(data []byte) (int, error)

type ProgramRunner

type ProgramRunner struct {
	MaxRetries    int
	InterRunDelay time.Duration

	Program     string
	Args        []string
	SysProcAttr syscall.SysProcAttr
	// contains filtered or unexported fields
}

func (*ProgramRunner) Run

func (p *ProgramRunner) Run(component string, ctx context.Context) error

func (*ProgramRunner) String

func (p *ProgramRunner) String() string

type UserInfo

type UserInfo struct {
	UID  uint32
	GID  uint32
	GIDS []uint32
}

func GetUserInfo

func GetUserInfo(username string) (*UserInfo, error)

Jump to

Keyboard shortcuts

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