mit

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB is a key value db for the ACI MIT keys are class:dn values are the full JSON record

func New

func New(src Source) (db DB, err error)

New creates a new DB from a temp folder path.

func NewNDO added in v1.1.0

func NewNDO(src Source) (db DB, err error)

NewNDO creates a new DB for NDO from a temp folder path

func (*DB) Close

func (db *DB) Close() error

Close closes the DB.

func (*DB) Find

func (db *DB) Find(pattern string, a ...interface{}) (res []gjson.Result, err error)

Find searches for values by pattern.

func (*DB) FindOne

func (db *DB) FindOne(pattern string, a ...interface{}) (res gjson.Result, err error)

FindOne searches for a value by pattern.

func (*DB) Get

func (db *DB) Get(key string, a ...interface{}) (res gjson.Result, err error)

Get return a value or an error

func (*DB) Set

func (db *DB) Set(key, value string) error

Set sets a value by key

func (*DB) SetMany

func (db *DB) SetMany(vals map[string]interface{}) error

SetMany sets multiple values.

func (*DB) SetRaw

func (db *DB) SetRaw(val string) error

SetRaw ingests raw JSON

type Entry

type Entry struct {
	Class string
	Read  func() ([]byte, error)
}

Entry is an individual source entry

type FolderSource

type FolderSource struct {
	Path string
}

FolderSource is a temp folder source.

Used to read collection results from a temp folder, e.g. a zip archive.

func NewFolderSource

func NewFolderSource(path string) *FolderSource

NewFolderSource creates a new source for folder entries

func (*FolderSource) Entries

func (src *FolderSource) Entries() (entries []*Entry, err error)

Entries fulfills the Source interface.

type MemSource

type MemSource struct {
	// contains filtered or unexported fields
}

MemSource is an in-memory source.

Used to pass collection results directly without touching disk.

func NewMemSource

func NewMemSource() *MemSource

NewMemSource creates a new memory source for database entries.

func (*MemSource) Entries

func (src *MemSource) Entries() ([]*Entry, error)

Entries fulfills the Source interface.

type Source

type Source interface {
	Entries() ([]*Entry, error)
}

Source is a source for the DB data

Jump to

Keyboard shortcuts

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