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

bundle

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package bundle sells two or more of the project's deliverables together, such as a deck with its handouts or a book with its workbook: one name, one listing, one download page or shop listing with every file of each.

Index

Constants

View Source
const (
	Dir         = "deliverables/bundle"
	ListingFile = Dir + "/listing.md"
)

The bundle's files under deliverables/.

View Source
const (
	RuleConfig   = "bundle.config"
	RuleDelivery = "bundle.delivery"
	RuleListing  = "bundle.listing"
	RuleChannels = "bundle.channels"
)

Rule IDs.

Variables

View Source
var Kinds = []string{"book", "printable", "spreadsheet", "document", "deck"}

Kinds are the deliverables a bundle can hold, in the order it lists them.

Functions

func Distribution

func Distribution(r Report, files []deliver.File, data map[string][]byte, groups map[string][]string, images []Image, facts []string, pending bool, day string) (map[string][]byte, []string, []diagnostic.Diagnostic)

Distribution assembles the bundle's shop packages from the files of every unit: groups names the ZIPs Etsy gets when the files are more than five; facts describe what each deliverable holds.

func DownloadPage

func DownloadPage(r Report, accent string, files []deliver.File) []byte

DownloadPage renders the bundle's unlisted download page with every file of every unit, or a note while they are not all built.

func HeroDoc

func HeroDoc(covers []Cover, accent string) []byte

HeroDoc is the bundle's first listing image: every unit's cover side by side, 3000×2250 pixels at twice the density.

func Rules

func Rules() []diagnostic.RuleInfo

Rules describes every bundle rule for the catalog.

Types

type Config

type Config struct {
	Name, Path, Offer, Sell, Language string
	Units                             []string // the deliverables it holds; every one when empty
}

Config is deliverables.bundle in lfm.json.

type Cover

type Cover struct {
	Name  string
	Ratio float64 // width / height
}

Cover is one unit's picture in the bundle's first listing image: a book cover, a printable's first page, another deliverable's first listing image, by the name the hero loads it as.

type Image

type Image = deliver.Image

Image is one listing image of the bundle.

type Report

type Report struct {
	Config      Config
	Summary     Summary
	Diagnostics []diagnostic.Diagnostic
	Listing     deliver.ShopListing
}

Report is the checked bundle.

func Check

func Check(p project.Project, cfg Config, configured bool, units map[string]Unit, offers map[string]*deliver.Price, site string) Report

Check reads the bundle: configured tells whether lfm.json has deliverables.bundle; units are the project's deliverables by kind.

func (Report) Holds

func (r Report) Holds(kind string) bool

Holds reports whether the bundle holds the deliverable of kind.

type Summary

type Summary struct {
	Name     string   `json:"name,omitempty"`
	Units    []string `json:"units,omitempty"`
	Sell     string   `json:"sell"`
	URL      string   `json:"url,omitempty"`
	Files    []string `json:"files,omitempty"`
	Ready    bool     `json:"ready"` // every unit has its files
	Listing  bool     `json:"listing"`
	Channels []string `json:"channels,omitempty"`
	Images   int      `json:"images"`
	Pending  bool     `json:"pending"`
}

Summary is what the report and --json show about the bundle.

type Unit

type Unit struct {
	Present bool
	Sell    string
}

Unit is one deliverable of the project: whether it is there and how it sells.

Jump to

Keyboard shortcuts

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