pattern

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtRLE       = ".rle"
	ExtPlaintext = ".cells"
)

Variables

View Source
var (
	ErrInvalidHeader       = errors.New("invalid header")
	ErrUnexpectedCharacter = errors.New("unexpected character")
	ErrDetectFailed        = errors.New("unable to detect pattern file format")
)
View Source
var ErrNoPatternLinks = errors.New("no pattern links found")
View Source
var ErrResponse = errors.New("HTTP error")

Functions

func Extensions

func Extensions() []string

func FindHrefPatterns

func FindHrefPatterns(resp *http.Response) ([]string, error)

func RLEHeaderRegexp

func RLEHeaderRegexp() *regexp.Regexp

Types

type MultiplePatternsError

type MultiplePatternsError struct {
	URLs []string
}

func (MultiplePatternsError) Error

func (m MultiplePatternsError) Error() string

type Pattern

type Pattern struct {
	Name    string
	Comment string
	Author  string
	Tree    *quadtree.Gosper
	Rule    rule.Rule
}

func Default

func Default() *Pattern

func New

func New(conf *config.Config) (*Pattern, error)

func Unmarshal

func Unmarshal(r io.Reader) (*Pattern, error)

func UnmarshalFile

func UnmarshalFile(path string) (*Pattern, error)

func UnmarshalPlaintext

func UnmarshalPlaintext(r io.Reader) (*Pattern, error)

func UnmarshalRLE

func UnmarshalRLE(r io.Reader) (*Pattern, error)

func UnmarshalURL

func UnmarshalURL(ctx context.Context, url string) (*Pattern, error)

func (Pattern) LogValue

func (p Pattern) LogValue() slog.Value

func (Pattern) NameAuthor

func (p Pattern) NameAuthor() string

func (Pattern) Step

func (p Pattern) Step(steps uint64)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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