storage

package
v1.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDiskStorage = &Disk{}

Functions

This section is empty.

Types

type Disk

type Disk struct {
}

func (*Disk) GetProfileDir

func (d *Disk) GetProfileDir(workspaceUUID string, profileID string, unixTimeNS int64) string

func (*Disk) GetProfileDirOld

func (d *Disk) GetProfileDirOld(workspaceUUID string, profileID string, unixTimeNS int64) string

func (*Disk) GetProfilePath

func (d *Disk) GetProfilePath(workspaceUUID string, profileID string, unixTimeNS int64, ossFilename string) string

func (*Disk) GetProfilePathOld

func (d *Disk) GetProfilePathOld(workspaceUUID string, profileID string, unixTimeNS int64, ossFilename string) string

func (*Disk) IsFileExists

func (d *Disk) IsFileExists(path string) (bool, error)

func (*Disk) ReadFile

func (d *Disk) ReadFile(path string) (io.ReadCloser, error)

type OSS

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

func InitOSS

func InitOSS() (*OSS, error)

func (*OSS) GetProfileDir

func (o *OSS) GetProfileDir(workspaceUUID string, profileID string, unixTimeNS int64) string

func (*OSS) GetProfilePath

func (o *OSS) GetProfilePath(workspaceUUID string, profileID string, unixTimeNS int64, ossFilename string) string

func (*OSS) GetProfilePathOld

func (o *OSS) GetProfilePathOld(workspaceUUID string, profileID string, unixTimeNS int64, ossFilename string) string

func (*OSS) IsFileExists

func (o *OSS) IsFileExists(path string) (bool, error)

func (*OSS) ReadFile

func (o *OSS) ReadFile(path string) (io.ReadCloser, error)

type Storage

type Storage interface {
	IsFileExists(path string) (bool, error)
	GetProfilePath(workspaceUUID string, profileID string, unixTimeNS int64, ossFilename string) string
	GetProfileDir(workspaceUUID string, profileID string, unixTimeNS int64) string
	GetProfilePathOld(workspaceUUID string, profileID string, unixTimeNS int64, ossFilename string) string
	ReadFile(path string) (io.ReadCloser, error)
}

func GetStorage

func GetStorage(typ Type) (Storage, error)

type Type

type Type string
const (
	AliOSS    Type = "oss"
	LocalDisk Type = "disk"
)

Jump to

Keyboard shortcuts

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