remote_storage

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

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyncKeyPrefix = "remote.sync."
)

Variables

View Source
var (
	RemoteStorageClientMakers = make(map[string]RemoteStorageClientMaker)
)

Functions

func FormatLocation

func FormatLocation(loc *remote_pb.RemoteStorageLocation) string

func GetAllRemoteStorageNames

func GetAllRemoteStorageNames() string

func GetRemoteStorageNamesHasBucket

func GetRemoteStorageNamesHasBucket() string

func GetSyncOffset

func GetSyncOffset(grpcDialOption grpc.DialOption, filer pb.ServerAddress, dir string) (lastOffsetTsNs int64, readErr error)

func ParseLocationName

func ParseLocationName(remote string) (locationName string)

func ParseRemoteLocation

func ParseRemoteLocation(remoteConfType string, remote string) (remoteStorageLocation *remote_pb.RemoteStorageLocation, err error)

func SetSyncOffset

func SetSyncOffset(grpcDialOption grpc.DialOption, filer pb.ServerAddress, dir string, offsetTsNs int64) error

func TraverseBfs

func TraverseBfs(listDirFn ListDirectoryFunc, parentPath util.FullPath, visitFn VisitFunc) (err error)

Types

type Bucket

type Bucket struct {
	Name      string
	CreatedAt time.Time
}

type CachedRemoteStorageClient

type CachedRemoteStorageClient struct {
	*remote_pb.RemoteConf
	RemoteStorageClient
}

type ListDirectoryFunc

type ListDirectoryFunc func(parentDir util.FullPath, visitFn VisitFunc) error

type RemoteStorageClient

type RemoteStorageClient interface {
	Traverse(loc *remote_pb.RemoteStorageLocation, visitFn VisitFunc) error
	ReadFile(loc *remote_pb.RemoteStorageLocation, offset int64, size int64) (data []byte, err error)
	WriteDirectory(loc *remote_pb.RemoteStorageLocation, entry *filer_pb.Entry) (err error)
	RemoveDirectory(loc *remote_pb.RemoteStorageLocation) (err error)
	WriteFile(loc *remote_pb.RemoteStorageLocation, entry *filer_pb.Entry, reader io.Reader) (remoteEntry *filer_pb.RemoteEntry, err error)
	UpdateFileMetadata(loc *remote_pb.RemoteStorageLocation, oldEntry *filer_pb.Entry, newEntry *filer_pb.Entry) (err error)
	DeleteFile(loc *remote_pb.RemoteStorageLocation) (err error)
	ListBuckets() ([]*Bucket, error)
	CreateBucket(name string) (err error)
	DeleteBucket(name string) (err error)
}

func GetRemoteStorage

func GetRemoteStorage(remoteConf *remote_pb.RemoteConf) (RemoteStorageClient, error)

type RemoteStorageClientMaker

type RemoteStorageClientMaker interface {
	Make(remoteConf *remote_pb.RemoteConf) (RemoteStorageClient, error)
	HasBucket() bool
}

type VisitFunc

type VisitFunc func(dir string, name string, isDirectory bool, remoteEntry *filer_pb.RemoteEntry) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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