util

package
v0.0.0-...-322828a Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToHistory

func AddToHistory(url ShareableUrl)

func CloseFileOrExit

func CloseFileOrExit(file *os.File)

func CollectResponseErrors

func CollectResponseErrors(response cloudflare.Response) error

func GenerateFileId

func GenerateFileId() (string, error)

func GenerateUploadToken

func GenerateUploadToken() (string, error)

func NewProgressReaderProvider

func NewProgressReaderProvider(upstreamReader io.Reader, description string, fileSize int64) io.Reader

NewProgressReaderProvider wraps the provided upstreamReader and returns a new reader that tracks the read process through a progress bar that is shown on screen.

func ReadHistory

func ReadHistory() map[string]*ShareableUrl

func WriteHistory

func WriteHistory(urls []*ShareableUrl)

WriteHistory rewrites the history file with the given urls.

Types

type ShareableUrl

type ShareableUrl struct {
	ServiceHost string
	FileId      string
	Key         string
}

func ParseUrl

func ParseUrl(value string) (*ShareableUrl, error)

ParseUrl parses a shareable URL. If the host is missing, a default value will be inserted.

func (ShareableUrl) String

func (s ShareableUrl) String() string

Jump to

Keyboard shortcuts

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