utils

package
v0.0.0-...-36266b1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitBufferWriter

func InitBufferWriter() (*bytes.Buffer, *zip.Writer)

initBufferWriter initializes a bytes buffer that is used to hold all of the information that writer will write to the archive

func NewProgressBar

func NewProgressBar(
	lenghtOfProgressbar int,
	progressBarDescription string,
) *progressbar.ProgressBar

NewProgressBar creates a new progress bar standardized for the project.

func SaveFileToArchive

func SaveFileToArchive(
	replayString string,
	replayFile string,
	compressionMethod uint16,
	writer *zip.Writer,
) bool

SaveFileToArchive creates a file header and saves replayString (JSON) bytes into the zip writer

func SetLogging

func SetLogging(logPath string, logLevel int) (*os.File, bool)

setLogging contains logic that is used to initialize logging to a specified file with a specified level.

func SetProfiling

func SetProfiling(profilingPath string) (*os.File, bool)

setProfiling sets up pprof profiling to a supplied filepath.

Types

type CLIFlags

type CLIFlags struct {
	InputDirectory             string
	OutputDirectory            string
	OnlyDependencyDownload     bool
	SkipDependencyDownload     bool
	DependencyDirectory        string
	NumberOfThreads            int
	NumberOfPackages           int
	PerformIntegrityCheck      bool
	PerformValidityCheck       bool
	PerformCleanup             bool
	PerformPlayerAnonymization bool
	PerformChatAnonymization   bool
	PerformFiltering           bool
	FilterGameMode             int
	LogFlags                   LogFlags
	CPUProfilingPath           string
}

CLIFlags is a structure which holds all of the information that was supplied by user in CLI.

func ParseFlags

func ParseFlags() (CLIFlags, bool)

ParseFlags contains logic which is responsible for user input.

type LogFlags

type LogFlags struct {
	LogLevelValue datastruct.LogLevelEnum
	LogPath       string
}

LogFlags contains settings that the user can set for logging.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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