attributes

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package attributes provides functionality for handling/using the plugin attributes system.

The plugin attributes provide a generic way to store additional data in the core model. The data is generic JSON and can be stored on relations to Objects, Users and combinations of the two.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModifyFn added in v0.5.6

func ModifyFn(value map[string]any) modify.Fn[entry.AttributePayload]

ModifyFnFromAttributeValue creates a modify function for (api) attribute input.

func PluginAttributeFromQuery

func PluginAttributeFromQuery(c *gin.Context, n universe.Node) (universe.AttributeType, entry.AttributeID, error)

Get attribute definition for API query.

func PluginAttributeFromURL added in v0.5.4

func PluginAttributeFromURL(c *gin.Context, n universe.Node) (universe.AttributeType, entry.AttributeID, error)

Get plugin attribute definition from API URL params.

Types

type AttributeMap added in v0.5.6

type AttributeMap struct {
	UserObject []AttributeValue `json:"object_user"`
}

Type for API input/output of multiple attribute types. For now, we only support 1 type.

type AttributeValue added in v0.5.6

type AttributeValue struct {
	QueryPluginAttribute
	Value map[string]any `json:"value"`
}

Struct to use for API attribute objects.

type QueryPluginAttribute

type QueryPluginAttribute struct {
	PluginID      string `form:"plugin_id" json:"plugin_id" binding:"required"`
	AttributeName string `form:"attribute_name" json:"attribute_name" binding:"required"`
}

Struct to use for API query/params to select a plugin attribute.

Jump to

Keyboard shortcuts

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