qry

package module
v0.0.0-...-5828a1f Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 3 Imported by: 0

README

go-qry

Package qry implements query parsing and execution, for the Go programming language.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-qry

GoDoc

Import

To import package qry use import code like the follownig:

import "github.com/reiver/go-qry"

Installation

To install package qry do the following:

GOPROXY=direct go get https://github.com/reiver/go-qry

Author

Package qry was written by Charles Iliya Krempeaux

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(value any) ([]byte, error)

Types

type And

type And[T any] struct {
	Units []Unit[T]
}

func (And[T]) Evaluate

func (receiver And[T]) Evaluate(value T) (bool, error)

func (And[T]) MarshalQRY

func (receiver And[T]) MarshalQRY() ([]byte, error)

type ContainsBytes

type ContainsBytes struct {
	Values [][]byte
}

func (ContainsBytes) Evaluate

func (receiver ContainsBytes) Evaluate(text []byte) (bool, error)

func (ContainsBytes) MarshalQRY

func (receiver ContainsBytes) MarshalQRY() ([]byte, error)

type ContainsString

type ContainsString struct {
	Values []string
}

func (ContainsString) Evaluate

func (receiver ContainsString) Evaluate(text string) (bool, error)

func (ContainsString) MarshalQRY

func (receiver ContainsString) MarshalQRY() ([]byte, error)

type Evaluator

type Evaluator[T any] interface {
	Evaluate(T) (bool, error)
}

type False

type False[T any] struct{}

func (False[T]) Evaluate

func (receiver False[T]) Evaluate(value T) (bool, error)

func (False[T]) MarshalQRY

func (receiver False[T]) MarshalQRY() ([]byte, error)

type Identity

type Identity[T any] struct {
	Unit Unit[T]
}

func (Identity[T]) Evaluate

func (receiver Identity[T]) Evaluate(value T) (bool, error)

func (Identity[T]) MarshalQRY

func (receiver Identity[T]) MarshalQRY() ([]byte, error)

type Marshaler

type Marshaler interface {
	MarshalQRY() ([]byte, error)
}

type Nand

type Nand[T any] struct {
	Units []Unit[T]
}

func (Nand[T]) Evaluate

func (receiver Nand[T]) Evaluate(value T) (bool, error)

func (Nand[T]) MarshalQRY

func (receiver Nand[T]) MarshalQRY() ([]byte, error)

type Nor

type Nor[T any] struct {
	Units []Unit[T]
}

func (Nor[T]) Evaluate

func (receiver Nor[T]) Evaluate(value T) (bool, error)

func (Nor[T]) MarshalQRY

func (receiver Nor[T]) MarshalQRY() ([]byte, error)

type Not

type Not[T any] struct {
	Unit Unit[T]
}

func (Not[T]) Evaluate

func (receiver Not[T]) Evaluate(value T) (bool, error)

func (Not[T]) MarshalQRY

func (receiver Not[T]) MarshalQRY() ([]byte, error)

type Or

type Or[T any] struct {
	Units []Unit[T]
}

func (Or[T]) Evaluate

func (receiver Or[T]) Evaluate(value T) (bool, error)

func (Or[T]) MarshalQRY

func (receiver Or[T]) MarshalQRY() ([]byte, error)

type True

type True[T any] struct{}

func (True[T]) Evaluate

func (receiver True[T]) Evaluate(value T) (bool, error)

func (True[T]) MarshalQRY

func (receiver True[T]) MarshalQRY() ([]byte, error)

type Unit

type Unit[T any] interface {
	Evaluator[T]
	Marshaler
}

Jump to

Keyboard shortcuts

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