manager

package
v0.0.0-...-96b211d Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreate

func NewCreate(
	reservationMap *common.ReservationMap,
	dataNodeProviderHandler func(address string) (cluster2.DataNode, error),
	findClusterHandler func(sha512Hex string) (string, string, error),
	logger *zap.Logger,
) *create

Types

type Cluster

type Cluster interface {
	Create(size uint64, reader io.Reader) (*common.CreationResult, error)
	CreateShadow(chunks common.DataChunks) error
	Read(chunks common.DataChunks) (func(w io.Writer, begins int64, ends int64) error, error)
	Delete(chunks common.DataChunks) (*common.DeletionResult, error)
}

func NewCluster

func NewCluster(managerAddresses []string, logger *zap.Logger) (Cluster, error)

type Dfs

type Dfs interface {
	CreateFolder(folderPath string) error
	CreateFile(path string, mime string, size uint64, overwrite bool, contentReader io.Reader) error

	Read(paths []string, join bool) (ReadContainer, error)
	Size(folderPath string) (uint64, error)

	Change(sources []string, target string, join bool, overwrite bool, move bool) error

	Delete(path string, killZombies bool) error

	// ExecuteActions executes the hook actions in sync manner
	ExecuteActions(aI *hooks.ActionInfo, actions []hooks.Action)
}

Dfs interface is for file manipulation operations base on REST service request

func NewDfs

func NewDfs(metadata data.Metadata, cluster Cluster, logger *zap.Logger) Dfs

NewDfs creates the instance of file manipulation operations object for REST service request

type Hook

type Hook interface {
	GetAvailableList() []interface{}

	Add(folderPaths []string, hook *hooks.Hook) error
	Delete(folderPath string, hookIds []string) error
}

Hook interface is for hook manipulation operations base on REST service request

func NewHook

func NewHook(metadata data.Metadata, logger *zap.Logger) Hook

NewHook creates the instance of hook manipulation operations object for REST service request

type ReadContainer

type ReadContainer interface {
	Type() ReadType

	Folder() *common.Folder
	Tree() (*common.Tree, error)
	File() *common.File

	Read(w io.Writer, begins int64, ends int64) error
}

type ReadType

type ReadType int
const (
	RTFolder ReadType = 1
	RTFile   ReadType = 2
)

Jump to

Keyboard shortcuts

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