object_user_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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB(conn *pgxpool.Pool, commonDB database.CommonDB) *DB

func (*DB) GetObjectUserAttributeByID

func (db *DB) GetObjectUserAttributeByID(
	ctx context.Context, objectUserAttributeID entry.ObjectUserAttributeID,
) (*entry.ObjectUserAttribute, error)

func (*DB) GetObjectUserAttributeOptionsByID

func (db *DB) GetObjectUserAttributeOptionsByID(
	ctx context.Context, objectUserAttributeID entry.ObjectUserAttributeID,
) (*entry.AttributeOptions, error)

func (*DB) GetObjectUserAttributePayloadByID

func (db *DB) GetObjectUserAttributePayloadByID(
	ctx context.Context, objectUserAttributeID entry.ObjectUserAttributeID,
) (*entry.AttributePayload, error)

func (*DB) GetObjectUserAttributeValueByID

func (db *DB) GetObjectUserAttributeValueByID(
	ctx context.Context, objectUserAttributeID entry.ObjectUserAttributeID,
) (*entry.AttributeValue, error)

func (*DB) GetObjectUserAttributes

func (db *DB) GetObjectUserAttributes(ctx context.Context) ([]*entry.ObjectUserAttribute, error)

func (*DB) GetObjectUserAttributesByObjectAttributeID

func (db *DB) GetObjectUserAttributesByObjectAttributeID(
	ctx context.Context, objectAttributeID entry.ObjectAttributeID,
) ([]*entry.ObjectUserAttribute, error)

func (*DB) GetObjectUserAttributesByObjectID

func (db *DB) GetObjectUserAttributesByObjectID(
	ctx context.Context, objectID umid.UMID,
) ([]*entry.ObjectUserAttribute, error)

func (*DB) GetObjectUserAttributesByObjectIDAndUserID

func (db *DB) GetObjectUserAttributesByObjectIDAndUserID(
	ctx context.Context, objectID umid.UMID, userID umid.UMID,
) ([]*entry.ObjectUserAttribute, error)

func (*DB) GetObjectUserAttributesByObjectIDsAttributeIDs added in v0.5.6

func (db *DB) GetObjectUserAttributesByObjectIDsAttributeIDs(
	ctx context.Context,
	attributeIDs []entry.AttributeID,
	objectIDs []umid.UMID,
	query string,
	orderType universe.OrderType,
	limit uint,
	offset uint,
) ([]*entry.ObjectUserAttribute, error)

func (*DB) GetObjectUserAttributesByUserID

func (db *DB) GetObjectUserAttributesByUserID(
	ctx context.Context, userID umid.UMID,
) ([]*entry.ObjectUserAttribute, error)

func (*DB) GetObjectUserAttributesCount

func (db *DB) GetObjectUserAttributesCount(ctx context.Context) (int64, error)

func (*DB) GetObjectUserAttributesCountByObjectID added in v0.5.4

func (db *DB) GetObjectUserAttributesCountByObjectID(ctx context.Context, objectID umid.UMID, attributeName string, sinceTime *time.Time) (uint64, error)

func (*DB) GetObjectUserAttributesCountByObjectIDNullable added in v0.5.6

func (db *DB) GetObjectUserAttributesCountByObjectIDNullable(ctx context.Context, objectID umid.UMID, attributeName string) (uint64, error)

func (*DB) RemoveObjectUserAttributeByID

func (db *DB) RemoveObjectUserAttributeByID(
	ctx context.Context, objectUserAttributeID entry.ObjectUserAttributeID,
) error

func (*DB) RemoveObjectUserAttributesByAttributeID

func (db *DB) RemoveObjectUserAttributesByAttributeID(
	ctx context.Context, attributeID entry.AttributeID,
) error

func (*DB) RemoveObjectUserAttributesByName

func (db *DB) RemoveObjectUserAttributesByName(ctx context.Context, name string) error

func (*DB) RemoveObjectUserAttributesByNameAndObjectID

func (db *DB) RemoveObjectUserAttributesByNameAndObjectID(
	ctx context.Context, name string, objectID umid.UMID,
) error

func (*DB) RemoveObjectUserAttributesByNameAndObjectIDAndUserID

func (db *DB) RemoveObjectUserAttributesByNameAndObjectIDAndUserID(
	ctx context.Context, name string, objectID umid.UMID, userID umid.UMID,
) error

func (*DB) RemoveObjectUserAttributesByNameAndUserID

func (db *DB) RemoveObjectUserAttributesByNameAndUserID(
	ctx context.Context, name string, userID umid.UMID,
) error

func (*DB) RemoveObjectUserAttributesByNames

func (db *DB) RemoveObjectUserAttributesByNames(ctx context.Context, names []string) error

func (*DB) RemoveObjectUserAttributesByNamesAndObjectID

func (db *DB) RemoveObjectUserAttributesByNamesAndObjectID(
	ctx context.Context, names []string, objectID umid.UMID,
) error

func (*DB) RemoveObjectUserAttributesByNamesAndObjectIDAndUserID

func (db *DB) RemoveObjectUserAttributesByNamesAndObjectIDAndUserID(
	ctx context.Context, names []string, objectID umid.UMID, userID umid.UMID,
) error

func (*DB) RemoveObjectUserAttributesByNamesAndUserID

func (db *DB) RemoveObjectUserAttributesByNamesAndUserID(
	ctx context.Context, names []string, userID umid.UMID,
) error

func (*DB) RemoveObjectUserAttributesByObjectAttributeID

func (db *DB) RemoveObjectUserAttributesByObjectAttributeID(
	ctx context.Context, objectAttributeID entry.ObjectAttributeID,
) error

func (*DB) RemoveObjectUserAttributesByObjectID

func (db *DB) RemoveObjectUserAttributesByObjectID(
	ctx context.Context, objectID umid.UMID,
) error

func (*DB) RemoveObjectUserAttributesByObjectIDAndUserID

func (db *DB) RemoveObjectUserAttributesByObjectIDAndUserID(
	ctx context.Context, objectID umid.UMID, userID umid.UMID,
) error

func (*DB) RemoveObjectUserAttributesByPluginID

func (db *DB) RemoveObjectUserAttributesByPluginID(ctx context.Context, pluginID umid.UMID) error

func (*DB) RemoveObjectUserAttributesByPluginIDAndObjectID

func (db *DB) RemoveObjectUserAttributesByPluginIDAndObjectID(
	ctx context.Context, pluginID umid.UMID, objectID umid.UMID,
) error

func (*DB) RemoveObjectUserAttributesByPluginIDAndObjectIDAndUserID

func (db *DB) RemoveObjectUserAttributesByPluginIDAndObjectIDAndUserID(
	ctx context.Context, pluginID umid.UMID, objectID umid.UMID, userID umid.UMID,
) error

func (*DB) RemoveObjectUserAttributesByPluginIDAndUserID

func (db *DB) RemoveObjectUserAttributesByPluginIDAndUserID(
	ctx context.Context, pluginID umid.UMID, userID umid.UMID,
) error

func (*DB) RemoveObjectUserAttributesByUserAttributeID

func (db *DB) RemoveObjectUserAttributesByUserAttributeID(
	ctx context.Context, userAttributeID entry.UserAttributeID,
) error

func (*DB) RemoveObjectUserAttributesByUserID

func (db *DB) RemoveObjectUserAttributesByUserID(
	ctx context.Context, userID umid.UMID,
) error

func (*DB) UpdateObjectUserAttributeOptions

func (db *DB) UpdateObjectUserAttributeOptions(
	ctx context.Context, objectUserAttributeID entry.ObjectUserAttributeID, modifyFn modify.Fn[entry.AttributeOptions],
) (*entry.AttributeOptions, error)

func (*DB) UpdateObjectUserAttributeValue

func (db *DB) UpdateObjectUserAttributeValue(
	ctx context.Context, objectUserAttributeID entry.ObjectUserAttributeID, modifyFn modify.Fn[entry.AttributeValue],
) (*entry.AttributeValue, error)

func (*DB) UpsertObjectUserAttribute

func (db *DB) UpsertObjectUserAttribute(
	ctx context.Context, objectUserAttributeID entry.ObjectUserAttributeID, modifyFn modify.Fn[entry.AttributePayload],
) (*entry.AttributePayload, error)

func (*DB) ValueEntries added in v0.5.4

func (db *DB) ValueEntries(
	ctx context.Context,
	attrID entry.ObjectAttributeID,
	fields []string,
	filters map[string]string,
	search string,
	order string,
	descending bool,
	limit uint,
	offset uint,
) ([]map[string]interface{}, error)

ValueEntries returns a combined, filtered, sorted, list of nested items inside a attribute. fields is the list of field name returned for each nested items, should be simple values (are seen as strings).

The JSON value is expectd to be an object with key->item format. The key being some unique identifier and the item some nested JSON.

{
  "id-1": {"title": "bar", "some": {"thing": 1}},
  "id-2": {"title": "qux", "some": {"other": "thing"}}
}

The result:

[{"_key": "id-1", "_user": "{...}", "title": "bar"},{"_key": "id-2", "_user": "{...}", title": "qux"}]

func (*DB) ValueEntriesCount added in v0.5.4

func (db *DB) ValueEntriesCount(
	ctx context.Context,
	objectAttributeID entry.ObjectAttributeID,
	fields []string,
	filters map[string]string,
	search string,
) (uint, error)

ValueEntriesCount return the number of nested entries in the JSON value. This assumes an JSON object in the value field. Each entry (key) in this object is counted.

Jump to

Keyboard shortcuts

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