nuggit

package module
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 1 Imported by: 1

README

nuggit

Declarative pipelines for web scraping.

Architecture

Architecture diagram

Client Flow

Client flow diagram

Documentation

Index

Constants

View Source
const (
	AggOpCount     = "count"
	AggOpSum       = "sum"
	AggOpMin       = "min"
	AggOpMax       = "max"
	AggOpAvg       = "avg"
	AggOpStringAgg = "string_agg"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v1.6.0

type Action map[string]string

func (Action) GetAction added in v1.6.0

func (a Action) GetAction() string

func (Action) GetArg added in v1.6.0

func (a Action) GetArg(arg string) (string, bool)

func (Action) GetOrDefaultArg added in v1.6.0

func (a Action) GetOrDefaultArg(arg string) string

func (Action) GetSpec added in v1.7.0

func (a Action) GetSpec() any

func (Action) Set added in v1.6.0

func (a Action) Set(key, value string)

func (Action) SetAction added in v1.6.0

func (a Action) SetAction(action string)

func (Action) SetDigest added in v1.8.0

func (a Action) SetDigest(digest string)

func (Action) SetName added in v1.8.0

func (a Action) SetName(name string)

func (Action) SetOrDefault added in v1.9.0

func (a Action) SetOrDefault(key, value string)

type AggColumn added in v1.9.2

type AggColumn struct {
	ViewColumn `json:",omitempty"`
	Op         AggOp  `json:"op,omitempty"`
	Arg        string `json:"arg,omitempty"`
	Distinct   bool   `json:"distinct,omitempty"`
	Expr       string `json:"expr,omitempty"`
	Filter     string `json:"filter,omitempty"`
	OrderBy    string `json:"order_by,omitempty"`
}

type AggOp added in v1.9.2

type AggOp = string

type Pipe added in v1.6.0

type Pipe struct {
	Actions []Action `json:"actions,omitempty"`
	Point   Point    `json:"point,omitempty"`
}

func (Pipe) GetSpec added in v1.7.0

func (p Pipe) GetSpec() any

type Point added in v1.6.0

type Point struct {
	Nullable bool   `json:"nullable,omitempty"`
	Scalar   Scalar `json:"scalar,omitempty"`
}

func NewPointFromNumber added in v1.6.0

func NewPointFromNumber(x int) Point

func (Point) AsNullable added in v1.6.0

func (p Point) AsNullable() Point

func (Point) AsNumber added in v1.6.0

func (t Point) AsNumber() int

func (Point) String added in v1.6.0

func (p Point) String() string

type Rule added in v1.8.1

type Rule struct {
	Hostname      string   `json:"hostname,omitempty"`
	URLPattern    string   `json:"url_pattern,omitempty"`
	AlwaysTrigger bool     `json:"always_trigger,omitempty"`
	Disable       bool     `json:"disable,omitempty"`
	Labels        []string `json:"labels,omitempty"`
}

func (*Rule) GetAlwaysTrigger added in v1.8.2

func (c *Rule) GetAlwaysTrigger() bool

func (*Rule) GetHostname added in v1.8.1

func (c *Rule) GetHostname() string

func (*Rule) GetLabels added in v1.8.1

func (c *Rule) GetLabels() []string

func (*Rule) GetURLPattern added in v1.8.1

func (c *Rule) GetURLPattern() string

type Scalar added in v1.6.0

type Scalar = string
const (
	Bytes  Scalar = "bytes"
	String Scalar = "string"
	Bool   Scalar = "bool"
	Int    Scalar = "int"
	Float  Scalar = "float"
)

type View added in v1.8.2

type View struct {
	Alias      string       `json:"alias,omitempty"`
	Columns    []ViewColumn `json:"columns,omitempty"`
	AggColumns []AggColumn  `json:"agg_columns,omitempty"`
}

func (*View) GetAlias added in v1.8.2

func (v *View) GetAlias() string

func (*View) GetColumns added in v1.8.2

func (v *View) GetColumns() []ViewColumn

func (*View) GetSpec added in v1.8.2

func (v *View) GetSpec() any

type ViewColumn added in v1.8.2

type ViewColumn struct {
	Alias string `json:"alias,omitempty"`
	Pipe  string `json:"pipe,omitempty"`
	Point Point  `json:"point,omitempty"`
}

Directories

Path Synopsis
nuggit module

Jump to

Keyboard shortcuts

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