relations

package
v0.0.0-...-5e759bf Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package relations provides feature to process inner object structure.

Relations is an interface of entity that can receive object header or the information about the object relations.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoLeftSibling is an error that must be returned if object doesn't have left sibling in objects chain.
	ErrNoLeftSibling = errors.New("no left siblings")

	// ErrNoSplitInfo is an error that must be returned if requested object isn't virtual.
	ErrNoSplitInfo = errors.New("no split info")
)

Functions

func ListAllRelations

func ListAllRelations(ctx context.Context, rels Relations, cnrID cid.ID, rootObjID oid.ID, tokens Tokens) ([]oid.ID, error)

ListAllRelations return all related phy objects for provided root object ID. Result doesn't include root object ID itself.

Types

type Relations

type Relations interface {
	// GetSplitInfo tries to get split info by root object id.
	// If object isn't virtual it returns ErrNoSplitInfo.
	GetSplitInfo(ctx context.Context, cnrID cid.ID, rootID oid.ID, tokens Tokens) (*object.SplitInfo, error)

	// ListChildrenByLinker returns list of children for link object.
	// Result doesn't include link object itself.
	ListChildrenByLinker(ctx context.Context, cnrID cid.ID, linkerID oid.ID, tokens Tokens) ([]oid.ID, error)

	// GetLeftSibling return previous object id in object chain.
	// If no previous object it returns ErrNoLeftSibling.
	GetLeftSibling(ctx context.Context, cnrID cid.ID, objID oid.ID, tokens Tokens) (oid.ID, error)

	// FindSiblingBySplitID returns all objects that relates to the provided split id.
	FindSiblingBySplitID(ctx context.Context, cnrID cid.ID, splitID *object.SplitID, tokens Tokens) ([]oid.ID, error)

	// FindSiblingByParentID returns all object that relates to the provided parent id.
	FindSiblingByParentID(ctx context.Context, cnrID cid.ID, parentID oid.ID, tokens Tokens) ([]oid.ID, error)
}

type Tokens

type Tokens struct {
	Session *session.Object
	Bearer  *bearer.Token
}

Tokens contains different tokens to perform requests in Relations implementations.

Jump to

Keyboard shortcuts

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