allowlist

package
v0.0.0-...-dc14caf Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type List

type List[T comparable] struct {
	// contains filtered or unexported fields
}

List holds a unique collection of items of type T. Membership can be checked by calling the Contains method.

func NewFromYAML

func NewFromYAML[T comparable](data []byte) (*List[T], error)

NewFromYAML reads a YAML sequence of values of type T and returns a *List[T] containing those values. If data is empty, an empty (deny all) list is returned. If data cannot be parsed, an error is returned.

func NewList

func NewList[T comparable](members []T) *List[T]

NewList returns a *List[T] populated with the provided members of type T. All duplicate entries are ignored, ensuring uniqueness.

func (*List[T]) Contains

func (l *List[T]) Contains(entry T) bool

Contains reports whether the provided entry is a member of the list.

Jump to

Keyboard shortcuts

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