crud

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Overview

Foliage graph store crud package. Provides stateful functions of low-level crud operations for the graph store

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LLAPILinkCreate

func LLAPILinkCreate(executor sfplugins.StatefunExecutor, contextProcessor *sfplugins.StatefunContextProcessor)

Creates a link of type="link_type" from an object with id the funcion being called with to an object with id="descendant_uuid". Preliminarily deletes an existing link with the same type leading to the same descendant if present. If caller is not empty returns result to the caller else returns result to the nats topic.

Request:

payload: json - required
	// Initial request from caller:
	query_id: string - optional // ID for this query. Transaction id for operations with the cache. Do not use the same for concurrent graph modify operations.
	descendant_uuid: string - optional // ID for descendant object. If not defined random UUID will be generated. If a descandant with the specified uuid does not exist - will be created with empty body.
	link_type: string - optional // Type of link leading to descendant. If not defined random UUID will be used.
	link_body: json - optional // Body for link leading to descendant.
		tags: []string - optional // Defines link tags.
		<key>: <type> - optional // Any additional key and value to be stored in link's body.

	// Self-requests to descendants (GolangCallSync): // ID can be composite: <object_id>===create_in_link - for non-blocking execution on the same object
		query_id: string - required // ID for this query.
		in_link_type: string - required // Type of input link to create

Reply:

payload: json
	status: string
	result: any

func LLAPILinkDelete

func LLAPILinkDelete(executor sfplugins.StatefunExecutor, contextProcessor *sfplugins.StatefunContextProcessor)

Delete a link of type="link_type" from an object with id the funcion being called with to an object with id="descendant_uuid". If caller is not empty returns result to the caller else returns result to the nats topic.

Request:

payload: json - required
	// Initial request from caller:
	query_id: string - optional // ID for this query. Transaction id for operations with the cache. Do not use the same for concurrent graph modify operations.
	descendant_uuid: string - required // ID for descendant object.
	link_type: string - required // Type of link leading to descendant.

	// Self-requests to descendants (GolangCallSync): // ID can be composite: <object_id>===delete_in_link - for non-blocking execution on the same object
	query_id: string - required // ID for this query.
	in_link_type: string - required // Type of input link to delete

Reply:

payload: json
	status: string
	result: any

func LLAPILinkUpdate

func LLAPILinkUpdate(executor sfplugins.StatefunExecutor, contextProcessor *sfplugins.StatefunContextProcessor)

Updates a link of type="link_type" from an object with id the funcion being called with to an object with id="descendant_uuid". Merges the old link's body with the new one. Creates a new one if the link does not exist. If caller is not empty returns result to the caller else returns result to the nats topic.

Request:

payload: json - required
	// Initial request from caller:
	query_id: string - optional // ID for this query. Transaction id for operations with the cache. Do not use the same for concurrent graph modify operations.
	descendant_uuid: string - required // ID for descendant object. If a descandant with the specified uuid does not exist - will be created with empty body.
	link_type: string - required // Type of link leading to descendant.
	link_body: json - required // Body for link leading to descendant.
		tags: []string - optional // Defines link tags.
		<key>: <type> - optional // Any additional key and value to be stored in link's body.

Reply:

payload: json
	status: string
	result: any

func LLAPIObjectCreate

func LLAPIObjectCreate(executor sfplugins.StatefunExecutor, contextProcessor *sfplugins.StatefunContextProcessor)

Creates an object in the graph with an id the function being called with. Preliminarily deletes an existing one with the same id, if present. If caller is not empty returns result to the caller else returns result to the nats topic.

Request:

payload: json - required
	// Initial request from caller:
	query_id: string - optional // ID for this query. Transaction id for operations with the cache. Do not use the same for concurrent graph modify operations.
	body: json - required // Body for object to be created with.
		<key>: <type> - optional // Any additional key and value to be stored in objects's body.

Reply:

payload: json
	status: string
	result: any

func LLAPIObjectDelete

func LLAPIObjectDelete(executor sfplugins.StatefunExecutor, contextProcessor *sfplugins.StatefunContextProcessor)

Deletes an object with an id the function being called with from the graph and deletes all links related to it. If caller is not empty returns result to the caller else returns result to the nats topic.

Request:

payload: json - required
	// Initial request from caller:
	query_id: string - optional // ID for this query. Transaction id for operations with the cache. Do not use the same for concurrent graph modify operations.

Reply:

payload: json
	status: string
	result: any

func LLAPIObjectUpdate

func LLAPIObjectUpdate(executor sfplugins.StatefunExecutor, contextProcessor *sfplugins.StatefunContextProcessor)

Updates an object in the graph with an id the function being called with. Merges the old object's body with the new one. Creates a new one if the object does not exist. If caller is not empty returns result to the caller else returns result to the nats topic.

Request:

payload: json - required
	// Initial request from caller:
	query_id: string - optional // ID for this query. Transaction id for operations with the cache. Do not use the same for concurrent graph modify operations.
	body: json - required // Body for object to be created with.
		<key>: <type> - optional // Any additional key and value to be stored in objects's body.

Reply:

payload: json
	status: string
	result: any

func RegisterAllFunctionTypes

func RegisterAllFunctionTypes(runtime *statefun.Runtime)

Types

This section is empty.

Jump to

Keyboard shortcuts

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