tree

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileNameKey = "FileName"
)

Variables

View Source
var (
	// ErrNodeNotFound is returned from ServiceClient in case of not found error.
	ErrNodeNotFound = layer.ErrNodeNotFound

	// ErrNodeAccessDenied is returned from ServiceClient service in case of access denied error.
	ErrNodeAccessDenied = layer.ErrNodeAccessDenied
)

Functions

This section is empty.

Types

type GetNodesParams

type GetNodesParams struct {
	CnrID      cid.ID
	TreeID     string
	Path       []string
	Meta       []string
	LatestOnly bool
	AllAttrs   bool
}

type Meta

type Meta interface {
	GetKey() string
	GetValue() []byte
}

type NodeResponse

type NodeResponse interface {
	GetMeta() []Meta
	GetTimestamp() uint64
}

type ServiceClient

type ServiceClient interface {
	GetNodes(ctx context.Context, p *GetNodesParams) ([]NodeResponse, error)
}

ServiceClient is a client to interact with tree service. Each method must return ErrNodeNotFound or ErrNodeAccessDenied if relevant.

type Tree

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

func NewTree

func NewTree(service ServiceClient) *Tree

NewTree creates instance of Tree using provided address and create grpc connection.

func (*Tree) GetLatestVersion

func (c *Tree) GetLatestVersion(ctx context.Context, cnrID *cid.ID, objectName string) (*api.NodeVersion, error)

Jump to

Keyboard shortcuts

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