filter

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Factory

type Factory interface {
	Create(params params.Params) (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 params.Params) (Filter, error)

func (FileContentFactory) Name

func (f FileContentFactory) Name() string

type FileFactory

type FileFactory struct{}

func (FileFactory) Create

func (f FileFactory) Create(params params.Params) (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() host.HostDetail
	Name() string
	Owner() string
}

type Jq added in v0.15.0

type Jq struct {
	Exprs       []*gojq.Code
	ExprsString string
	Path        string
}

Jq is a filter that applies a jq expression to a file in the repository.

func (*Jq) Do added in v0.15.0

func (f *Jq) Do(ctx context.Context) (bool, error)

Do implements Filter. It downloads a file from a repository and queries it via a jq expression. It returns true if the query returns at least one node.

func (*Jq) String added in v0.15.0

func (f *Jq) String() string

String implements Filter.

type JqFactory added in v0.15.0

type JqFactory struct{}

JqFactory creates jq filters.

func (JqFactory) Create added in v0.15.0

func (f JqFactory) Create(params params.Params) (Filter, error)

Create implements Factory.

func (JqFactory) Name added in v0.15.0

func (f JqFactory) Name() string

Name implements Factory.

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 params.Params) (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

type Xpath added in v0.13.0

type Xpath struct {
	Exprs []*xpath.Expr
	Path  string
}

Xpath filters repositories by applying an XPath expression to a file in the repository.

func (*Xpath) Do added in v0.13.0

func (x *Xpath) Do(ctx context.Context) (bool, error)

Do implements Filter. It downloads a XML document from a repository and queries it via an XPath expression. It returns true if the XPath expression returns at least one node.

func (*Xpath) String added in v0.13.0

func (x *Xpath) String() string

String implements Filter.

type XpathFactory added in v0.13.0

type XpathFactory struct{}

XpathFactory creates Xpath filters.

func (XpathFactory) Create added in v0.13.0

func (f XpathFactory) Create(params params.Params) (Filter, error)

Create implements Factory.

func (XpathFactory) Name added in v0.13.0

func (f XpathFactory) Name() string

Name implements Factory.

Jump to

Keyboard shortcuts

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