match

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capture

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

func NewCapture

func NewCapture() *Capture

type CapturePattern

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

func (CapturePattern) Previous

func (p CapturePattern) Previous() Pattern

type Captures

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

func MakeCaptures

func MakeCaptures(c *Capture, v any) *Captures

func (*Captures) AddAll

func (cs *Captures) AddAll(o *Captures) *Captures

type EmptyMatch

type EmptyMatch struct{}

func (EmptyMatch) Captures

func (m EmptyMatch) Captures() *Captures

func (EmptyMatch) Filter

func (m EmptyMatch) Filter(fn func(any) bool) Match

func (EmptyMatch) Map

func (m EmptyMatch) Map(fn func(any) any) Match

func (EmptyMatch) Present

func (m EmptyMatch) Present() bool

func (EmptyMatch) Value

func (m EmptyMatch) Value() any

type EqualsPattern

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

func (EqualsPattern) Previous

func (p EqualsPattern) Previous() Pattern

type FilterPattern

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

func (FilterPattern) Previous

func (p FilterPattern) Previous() Pattern

type Match

type Match interface {
	Present() bool
	Value() any
	Captures() *Captures

	Filter(fn func(any) bool) Match
	Map(fn func(any) any) Match
}

func Run

func Run(p Pattern, v any, cs *Captures) Match

type Pattern

type Pattern interface {
	Previous() Pattern
	// contains filtered or unexported methods
}

type PresentMatch

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

func (PresentMatch) Captures

func (m PresentMatch) Captures() *Captures

func (PresentMatch) Filter

func (m PresentMatch) Filter(fn func(any) bool) Match

func (PresentMatch) Map

func (m PresentMatch) Map(fn func(any) any) Match

func (PresentMatch) Present

func (m PresentMatch) Present() bool

func (PresentMatch) Value

func (m PresentMatch) Value() any

type Property

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

type PropertyPattern

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

type TypePattern

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

func (TypePattern) Previous

func (p TypePattern) Previous() Pattern

type WithPattern

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

func (WithPattern) Previous

func (p WithPattern) Previous() Pattern

Jump to

Keyboard shortcuts

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