gohierarchyclient

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClientID

func WithClientID(clientID string) rest.Option

func WithStage

func WithStage(stage string) rest.Option

Types

type HierarchyClient

type HierarchyClient interface {
	GetNode(ctx context.Context, id uuid.UUID) (models.Node, error)
	CreateNode(ctx context.Context, node models.CreateNodeRequest) (models.Node, error)
	UpdateNode(ctx context.Context, id uuid.UUID, node models.UpdateNodeRequest) (models.Node, error)
	DeleteNode(ctx context.Context, id uuid.UUID) error
	DuplicateNode(ctx context.Context, source uuid.UUID, destination uuid.UUID, suffix string) (uuid.UUID, error)

	GetAncestors(ctx context.Context, id uuid.UUID, height int, nodeTypes ...string) ([]models.Node, error)
	GetAncestorsIncludeSelf(ctx context.Context, id uuid.UUID, height int, nodeTypes ...string) ([]models.Node, error)
	GetCompany(ctx context.Context, id uuid.UUID) (models.Node, error)
	GetSubtree(ctx context.Context, id uuid.UUID, filter TreeFilter) ([]models.Node, error)
	GetSubtreeCount(ctx context.Context, id uuid.UUID, nodeTypes ...string) (int64, error)
	GetSubtreePage(ctx context.Context, id uuid.UUID, filter TreeFilter, continuationToken string) (models.GetSubtreeResponse, error)

	LockNode(ctx context.Context, id uuid.UUID, recursive bool) error
	UnlockNode(ctx context.Context, id uuid.UUID, recursive bool) error

	GetOrigins(ctx context.Context, provider string) ([]models.Origin, error)
	GetOriginsByType(ctx context.Context, provider, originType string) ([]models.Origin, error)
	GetProviderNodeIDs(ctx context.Context, provider string) ([]uuid.UUID, error)
	GetProviderNodeIDsByType(ctx context.Context, provider, originType string) ([]uuid.UUID, error)
	GetOriginNodeID(ctx context.Context, origin models.Origin) (uuid.UUID, error)
}

func NewClient

func NewClient(opts ...rest.Option) HierarchyClient

type TreeFilter

type TreeFilter struct {
	Depth         int
	Limit         int
	Offset        int
	MetadataKey   string
	MetadataValue string
	NodeTypes     []string
	ModifiedAfter string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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