ruleset

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ruleset provides compilation of local sing-box rule-sets from JSON source format to binary .srs format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(input []byte, outputPath string) error

Compile reads a JSON rule-set source and writes a binary .srs file. The input must be a valid sing-box rule-set JSON with a "rules" array. An optional "version" field controls the SRS format version; if omitted, RuleSetVersionCurrent is used.

Types

type SourceFile

type SourceFile struct {
	Name string
	Path string
}

SourceFile represents a discovered rule-set source file in a server directory.

func FindSourceFiles

func FindSourceFiles(dir string, customRuleSets []string) ([]SourceFile, error)

FindSourceFiles scans the server directory for JSON rule-set source files matching the given custom rule-set names. For each name, it looks for <name>.json in the directory. Files that are cheburbox.json, config.json, or .cheburbox.jsonnet are never treated as rule-set sources.

Jump to

Keyboard shortcuts

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