utils

package
v0.1.37 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGzip  = errors.New("gzip error")
	ErrRead  = errors.New("read error")
	ErrWrite = errors.New("write error")
)

Functions

func CopyFile

func CopyFile(src, dst string) error

func ExtractSectionBytes added in v0.1.18

func ExtractSectionBytes(rdr io.Reader, targetSection string) ([]byte, error)

func GetOSInfo

func GetOSInfo() string

func GetStopTime added in v0.1.10

func GetStopTime() (ts int64)

func GunzipBytes

func GunzipBytes(path string) ([]byte, error)

func OpenRulesFile

func OpenRulesFile(filePath string) (io.Reader, func(), error)

func ParseRules

func ParseRules(rdr io.Reader, opts ...ReaderOptT) (*parser.RulesT, error)

func ParseRulesPath

func ParseRulesPath(path string, opts ...ReaderOptT) (*parser.RulesT, error)

func Sha256Sum

func Sha256Sum(data []byte) string

func UrlBase

func UrlBase(fullUrl string) (string, error)

func WithGenIds added in v0.1.18

func WithGenIds() func(*readerOptsT)

func WithMultiDoc added in v0.1.18

func WithMultiDoc() func(*readerOptsT)

Types

type ReaderOptT added in v0.1.18

type ReaderOptT func(*readerOptsT)

type RulePathT added in v0.1.20

type RulePathT struct {
	Path string
	Type RuleTypeT
}

type RuleTypeT added in v0.1.20

type RuleTypeT string
const (
	RuleTypeCre  RuleTypeT = "cre"
	RuleTypeUser RuleTypeT = "user"
)

Jump to

Keyboard shortcuts

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