hexpr

package
v0.0.0-...-7f3ab3a Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(e Expr) []byte

Types

type Evaluator

type Evaluator struct {
	GetExpr         func(context.Context, hcorpus.ID) (*Expr, error)
	GetQueryBackend func(string) labels.QueryBackend

	OpenGLFS  func(glfs.Ref) (io.ReaderAt, error)
	OpenGotFS func(gotfs.Root, string) (io.ReaderAt, error)
}

func (*Evaluator) Eval

func (ev *Evaluator) Eval(ctx context.Context, x Expr) (*Value, error)

func (*Evaluator) EvalID

func (ev *Evaluator) EvalID(ctx context.Context, id hcorpus.ID) (*Value, error)

type Expr

type Expr struct {
	GLFS  *GLFSExpr  `json:"glfs,omitempty"`
	GotFS *GotFSExpr `json:"gotfs,omitempty"`

	List *ListExpr `json:"list,omitempty"`
	Set  *SetExpr  `json:"set,omitempty"`

	Query *QueryExpr `json:"query,omitempty"`
	Eval  *Expr      `json:"eval,omitempty"`
}

func NewGLFS

func NewGLFS(ref glfs.Ref) Expr

func ParseExpr

func ParseExpr(x []byte) (*Expr, error)

func (Expr) IsMutable

func (e Expr) IsMutable() bool

type GLFSExpr

type GLFSExpr = glfs.Ref

type GotFSExpr

type GotFSExpr struct {
	Root gotfs.Root `json:"root"`
	Path string     `json:"path"`
}

type ListExpr

type ListExpr = []hcorpus.ID

type QueryExpr

type QueryExpr = struct {
	Index string       `json:"index"`
	Query labels.Query `json:"query"`
}

type SetExpr

type SetExpr = []hcorpus.ID

type Value

type Value struct {
	Type string
	Data io.ReaderAt
}

func (*Value) ForEach

func (v *Value) ForEach(fn func(ID hcorpus.ID) error) error

func (*Value) NewReader

func (v *Value) NewReader() io.ReadSeeker

Jump to

Keyboard shortcuts

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