regex

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*RSchema)

func WithGeneratorSeed

func WithGeneratorSeed(seed int64) Option

WithGeneratorSeed pass specific seed to regex example generator. Necessary for test.

type RSchema

type RSchema struct {
	File *fs.File
	RE   *regexp.Regexp
	// contains filtered or unexported fields
}

func FromFile

func FromFile(f *fs.File, oo ...Option) *RSchema

FromFile creates a Regex schema from file.

func New

func New[T bytes.ByteKeeper](name string, content T, oo ...Option) *RSchema

New creates a Regex schema with specified name and content.

func (*RSchema) AddRule

func (*RSchema) AddRule(string, schema.Rule) error

func (*RSchema) AddType

func (*RSchema) AddType(string, schema.Schema) error

func (*RSchema) Check

func (s *RSchema) Check() error

func (*RSchema) Compile

func (s *RSchema) Compile() error

func (*RSchema) Example

func (s *RSchema) Example() ([]byte, error)

func (*RSchema) GetAST

func (s *RSchema) GetAST() (schema.ASTNode, error)

func (*RSchema) Len

func (s *RSchema) Len() (uint, error)

func (*RSchema) Pattern

func (s *RSchema) Pattern() (string, error)

func (*RSchema) UsedUserTypes

func (*RSchema) UsedUserTypes() ([]string, error)

Jump to

Keyboard shortcuts

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