filter

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuiltInFactories = []Factory{
		FileContentFactory{},
		FileFactory{},
		RepositoryFactory{},
	}
)

Functions

This section is empty.

Types

type Factory

type Factory interface {
	Create(params map[string]any) (Filter, error)
	Name() string
}

type File

type File struct {
	Op    string
	Paths []string
}

func (*File) Do

func (fe *File) Do(ctx context.Context) (bool, error)

func (*File) String

func (fe *File) String() string

type FileContent

type FileContent struct {
	Path   string
	Regexp *regexp.Regexp
}

func (*FileContent) Do

func (fcl *FileContent) Do(ctx context.Context) (bool, error)

func (*FileContent) String

func (fcl *FileContent) String() string

type FileContentFactory

type FileContentFactory struct{}

func (FileContentFactory) Create

func (f FileContentFactory) Create(params map[string]any) (Filter, error)

func (FileContentFactory) Name

func (f FileContentFactory) Name() string

type FileFactory

type FileFactory struct{}

func (FileFactory) Create

func (f FileFactory) Create(params map[string]any) (Filter, error)

func (FileFactory) Name

func (f FileFactory) Name() string

type Filter

type Filter interface {
	Do(context.Context) (bool, error)
	String() string
}

type FilterRepository

type FilterRepository interface {
	GetFile(fileName string) (string, error)
	HasFile(path string) (bool, error)
	Host() string
	Name() string
	Owner() string
}

type Repository

type Repository struct {
	Host  *regexp.Regexp
	Owner *regexp.Regexp
	Repo  *regexp.Regexp
}

func (*Repository) Do

func (r *Repository) Do(ctx context.Context) (bool, error)

func (*Repository) String

func (r *Repository) String() string

type RepositoryFactory

type RepositoryFactory struct{}

func (RepositoryFactory) Create

func (f RepositoryFactory) Create(params map[string]any) (Filter, error)

func (RepositoryFactory) Name

func (f RepositoryFactory) Name() string

type Reverse

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

Reverse takes the result of a wrapped filter and returns the opposite.

func NewReverse

func NewReverse(wrapped Filter) *Reverse

NewReverse returns a new Reverse filter.

func (*Reverse) Do

func (r *Reverse) Do(ctx context.Context) (bool, error)

Do implements Filter

func (*Reverse) String

func (r *Reverse) String() string

String implements Filter

Jump to

Keyboard shortcuts

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