local

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	types.CreateModel
	UploadID string `json:"upload_id"`
	Index    int    `json:"index"`
	Sha      string `json:"sha"`
	Data     string `json:"data"`
	Size     int    `json:"size"`
}

func (*Chunk) Add

func (c *Chunk) Add(db *gorm.DB) error

func (*Chunk) Copy

func (c *Chunk) Copy(db *gorm.DB, uploadId string, index int) error

func (*Chunk) Delete

func (c *Chunk) Delete(db *gorm.DB, uploadId string) error

func (*Chunk) OneBySha

func (c *Chunk) OneBySha(db *gorm.DB, sha string) error

func (*Chunk) Parts

func (c *Chunk) Parts(db *gorm.DB, uploadId string) ([]*Chunk, error)

type Local

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

func New

func New(conf *config.Config) (*Local, error)

func (*Local) Delete

func (s *Local) Delete(key string) error

func (*Local) Exists

func (s *Local) Exists(key string) (bool, error)

func (*Local) GenTemporaryURL

func (s *Local) GenTemporaryURL(key string) (string, error)

func (*Local) Get

func (s *Local) Get(key string) (io.ReadCloser, error)

func (*Local) NewPutChunk

func (s *Local) NewPutChunk(key string) (types.PutChunk, error)

func (*Local) NewPutChunkByUploadID

func (s *Local) NewPutChunkByUploadID(key, id string) (types.PutChunk, error)

func (*Local) Put

func (s *Local) Put(key string, r io.Reader) error

func (*Local) PutBytes

func (s *Local) PutBytes(key string, in []byte) error

func (*Local) PutFromLocal

func (s *Local) PutFromLocal(key string, LocalPath string) error

func (*Local) Size

func (s *Local) Size(key string) (int64, error)

func (*Local) VerifyTemporaryURL

func (s *Local) VerifyTemporaryURL(key string, expire string, sign string) error

Jump to

Keyboard shortcuts

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