Documentation
¶
Overview ¶
Foliage graph store crud package. Provides stateful functions of low-level crud operations for the graph store
Index ¶
- Constants
- func CreateObject(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func CreateObjectsLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func CreateType(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func CreateTypesLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func DeleteObject(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func DeleteObjectFilteredOutLinksStatefun(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func DeleteObjectsLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func DeleteType(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func DeleteTypesLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func LLAPILinkCreate(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func LLAPILinkDelete(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func LLAPILinkRead(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func LLAPILinkUpdate(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func LLAPIVertexCreate(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func LLAPIVertexDelete(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func LLAPIVertexRead(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func LLAPIVertexUpdate(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func ReadObject(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func ReadObjectsLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func ReadType(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func ReadTypesLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func RegisterAllFunctionTypes(runtime *statefun.Runtime)
- func UpdateObject(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func UpdateObjectsLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func UpdateType(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
- func UpdateTypesLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
Constants ¶
const ( KeySuff1Pattern = "%s" KeySuff2Pattern = "%s.%s" KeySuff3Pattern = "%s.%s.%s" KeySuff4Pattern = "%s.%s.%s.%s" // key=fmt.Sprintf(BodyValueIndexPrefPattern+KeySuff2Pattern, <vertexId>, <bodyKeyName>, <valueType>), value=<bodyKeyValue> VertexBodyValueIndexPrefPattern = "%s.body.index." // key=fmt.Sprintf(BodyValueIndexPrefPattern+KeySuff3Pattern, <fromVertexId>, <linkName>, <bodyKeyName>, <valueType>), value=<bodyKeyValue> LinkBodyValueIndexPrefPattern = "%s.out.body.index." // key=fmt.Sprintf(OutLinkBodyKeyPrefPattern+KeySuff1Pattern, <fromVertexId>, <linkName>), value=<linkType.toVertexId> OutLinkTargetKeyPrefPattern = "%s.out.to." // key=fmt.Sprintf(OutLinkBodyKeyPrefPattern+KeySuff2Pattern, <fromVertexId>, <linkName>), value=<linkBody> OutLinkBodyKeyPrefPattern = "%s.out.body." // key=fmt.Sprintf(OutLinkBodyKeyPrefPattern+KeySuff2Pattern, <fromVertexId>, <linkType>, <toVertexId>), value=<linkName> OutLinkTypeKeyPrefPattern = "%s.ltype." // key=fmt.Sprintf(OutLinkIndexPrefPattern+KeySuff3Pattern, <fromVertexId>, <linkName>, <index_name>, <value>), value=nil OutLinkIndexPrefPattern = "%s.out.index." // key=fmt.Sprintf(InLinkKeyPrefPattern+KeySuff2Pattern, <toVertexId>, <fromVertexId>, <linkName>), value=linkType InLinkKeyPrefPattern = "%s.in." )
const ( OBJECTS_TYPELINK = "__objects" TYPES_TYPELINK = "__types" TO_TYPELINK = "__type" OBJECT_TYPELINK = "__object" GROUP_TYPELINK = "group" BUILT_IN_TYPES = "types" BUILT_IN_OBJECTS = "objects" BUILT_IN_ROOT = "root" BUILT_IN_TYPE_GROUP = "group" BUILT_IN_OBJECT_NAV = "nav" )
Variables ¶
This section is empty.
Functions ¶
func CreateObject ¶ added in v0.1.3
func CreateObject(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"origin_type": string
"body": json
}
func CreateObjectsLink ¶ added in v0.1.3
func CreateObjectsLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"to": string,
"name": string, // optional, "to" will be used if not defined
"body": json
"tags": []string
}
create object -> object link
func CreateType ¶ added in v0.1.3
func CreateType(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"body": json
}
func CreateTypesLink ¶ added in v0.1.3
func CreateTypesLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"to": string
"object_type": string
"body": json
"tags": []string
}
create type -> type link
func DeleteObject ¶ added in v0.1.3
func DeleteObject(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
func DeleteObjectFilteredOutLinksStatefun ¶ added in v0.1.6
func DeleteObjectFilteredOutLinksStatefun(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
payload: json - required
link_type: string - required to_object_type: string - required
options: json - optional
op_stack: bool - optional
func DeleteObjectsLink ¶ added in v0.1.3
func DeleteObjectsLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"to": string,
}
func DeleteType ¶ added in v0.1.3
func DeleteType(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
func DeleteTypesLink ¶ added in v0.1.3
func DeleteTypesLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"to": string
}
func LLAPILinkCreate ¶
func LLAPILinkCreate(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
Creates a link.
Request:
payload: json - required // Initial request from caller: force: bool - optional // Creates even if already exists to: string - required // ID for descendant vertex. name: string - required // Defines link's name which is unique among all vertex's output links. type: string - required // Type of link leading to descendant. tags: []string - optional // Defines link tags. body: json - optional // Body for link leading to descendant. <key>: <type> - optional // Any additional key and value to be stored in link's body. // Self-requests to descendants (RequestReply): // ID can be composite: <object_id>===self_link - for non-blocking execution on the same vertex in_name: string - required // Creating input link's name options: json - optional op_stack: bool - optional
Reply:
payload: json status: string details: string data: json op_stack: json array - optional
func LLAPILinkDelete ¶
func LLAPILinkDelete(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
Delete a link.
Request:
payload: json - required // Initial request from caller: name: string - required // Defines link's name which is unique among all vertex's output links. to: string - required if "name" is not defined // ID for descendant vertex. type: string - required if "name" is not defined // Type of link leading to descendant. // Self-requests to descendants (RequestReply): // ID can be composite: <object_id>===self_link - for non-blocking execution on the same vertex in_name: string - required // Deleting input link's name options: json - optional op_stack: bool - optional
Reply:
payload: json status: string details: string data: json op_stack: json array - optional
func LLAPILinkRead ¶ added in v0.1.6
func LLAPILinkRead(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
Reads and returns link's body.
Request:
payload: json - required // Initial request from caller: name: string - required // Defines link's name which is unique among all vertex's output links. to: string - required if "name" is not defined // ID for descendant vertex. type: string - required if "name" is not defined // Type of link leading to descendant. details: bool - optional // "false" - (default) only body will be returned, "true" - body and info will be returned options: json - optional op_stack: bool - optional
Reply:
payload: json status: string details: string data: json body: json // link's body name: string - optional // link's name type: string - optional // link's type tags: string array - optional // link's tags from: string - optional // link goes out from vertex id to: string - optional // link goes into vertex id op_stack: json array - optional
func LLAPILinkUpdate ¶
func LLAPILinkUpdate(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
Updates a link.
Request:
payload: json - required name: string - required if "to" or "type" is not defined. required if "upsert" is set to "true" // Defines link's name which is unique among all vertex's output links. to: string - required if "name" is not defined. required if "upsert" is set to "true" // ID for descendant vertex. type: string - required if "name" is not defined. required if "upsert" is set to "true" // Type of link leading to descendant. tags: []string - optional // Defines link tags. upsert: bool // "false" - (default), "true" - will create link if does not exist replace: bool - optional // "false" - (default) body and tags will be merged, "true" - body and tags will be replaced body: json - optional // Body for link leading to descendant. <key>: <type> - optional // Any additional key and value to be stored in link's body. options: json - optional op_stack: bool - optional
Reply:
payload: json status: string details: string data: json op_stack: json array - optional
func LLAPIVertexCreate ¶ added in v0.1.3
func LLAPIVertexCreate(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
Creates a vertex in the graph with an id the function being called with.
Request:
payload: json - optional // Initial request from caller: body: json - optional // Body for vertex to be created with. <key>: <type> - optional // Any additional key and value to be stored in objects's body. options: json - optional op_stack: bool - optional
Reply:
payload: json status: string details: string data: json op_stack: json array - optional
func LLAPIVertexDelete ¶ added in v0.1.3
func LLAPIVertexDelete(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
Deletes a vartex with an id the function being called with from the graph and deletes all links related to it.
Request:
options: json - optional op_stack: bool - optional
Reply:
payload: json status: string details: string data: json op_stack: json array - optional
func LLAPIVertexRead ¶ added in v0.1.6
func LLAPIVertexRead(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
Reads and returns vertice's body.
Request:
payload: json - optional details: bool - optional // "false" - (default) only body will be returned, "true" - body and links info will be returned options: json - optional op_stack: bool - optional
Reply:
payload: json
status: string
details: string
data: json
body: json // Vertice's body
links: json - optional // Vertice's links
out: json
names: json string array
types: json string array
ids: json string array
in: json string array
{from: string, name: string}, // from vertex id; link name
...
op_stack: json array - optional
func LLAPIVertexUpdate ¶ added in v0.1.3
func LLAPIVertexUpdate(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
Updates a vertex in the graph with an id the function being called with. Merges or replaces the old vertice's body with the new one.
Request:
payload: json - optional body: json - optional // Body for vertex to be created with. <key>: <type> - optional // Any additional key and value to be stored in vertex's body. upsert: bool // "false" - (default), "true" - will create vertex if does not exist replace: bool - optional // "false" - (default) body and tags will be merged, "true" - body and tags will be replaced options: json - optional op_stack: bool - optional
Reply:
payload: json status: string details: string data: json op_stack: json array - optional
func ReadObject ¶ added in v0.1.6
func ReadObject(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
func ReadObjectsLink ¶ added in v0.1.6
func ReadObjectsLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"to": string
}
func ReadType ¶ added in v0.1.6
func ReadType(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
func ReadTypesLink ¶ added in v0.1.6
func ReadTypesLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"to": string
}
func UpdateObject ¶ added in v0.1.3
func UpdateObject(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"origin_type": string, not requred! required only if "upsert"==true
"upsert": bool - optional, default: false
"replace": bool - optional, default: false
"body": json
}
func UpdateObjectsLink ¶ added in v0.1.3
func UpdateObjectsLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"to": string
"name": string, // not needed, required if "upsert" is true
"body": json
"tags": []string
"upsert": bool
"replace": bool
}
func UpdateType ¶ added in v0.1.3
func UpdateType(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"upsert": bool - optional, default: false
"replace": bool - optional, default: false
"body": json
}
func UpdateTypesLink ¶ added in v0.1.3
func UpdateTypesLink(_ sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)
{
"to": string,
"body": json, optional
"tags": []string
"upsert": bool
"replace": bool
}
Types ¶
This section is empty.