tree

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: AGPL-3.0 Imports: 14 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

	// ErrGatewayTimeout is returned from ServiceClient service in case of timeout error.
	ErrGatewayTimeout = layer.ErrGatewayTimeout
)

Functions

This section is empty.

Types

type GetNodesParams

type GetNodesParams struct {
	BktInfo    *data.BucketInfo
	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
	GetNodeID() uint64
	GetParentID() uint64
	GetTimestamp() uint64
}

type ServiceClient

type ServiceClient interface {
	GetNodes(ctx context.Context, p *GetNodesParams) ([]NodeResponse, error)
	GetSubTree(ctx context.Context, bktInfo *data.BucketInfo, treeID string, rootID uint64, depth uint32) ([]NodeResponse, error)
	AddNode(ctx context.Context, bktInfo *data.BucketInfo, treeID string, parent uint64, meta map[string]string) (uint64, error)
	AddNodeByPath(ctx context.Context, bktInfo *data.BucketInfo, treeID string, path []string, meta map[string]string) (uint64, error)
	MoveNode(ctx context.Context, bktInfo *data.BucketInfo, treeID string, nodeID, parentID uint64, meta map[string]string) error
	RemoveNode(ctx context.Context, bktInfo *data.BucketInfo, treeID string, nodeID uint64) error
}

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

type ServiceClientMemory

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

func NewTreeServiceClientMemory

func NewTreeServiceClientMemory() (*ServiceClientMemory, error)

func (*ServiceClientMemory) AddNode

func (c *ServiceClientMemory) AddNode(_ context.Context, bktInfo *data.BucketInfo, treeID string, parent uint64, meta map[string]string) (uint64, error)

func (*ServiceClientMemory) AddNodeByPath

func (c *ServiceClientMemory) AddNodeByPath(_ context.Context, bktInfo *data.BucketInfo, treeID string, path []string, meta map[string]string) (uint64, error)

func (*ServiceClientMemory) GetNodes

func (*ServiceClientMemory) GetSubTree

func (c *ServiceClientMemory) GetSubTree(_ context.Context, bktInfo *data.BucketInfo, treeID string, rootID uint64, depth uint32) ([]NodeResponse, error)

func (*ServiceClientMemory) MoveNode

func (c *ServiceClientMemory) MoveNode(_ context.Context, bktInfo *data.BucketInfo, treeID string, nodeID, parentID uint64, meta map[string]string) error

func (*ServiceClientMemory) RemoveNode

func (c *ServiceClientMemory) RemoveNode(_ context.Context, bktInfo *data.BucketInfo, treeID string, nodeID uint64) error

type Tree

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

func NewTree

func NewTree(service ServiceClient, log *zap.Logger) *Tree

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

func (*Tree) AddPart

func (c *Tree) AddPart(ctx context.Context, bktInfo *data.BucketInfo, multipartNodeID uint64, info *data.PartInfo) (oldObjIDToDelete oid.ID, err error)

func (*Tree) AddVersion

func (c *Tree) AddVersion(ctx context.Context, bktInfo *data.BucketInfo, version *data.NodeVersion) (uint64, error)

func (*Tree) CreateMultipartUpload

func (c *Tree) CreateMultipartUpload(ctx context.Context, bktInfo *data.BucketInfo, info *data.MultipartInfo) error

func (*Tree) DeleteBucketCORS

func (c *Tree) DeleteBucketCORS(ctx context.Context, bktInfo *data.BucketInfo) (oid.ID, error)

func (*Tree) DeleteBucketTagging

func (c *Tree) DeleteBucketTagging(ctx context.Context, bktInfo *data.BucketInfo) error

func (*Tree) DeleteMultipartUpload

func (c *Tree) DeleteMultipartUpload(ctx context.Context, bktInfo *data.BucketInfo, multipartNodeID uint64) error

func (*Tree) DeleteObjectTagging

func (c *Tree) DeleteObjectTagging(ctx context.Context, bktInfo *data.BucketInfo, objVersion *data.NodeVersion) error

func (*Tree) GetAllVersionsByPrefix

func (c *Tree) GetAllVersionsByPrefix(ctx context.Context, bktInfo *data.BucketInfo, prefix string) ([]*data.NodeVersion, error)

func (*Tree) GetBucketCORS

func (c *Tree) GetBucketCORS(ctx context.Context, bktInfo *data.BucketInfo) (oid.ID, error)

func (*Tree) GetBucketTagging

func (c *Tree) GetBucketTagging(ctx context.Context, bktInfo *data.BucketInfo) (map[string]string, error)

func (*Tree) GetLatestVersion

func (c *Tree) GetLatestVersion(ctx context.Context, bktInfo *data.BucketInfo, objectName string) (*data.NodeVersion, error)

func (*Tree) GetLatestVersionsByPrefix

func (c *Tree) GetLatestVersionsByPrefix(ctx context.Context, bktInfo *data.BucketInfo, prefix string) ([]*data.NodeVersion, error)

func (*Tree) GetLock

func (c *Tree) GetLock(ctx context.Context, bktInfo *data.BucketInfo, nodeID uint64) (*data.LockInfo, error)

func (*Tree) GetMultipartUpload

func (c *Tree) GetMultipartUpload(ctx context.Context, bktInfo *data.BucketInfo, objectName, uploadID string) (*data.MultipartInfo, error)

func (*Tree) GetMultipartUploadsByPrefix

func (c *Tree) GetMultipartUploadsByPrefix(ctx context.Context, bktInfo *data.BucketInfo, prefix string) ([]*data.MultipartInfo, error)

func (*Tree) GetNotificationConfigurationNode

func (c *Tree) GetNotificationConfigurationNode(ctx context.Context, bktInfo *data.BucketInfo) (oid.ID, error)

func (*Tree) GetObjectTagging

func (c *Tree) GetObjectTagging(ctx context.Context, bktInfo *data.BucketInfo, objVersion *data.NodeVersion) (map[string]string, error)

func (*Tree) GetObjectTaggingAndLock

func (c *Tree) GetObjectTaggingAndLock(ctx context.Context, bktInfo *data.BucketInfo, objVersion *data.NodeVersion) (map[string]string, *data.LockInfo, error)

func (*Tree) GetParts

func (c *Tree) GetParts(ctx context.Context, bktInfo *data.BucketInfo, multipartNodeID uint64) ([]*data.PartInfo, error)

func (*Tree) GetSettingsNode

func (c *Tree) GetSettingsNode(ctx context.Context, bktInfo *data.BucketInfo) (*data.BucketSettings, error)

func (*Tree) GetUnversioned

func (c *Tree) GetUnversioned(ctx context.Context, bktInfo *data.BucketInfo, filepath string) (*data.NodeVersion, error)

func (*Tree) GetVersions

func (c *Tree) GetVersions(ctx context.Context, bktInfo *data.BucketInfo, filepath string) ([]*data.NodeVersion, error)

func (*Tree) PutBucketCORS

func (c *Tree) PutBucketCORS(ctx context.Context, bktInfo *data.BucketInfo, objID oid.ID) (oid.ID, error)

func (*Tree) PutBucketTagging

func (c *Tree) PutBucketTagging(ctx context.Context, bktInfo *data.BucketInfo, tagSet map[string]string) error

func (*Tree) PutLock

func (c *Tree) PutLock(ctx context.Context, bktInfo *data.BucketInfo, nodeID uint64, lock *data.LockInfo) error

func (*Tree) PutNotificationConfigurationNode

func (c *Tree) PutNotificationConfigurationNode(ctx context.Context, bktInfo *data.BucketInfo, objID oid.ID) (oid.ID, error)

func (*Tree) PutObjectTagging

func (c *Tree) PutObjectTagging(ctx context.Context, bktInfo *data.BucketInfo, objVersion *data.NodeVersion, tagSet map[string]string) error

func (*Tree) PutSettingsNode

func (c *Tree) PutSettingsNode(ctx context.Context, bktInfo *data.BucketInfo, settings *data.BucketSettings) error

func (*Tree) RemoveVersion

func (c *Tree) RemoveVersion(ctx context.Context, bktInfo *data.BucketInfo, id uint64) error

Jump to

Keyboard shortcuts

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