fileshare

package module
v0.0.0-...-7e698ee Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(n int) []byte

func Hex

func Hex(n int) string

Types

type DB

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

func NewDB

func NewDB(workdir string, filename string) (*DB, error)

func (*DB) AddEntry

func (db *DB) AddEntry(ud UploadDescription) error

func (*DB) CheckFileName

func (db *DB) CheckFileName(filename string, folder string)

func (*DB) Close

func (db *DB) Close()

func (*DB) DeleteFile

func (db *DB) DeleteFile(filename string, folder string) error

func (*DB) GetFiles

func (db *DB) GetFiles() []UploadDescription

func (*DB) StartBackgroundPrune

func (db *DB) StartBackgroundPrune(folder string)

type UploadDescription

type UploadDescription struct {
	Name      string
	Extension string
	Size      int64
	Expiry    time.Time
}

func (*UploadDescription) GetFullName

func (ud *UploadDescription) GetFullName() string

func (*UploadDescription) GetHumanExpiry

func (ud *UploadDescription) GetHumanExpiry() string

func (*UploadDescription) GetHumanSize

func (ud *UploadDescription) GetHumanSize() string

func (*UploadDescription) GetJSON

func (ud *UploadDescription) GetJSON() ([]byte, error)

func (*UploadDescription) GetURL

func (ud *UploadDescription) GetURL() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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