exporter

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter interface {
	io.Closer

	// Begin signals that count entities will be transmitted for the given bundle
	Begin(bundle *pathbuilder.Bundle, count int64) error

	// Add adds entities for the given bundle
	Add(bundle *pathbuilder.Bundle, entity *wisski.Entity) error

	// End signals that no more entities will be submitted for the given bundle
	End(bundle *pathbuilder.Bundle) error
}

Exporter handles WissKI Entities

type Map

type Map struct {
	Data map[string][]wisski.Entity
	// contains filtered or unexported fields
}

Map implements an exporter that stores data inside a map.

func (*Map) Add

func (mp *Map) Add(bundle *pathbuilder.Bundle, entity *wisski.Entity) error

Add adds entities for the given bundle

func (*Map) Begin

func (mp *Map) Begin(bundle *pathbuilder.Bundle, count int64) error

Begin signals that count entities will be transmitted for the given bundle

func (*Map) Close

func (mp *Map) Close() error

func (*Map) End

func (mp *Map) End(bundle *pathbuilder.Bundle) error

End signals that no more entities will be submitted for the given bundle

type SQL

type SQL struct {
	DB *sql.DB

	BatchSize   int // BatchSize for top-level bundles
	MaxQueryVar int // Maximum number of query variables (overrides BatchSize)

	MakeFieldTables bool   // create tables for field values (if false, they get joined with "seperator")
	Separator       string // Seperator for database multi-valued fields
	// contains filtered or unexported fields
}

SQL implements an exporter for storing data inside an sql database. TODO(twiesing): For now this only supports string-like fields.

func (*SQL) Add

func (sql *SQL) Add(bundle *pathbuilder.Bundle, entity *wisski.Entity) (err error)

func (*SQL) Begin

func (sql *SQL) Begin(bundle *pathbuilder.Bundle, count int64) error

func (*SQL) BundleTable

func (*SQL) BundleTable(bundle *pathbuilder.Bundle) string

func (*SQL) Close

func (sql *SQL) Close() error

func (*SQL) CreateFieldTable

func (sql *SQL) CreateFieldTable(bundle *pathbuilder.Bundle, field pathbuilder.Field) error

CreateFieldTable creates a table for the given field

func (*SQL) End

func (sql *SQL) End(bundle *pathbuilder.Bundle) error

func (*SQL) FieldColumn

func (*SQL) FieldColumn(field pathbuilder.Field) string

func (*SQL) FieldTable

func (*SQL) FieldTable(bundle *pathbuilder.Bundle, field pathbuilder.Field) string

Jump to

Keyboard shortcuts

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