loader

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package loader provides rules loading via parser-kit (multi-source fallback/merge).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildLoadOptions

func BuildLoadOptions(cfg *cmd.Config, appMode string) *parserkit.LoadOptions

BuildLoadOptions builds parser-kit LoadOptions from warden config and app mode.

func BuildSources

func BuildSources(rulesFile, configURL, auth, appMode string) []parserkit.Source

BuildSources builds parser-kit sources for the given mode (priority order).

Types

type RulesLoader

type RulesLoader struct {
	// contains filtered or unexported fields
}

RulesLoader wraps parser-kit DataLoader and exposes FromFile/Load by (rulesFile, configURL, auth).

func NewRulesLoader

func NewRulesLoader(cfg *cmd.Config, appMode string) (*RulesLoader, error)

NewRulesLoader creates a RulesLoader using cfg and appMode.

func (*RulesLoader) FromFile

func (r *RulesLoader) FromFile(ctx context.Context, path string) ([]define.AllowListUser, error)

FromFile loads rules from a local file.

func (*RulesLoader) Load

func (r *RulesLoader) Load(ctx context.Context, rulesFile, configURL, auth string) ([]define.AllowListUser, error)

Load loads rules from sources built from (rulesFile, configURL, auth) and r.appMode.

Jump to

Keyboard shortcuts

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