filedrop

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 8 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

View Source
var ImageExtensions = map[string]bool{
	".png": true, ".jpg": true, ".jpeg": true, ".gif": true, ".webp": true,
	".bmp": true, ".tiff": true, ".tif": true, ".svg": true, ".ico": true,
}

Suffixes treated as image attachments

Functions

func ResolveAttachmentPath

func ResolveAttachmentPath(rawPath, base string) string

Regular file a typed path names, a relative one read against base and against the working directory of the process without one, empty when it names none

func SplitPathInput

func SplitPathInput(raw string) (string, string)

Splits a leading quoted or backslash escaped path token from the trailing free form text

Types

type Drop

type Drop struct {
	Path      string
	IsImage   bool
	Remainder string
}

Dragged or pasted file path found at the start of the input with the text after it

func DetectFileDrop

func DetectFileDrop(userInput, base string) *Drop

Detects a dragged or pasted file path at the start of the input, a relative one read against base, nil when the text is not a path

Jump to

Keyboard shortcuts

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