Help us shape the future of Go! Take the 2026 Go Developer Survey

snippet

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package snippet turns a previewed request (engine.PreviewRequest) into a command that sends it: cURL, wget, PowerShell Invoke-RestMethod or xh/HTTPie. The functions are pure; the caller decides which values the preview holds (secrets masked or not). Unresolved {{names}} are text and pass through untouched.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(f Format, r engine.PreviewRequest) (string, error)

Generate renders r as format f.

func Label

func Label(f Format) string

Label is a format's display name.

Types

type Format

type Format string

Format is a snippet language.

const (
	Curl       Format = "curl"
	Wget       Format = "wget"
	PowerShell Format = "powershell"
	Xh         Format = "xh"
)

Formats.

func Formats

func Formats() []Format

Formats lists every format, in display order.

Jump to

Keyboard shortcuts

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