storage

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 11 Imported by: 0

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) GetLog

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

func (*FileApi) RemoveLog

func (f *FileApi) RemoveLog(fileId string) 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) 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)
	RemoveLog(fileId string) 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