cuedb

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BaseConfig = `{
    data_dir: string
    schema_dir: string | *"schemas"
    build_dir: string | *"_build"
}`
View Source
const DataSetMetadataCue = `{
	_dataset: {
		plural: string
		supportedExtensions: [...string]
	}
}`

Can't use dataSetField, yet.

View Source
const DefaultConfigName = "blox.cue"
View Source
const RecordBaseCue = `{
	id: string
}`

RecordBaseCue is the "Base" configuration that blox expects to exist, but doesn't enforce in user-land. We'll inject this Cue into each DataSet definition.

View Source
const SchemaMetadataCue = `{
	_schema: {
		namespace: string
		name: string
	}
}`

Can't use schemaField, yet.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSet added in v0.2.7

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

func (*DataSet) CueDataPath added in v0.2.7

func (d *DataSet) CueDataPath() cue.Path

func (*DataSet) GetDataDirectory added in v0.2.7

func (d *DataSet) GetDataDirectory() string

func (*DataSet) GetDataMapCue added in v0.2.7

func (d *DataSet) GetDataMapCue() string

AddDataMap

func (*DataSet) GetDefinitionPath added in v0.2.7

func (d *DataSet) GetDefinitionPath() cue.Path

func (*DataSet) GetInlinePath added in v0.2.7

func (d *DataSet) GetInlinePath() string

GetInlinePath returns an inline cue.Path that can be used within a Cue document like "some: key: #Here"

func (*DataSet) GetSupportedExtensions added in v0.2.7

func (d *DataSet) GetSupportedExtensions() []string

func (*DataSet) ID added in v0.2.7

func (d *DataSet) ID() string

func (*DataSet) IsSupportedExtension added in v0.2.7

func (d *DataSet) IsSupportedExtension(ext string) bool

type DataSetMetadata added in v0.2.7

type DataSetMetadata struct {
	Plural              string
	SupportedExtensions []string
}

type Engine added in v0.2.8

type Engine struct {
	// configuration
	// embedded runtime database
	*blox.Runtime
	// contains filtered or unexported fields
}

func NewEngine added in v0.2.8

func NewEngine() (*Engine, error)

func (*Engine) CountDataSets added in v0.2.8

func (r *Engine) CountDataSets() int

func (*Engine) GetDataSet added in v0.2.8

func (r *Engine) GetDataSet(name string) (DataSet, error)

func (*Engine) GetDataSets added in v0.2.8

func (r *Engine) GetDataSets() map[string]DataSet

func (*Engine) GetOutput added in v0.2.8

func (r *Engine) GetOutput() (cue.Value, error)

func (*Engine) Insert added in v0.2.8

func (r *Engine) Insert(dataSet DataSet, record map[string]interface{}) error

func (*Engine) MarshalJSON added in v0.2.8

func (r *Engine) MarshalJSON() ([]byte, error)

MarshalJSON returns the database encoded in JSON format

func (*Engine) ReferentialIntegrity added in v0.2.8

func (r *Engine) ReferentialIntegrity() error

ReferentialIntegrity checks the relationships between the records in the content database

func (*Engine) RegisterSchema added in v0.2.8

func (r *Engine) RegisterSchema(cueString string) error

type SchemaMetadata added in v0.2.7

type SchemaMetadata struct {
	Namespace string
	Name      string
}

Jump to

Keyboard shortcuts

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