source

package
v0.6.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetS3

func GetS3(client *s3.S3, bucket string, path string) (*utils.StreamHijacker, bool)

Types

type IndexFunc

type IndexFunc = func(absolutePath string, cleanedPath string) int64

type Local

type Local struct {
}

func (Local) Get

func (l Local) Get(path string, host []byte) (*utils.StreamHijacker, bool)

func (Local) IndexPath

func (l Local) IndexPath(dir string, f IndexFunc) (int64, int64, error)

func (Local) Watch

func (l Local) Watch() (<-chan WatchEvent, error)

type S3

type S3 struct {
	S3Client *s3.S3
	Bucket   string
}

func NewS3

func NewS3(bucket string, key string, secret string, endpoint string, region string) (*S3, error)

func (S3) Get

func (s S3) Get(path string, _ []byte) (*utils.StreamHijacker, bool)

func (S3) IndexPath

func (s S3) IndexPath(dirPath string, f IndexFunc) (int64, int64, error)

func (S3) Watch

func (s S3) Watch() (<-chan WatchEvent, error)

type S3Redis

type S3Redis struct {
	RedisClient     *redis.Client
	CredentialCache *cache.Cache
}

func NewS3Redis

func NewS3Redis(network string, address string, username string, password string, db int) (*S3Redis, error)

func (S3Redis) Get

func (s S3Redis) Get(path string, host []byte) (*utils.StreamHijacker, bool)

func (S3Redis) IndexPath

func (s S3Redis) IndexPath(_ string, _ IndexFunc) (int64, int64, error)

func (S3Redis) Watch

func (s S3Redis) Watch() (<-chan WatchEvent, error)

type S3Wrapper

type S3Wrapper struct {
	S3
	Filter *cuckoo.Filter
}

type Source

type Source interface {
	Get(path string, host []byte) (*utils.StreamHijacker, bool)
	IndexPath(dir string, f IndexFunc) (int64, int64, error)
	Watch() (<-chan WatchEvent, error)
}

type WatchEvent

type WatchEvent struct {
	CleanPath string
	AbsPath   string
	Op        WatchOp
}

type WatchOp

type WatchOp int
const (
	WatchCreate WatchOp = iota
	WatchModify
	WatchDelete
	WatchRename
)

Jump to

Keyboard shortcuts

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