storage

package
v1.10.57 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package storage provides interface for storage areas, e.g. s3 or POSIX file system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	GetFileSize(filePath string) (int64, error)
	NewFileReader(filePath string) (io.ReadCloser, error)
	NewFileWriter(filePath string) (io.WriteCloser, error)
}

Backend defines methods to be implemented by PosixBackend and S3Backend

func NewBackend

func NewBackend(config Conf) (Backend, error)

NewBackend initiates a storage backend

type Conf

type Conf struct {
	Type  string
	S3    S3Conf
	Posix posixConf
}

Conf is a wrapper for the storage config

type S3Conf

type S3Conf struct {
	URL               string
	Port              int
	AccessKey         string
	SecretKey         string
	Bucket            string
	Region            string
	UploadConcurrency int
	Chunksize         int
	Cacert            string
	NonExistRetryTime time.Duration
}

S3Conf stores information about the S3 storage backend

Jump to

Keyboard shortcuts

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