sourcefilter

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allows

func Allows(sources []string, sourceType string, emptySourceAllowed bool) bool

Allows reports whether a normalized source allow-list permits sourceType.

func AllowsKindOrOrigin

func AllowsKindOrOrigin(sources []string, kind, origin string, emptySourceAllowed bool) bool

AllowsKindOrOrigin reports whether a source allow-list permits either a storage/source kind (for example "turn") or an adapter origin source (for example "discord"). This keeps source-kind filters from being silently reinterpreted as adapter prefixes.

Types

type Decision

type Decision struct {
	Allowed            bool
	Wildcard           bool
	EmptySourceMatched bool
	MatchedSource      string
}

Decision is the replayable source-filter outcome behind Allows. It makes wildcard and legacy empty-source matches explicit for callers/tests that need to distinguish an intentional all-source browse from a filtered hit.

func Decide

func Decide(sources []string, sourceType string, emptySourceAllowed bool) Decision

Decide reports the explicit match reason for a normalized source allow-list. Empty allow-lists and wildcard entries permit all sources. When emptySourceAllowed is true, an empty sourceType is treated as a legacy match for callers that historically accepted untyped vector hits.

Jump to

Keyboard shortcuts

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