service

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyItems = errors.New("empty items")

ErrEmptyItems is returned when items is zero or empty.

Functions

func NewRouter

func NewRouter(p Packer) *http.ServeMux

Types

type Pack

type Pack struct {
	Box      uint `json:"box" format:"uint" example:"50"`
	Quantity uint `json:"quantity" format:"uint" example:"3"`
}

Pack represents a pack of items.

type PackRequest

type PackRequest struct {
	Items uint `json:"items" format:"uint" example:"543"`
}

PackRequest represents a request to pack items.

type PackResponse

type PackResponse struct {
	Packs []Pack `json:"packs,omitempty"`
}

PackResponse represents a response to a pack request.

type Packer added in v1.1.10

type Packer interface {
	PackOrder(ctx context.Context, items uint) map[uint]uint
}

Directories

Path Synopsis
Package assets handles generated static.
Package assets handles generated static.

Jump to

Keyboard shortcuts

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