dbfunc

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package dbfunc contains EliasDB specific functions for the event condition action language (ECAL).

Index

Constants

This section is empty.

Variables

View Source
var ErrWebEventHandled = fmt.Errorf("Web event handled")

ErrWebEventHandled is a special error to signal that a web request was handled.

Functions

func NewGraphNodeFromECALMap

func NewGraphNodeFromECALMap(d map[interface{}]interface{}) data.Node

NewGraphNodeFromECALMap creates a new Node instance from a given map.

Types

type CommitTransFunc

type CommitTransFunc struct {
	GM *graph.Manager
}

CommitTransFunc commits an existing transaction for EliasDB.

func (*CommitTransFunc) DocString

func (f *CommitTransFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*CommitTransFunc) Run

func (f *CommitTransFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type FetchEdgeFunc

type FetchEdgeFunc struct {
	GM *graph.Manager
}

FetchEdgeFunc fetches an edge in EliasDB.

func (*FetchEdgeFunc) DocString

func (f *FetchEdgeFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*FetchEdgeFunc) Run

func (f *FetchEdgeFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type FetchNodeFunc

type FetchNodeFunc struct {
	GM *graph.Manager
}

FetchNodeFunc fetches a node in EliasDB.

func (*FetchNodeFunc) DocString

func (f *FetchNodeFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*FetchNodeFunc) Run

func (f *FetchNodeFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type GraphQLFunc

type GraphQLFunc struct {
	GM *graph.Manager
}

GraphQLFunc runs a GraphQL query.

func (*GraphQLFunc) DocString

func (f *GraphQLFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*GraphQLFunc) Run

func (f *GraphQLFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type NewRollingTransFunc

type NewRollingTransFunc struct {
	GM *graph.Manager
}

NewRollingTransFunc creates a new rolling transaction for EliasDB. A rolling transaction commits after n entries.

func (*NewRollingTransFunc) DocString

func (f *NewRollingTransFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*NewRollingTransFunc) Run

func (f *NewRollingTransFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type NewTransFunc

type NewTransFunc struct {
	GM *graph.Manager
}

NewTransFunc creates a new transaction for EliasDB.

func (*NewTransFunc) DocString

func (f *NewTransFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*NewTransFunc) Run

func (f *NewTransFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type QueryFunc

type QueryFunc struct {
	GM *graph.Manager
}

QueryFunc runs an EQL query.

func (*QueryFunc) DocString

func (f *QueryFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*QueryFunc) Run

func (f *QueryFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type RaiseGraphEventHandledFunc

type RaiseGraphEventHandledFunc struct {
}

RaiseGraphEventHandledFunc returns the special graph.ErrEventHandled error which a sink, handling graph events, can return to notify the GraphManager that no further action is necessary.

func (*RaiseGraphEventHandledFunc) DocString

func (f *RaiseGraphEventHandledFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*RaiseGraphEventHandledFunc) Run

func (f *RaiseGraphEventHandledFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type RaiseWebEventHandledFunc

type RaiseWebEventHandledFunc struct {
}

RaiseWebEventHandledFunc returns a special error which a sink can return to notify the web API that a web request was handled.

func (*RaiseWebEventHandledFunc) DocString

func (f *RaiseWebEventHandledFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*RaiseWebEventHandledFunc) Run

func (f *RaiseWebEventHandledFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type RemoveEdgeFunc

type RemoveEdgeFunc struct {
	GM *graph.Manager
}

RemoveEdgeFunc removes an edge in EliasDB.

func (*RemoveEdgeFunc) DocString

func (f *RemoveEdgeFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*RemoveEdgeFunc) Run

func (f *RemoveEdgeFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type RemoveNodeFunc

type RemoveNodeFunc struct {
	GM *graph.Manager
}

RemoveNodeFunc removes a node in EliasDB.

func (*RemoveNodeFunc) DocString

func (f *RemoveNodeFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*RemoveNodeFunc) Run

func (f *RemoveNodeFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type StoreEdgeFunc

type StoreEdgeFunc struct {
	GM *graph.Manager
}

StoreEdgeFunc inserts or updates an edge in EliasDB.

func (*StoreEdgeFunc) DocString

func (f *StoreEdgeFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*StoreEdgeFunc) Run

func (f *StoreEdgeFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type StoreNodeFunc

type StoreNodeFunc struct {
	GM *graph.Manager
}

StoreNodeFunc inserts a node in EliasDB.

func (*StoreNodeFunc) DocString

func (f *StoreNodeFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*StoreNodeFunc) Run

func (f *StoreNodeFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type TraverseFunc

type TraverseFunc struct {
	GM *graph.Manager
}

TraverseFunc traverses an edge in EliasDB.

func (*TraverseFunc) DocString

func (f *TraverseFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*TraverseFunc) Run

func (f *TraverseFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

type UpdateNodeFunc

type UpdateNodeFunc struct {
	GM *graph.Manager
}

UpdateNodeFunc updates a node in EliasDB (only update the given values of the node).

func (*UpdateNodeFunc) DocString

func (f *UpdateNodeFunc) DocString() (string, error)

DocString returns a descriptive string.

func (*UpdateNodeFunc) Run

func (f *UpdateNodeFunc) Run(instanceID string, vs parser.Scope, is map[string]interface{}, tid uint64, args []interface{}) (interface{}, error)

Run executes the ECAL function.

Jump to

Keyboard shortcuts

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