actions

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package actions provides post-generation output actions: clipboard copy, browser open, and file download.

Index

Constants

This section is empty.

Variables

View Source
var BrowserOpen = browser.OpenURL

BrowserOpen is a function variable for opening URLs (swappable in tests).

View Source
var ClipboardUnsupported = clipboard.Unsupported

ClipboardUnsupported mirrors clipboard.Unsupported (swappable in tests).

View Source
var ClipboardWrite = clipboard.WriteAll

ClipboardWrite is a function variable for clipboard writes (swappable in tests).

View Source
var ErrClipboardUnsupported = errors.New("clipboard not supported on this platform")

ErrClipboardUnsupported indicates the platform has no clipboard support.

View Source
var ErrHTTPStatus = errors.New("unexpected HTTP status")

ErrHTTPStatus indicates the server returned a non-200 status code.

Functions

func AutoFilename

func AutoFilename(rawURL string) string

AutoFilename extracts a filename from a meme URL path. Falls back to "meme.jpg" if parsing fails or path is empty.

func CopyToClipboard

func CopyToClipboard(text string) error

CopyToClipboard copies text to the system clipboard. Returns a descriptive error if clipboard is unsupported on the platform.

func DownloadFile

func DownloadFile(rawURL, destPath string) error

DownloadFile downloads the resource at rawURL and saves it to destPath. Uses plain http.Get since meme URLs are public CDN resources.

func OpenInBrowser

func OpenInBrowser(rawURL string) error

OpenInBrowser opens the given URL in the default browser.

Types

This section is empty.

Jump to

Keyboard shortcuts

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