cuedb

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DataSetMetadataCue = `{
	_dataset: {
		plural: string
		supportedExtensions: [...string]
	}
}`

Can't use dataSetField, yet.

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

func CueValueToGraphQlField added in v0.6.0

func CueValueToGraphQlField(existingObjects map[string]GraphQlObjectGlue, dataSet DataSet, cueValue cue.Value) (graphql.Fields, error)

func CueValueToGraphQlType added in v0.6.0

func CueValueToGraphQlType(value cue.Value) (*graphql.Scalar, error)

Types

type DagNode added in v0.6.0

type DagNode struct {
	Name string
}

func (*DagNode) ID added in v0.6.0

func (d *DagNode) ID() string

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

func (*DataSet) GetDefinitionPath added in v0.2.7

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

func (*DataSet) GetDefinitionPath2 added in v0.7.0

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

func (*DataSet) GetExternalName added in v0.6.0

func (d *DataSet) GetExternalName() string

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) GetPluralName added in v0.7.5

func (d *DataSet) GetPluralName() string

func (*DataSet) GetSchemaCue added in v0.6.0

func (d *DataSet) GetSchemaCue() cue.Value

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

func (*DataSet) String added in v0.6.0

func (d *DataSet) String() string

type DataSetMetadata added in v0.2.7

type DataSetMetadata struct {
	Plural              string
	SupportedExtensions []string
}

type Engine added in v0.2.8

type Engine struct {
	// 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) GetAllData added in v0.6.0

func (r *Engine) GetAllData(dataSetName string) cue.Value

func (*Engine) GetDataSet added in v0.2.8

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

func (*Engine) GetDataSetByPlural added in v0.7.0

func (r *Engine) GetDataSetByPlural(plural string) (DataSet, error)

GetDataSetByID returns a DataSet by its plural name.

func (*Engine) GetDataSets added in v0.2.8

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

func (*Engine) GetDataSetsDAG added in v0.6.0

func (r *Engine) GetDataSetsDAG() *dag.DAG

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) MarshalString added in v0.7.1

func (r *Engine) MarshalString() (string, 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 GraphQlObjectGlue added in v0.6.0

type GraphQlObjectGlue struct {
	Object   *graphql.Object
	Engine   *Engine
	Resolver func(p graphql.ResolveParams) (interface{}, 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