storage

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileApi

type FileApi struct {
}

func (*FileApi) Exist added in v1.7.4

func (f *FileApi) Exist(path string) (bool, error)

func (*FileApi) ExistLog added in v1.7.3

func (f *FileApi) ExistLog(fileId string) (bool, error)

func (*FileApi) Get added in v1.7.4

func (f *FileApi) Get(path string) (io.ReadCloser, int64, error)

func (*FileApi) GetLog

func (f *FileApi) GetLog(fileId string) (*LogFile, error)

func (*FileApi) RemoveLog

func (f *FileApi) RemoveLog(fileId string) error

func (*FileApi) Save added in v1.9.0

func (f *FileApi) Save(path string, stream io.ReadSeeker) error

func (*FileApi) SaveLog

func (f *FileApi) SaveLog(log *LogFile) error

type LogFile

type LogFile struct {
	Name       string        `json:"name"`
	FileId     string        `json:"fileId"`
	Size       int64         `json:"size"`
	Tags       []*Tag        `json:"tags"`
	UpdateFile []byte        `json:"-"`
	FileSteam  io.ReadCloser `json:"-"`
}

type LogGroupFile

type LogGroupFile struct {
	LogFile
	GroupId string `json:"groupId"`
}

type RemoteApi

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

func (*RemoteApi) Exist

func (a *RemoteApi) Exist(path string) (bool, error)

func (*RemoteApi) ExistLog added in v1.7.3

func (a *RemoteApi) ExistLog(fileId string) (bool, error)

func (*RemoteApi) Get

func (a *RemoteApi) Get(path string) (io.ReadCloser, int64, error)

func (*RemoteApi) GetLog

func (a *RemoteApi) GetLog(fileId string) (*LogFile, error)

func (*RemoteApi) RemoveLog

func (a *RemoteApi) RemoveLog(fileId string) error

func (*RemoteApi) Save

func (a *RemoteApi) Save(path string, data io.ReadSeeker) error

func (*RemoteApi) SaveLog

func (a *RemoteApi) SaveLog(log *LogFile) error

type StorageApi

type StorageApi interface {
	SaveLog(log *LogFile) error
	GetLog(fileId string) (*LogFile, error)
	ExistLog(fileId string) (bool, error)
	RemoveLog(fileId string) error

	Save(path string, data io.ReadSeeker) error
	Exist(path string) (bool, error)
	Get(path string) (io.ReadCloser, int64, error)
}

func NewFileApi

func NewFileApi() (StorageApi, error)

func NewS3Api

func NewS3Api(config *config.StorageConfig) (StorageApi, error)

func NewStorage

func NewStorage(config *config.Config) (StorageApi, error)

type Tag

type Tag struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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