lists

package
v6.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: PostgreSQL Imports: 1 Imported by: 0

Documentation

Overview

fnmatch pattern list

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And[T any](s []T, fn func(T) bool) bool

func Filter

func Filter[T any](s []T, fn func(T) bool) (out []T)

Filter items from a slice

Keep items for which fn returns true.

func Product

func Product[T any](lists ...[]T) <-chan []T

Types

type Blacklist

type Blacklist []string

func (*Blacklist) Check

func (bl *Blacklist) Check() error

Check verify patterns are valid.

Use it before using MatchString().

func (*Blacklist) Filter

func (bl *Blacklist) Filter(items []Blacklistable) []Blacklistable

func (*Blacklist) Match

func (bl *Blacklist) Match(item Blacklistable) string

func (*Blacklist) MatchString

func (bl *Blacklist) MatchString(item string) string

MatchString returns the first pattern that matches the item.

Use Check() before using MatchString(). panics if pattern is invalid. returns empty string if no match.

type Blacklistable

type Blacklistable interface {
	BlacklistKey() string
}

Jump to

Keyboard shortcuts

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