skypack

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowseResponse

type BrowseResponse struct {
	Files []FileInfo `json:"files"`
}

BrowseResponse represents the response structure from /v1/browse/{name}/{version}.

type Client

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

Client holds configuration for Skypack requests.

func New

func New() *Client

New creates a new Skypack client.

func (*Client) FetchPackageFiles

func (c *Client) FetchPackageFiles(ctx context.Context, name, version string) (library.Files, string, error)

FetchPackageFiles retrieves package metadata and file list from Skypack. It first calls the package endpoint to determine the package version (if not explicitly provided) and then calls the browse endpoint to retrieve the list of files.

type FileInfo

type FileInfo struct {
	Name   string  `json:"name"`
	SizeKB float64 `json:"sizeKB"`
	URL    string  `json:"url"`
}

FileInfo represents individual file information in the browse response.

type PackageResponse

type PackageResponse struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

PackageResponse represents the response structure from /v1/package/{name}.

Jump to

Keyboard shortcuts

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