appfixture

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: 0BSD Imports: 4 Imported by: 0 modules, 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

Overview

Package appfixture is an ordinary Go package whose own source is bound whole.

Index

Constants

View Source
const (
	MaxStock       = 99
	Greeting       = "hello"
	Kitchen  Shelf = iota + 1
	Garden
)

Variables

View Source
var Default = &Store{Name: "Default"}
View Source
var Source embed.FS

Functions

func Wait

func Wait(wg *sync.WaitGroup)

Types

type Money

type Money int64

func Discount

func Discount(amount Money, percent int) Money

Discount takes named parameters that component calls rely on.

func (Money) String

func (m Money) String() string

type Product

type Product struct {
	Name  string
	Price Money
	Shelf Shelf
	Tags  []string
	// contains filtered or unexported fields
}

func (*Product) Lock

func (p *Product) Lock(wg *sync.WaitGroup)

Lock is exported but takes a type scripts cannot use.

func (*Product) Slug

func (p *Product) Slug() string

func (*Product) Viewed

func (p *Product) Viewed() int

type Shelf

type Shelf int

Shelf is a named scalar with a method.

func (Shelf) Label

func (s Shelf) Label() string

type Standalone

type Standalone struct{ Note string }

Standalone is reachable from no function signature or field.

type Store

type Store struct {
	Name     string
	Products []*Product
	// contains filtered or unexported fields
}

func CurrentStore

func CurrentStore() *Store

func (*Store) Find

func (s *Store) Find(name string) *Product

Jump to

Keyboard shortcuts

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