shipment

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package shipment provides functionality for tracking shipped consignments. A shipment represents a collection of consignments that were shipped together as part of a release, along with the versions they were shipped as.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consignment

type Consignment struct {
	ID       string            `json:"id"`
	Packages map[string]string `json:"packages"` // package name -> change type
	Summary  string            `json:"summary"`
	Created  time.Time         `json:"created"`
}

Consignment represents a consignment stored in shipment history This is a copy of the consignment structure to avoid circular imports

type Shipment

type Shipment struct {
	ID           string                     `json:"id"`
	Date         time.Time                  `json:"date"`
	Versions     map[string]*semver.Version `json:"versions"`     // package name -> shipped version
	Consignments []*Consignment             `json:"consignments"` // consignments included in this shipment
	Template     string                     `json:"template"`     // changelog template used
	Tags         map[string]string          `json:"tags"`         // git tags created for this shipment (package -> tag)
}

Shipment represents a collection of consignments that were shipped together

type ShipmentHistory

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

ShipmentHistory manages the history of shipped consignments

func NewShipmentHistory

func NewShipmentHistory(projectConfig *config.ProjectConfig) *ShipmentHistory

NewShipmentHistory creates a new shipment history manager

func NewShipmentHistoryWithFile

func NewShipmentHistoryWithFile(projectConfig *config.ProjectConfig, filePath string) *ShipmentHistory

NewShipmentHistoryWithFile creates a new shipment history manager with a custom file path

func (*ShipmentHistory) ClearHistory

func (h *ShipmentHistory) ClearHistory() error

ClearHistory removes all shipment history (use with caution)

func (*ShipmentHistory) EnsureHistoryDir

func (h *ShipmentHistory) EnsureHistoryDir() error

EnsureHistoryDir creates the history directory if it doesn't exist

func (*ShipmentHistory) GetAllConsignmentsFromHistory

func (h *ShipmentHistory) GetAllConsignmentsFromHistory() ([]*Consignment, error)

GetAllConsignmentsFromHistory returns all consignments from the shipment history

func (*ShipmentHistory) GetHistoryFile

func (h *ShipmentHistory) GetHistoryFile() string

GetHistoryFile returns the path to the history file

func (*ShipmentHistory) GetLatestShipment

func (h *ShipmentHistory) GetLatestShipment() (*Shipment, error)

GetLatestShipment returns the most recent shipment

func (*ShipmentHistory) GetShipmentByID

func (h *ShipmentHistory) GetShipmentByID(id string) (*Shipment, error)

GetShipmentByID returns a shipment by its ID

func (*ShipmentHistory) GetShipmentsForPackage

func (h *ShipmentHistory) GetShipmentsForPackage(packageName string) ([]*Shipment, error)

GetShipmentsForPackage returns all shipments that included changes for a specific package

func (*ShipmentHistory) GetVersionHistory

func (h *ShipmentHistory) GetVersionHistory() (map[string][]*semver.Version, error)

GetVersionHistory returns a map of package names to their version history

func (*ShipmentHistory) LoadHistory

func (h *ShipmentHistory) LoadHistory() ([]*Shipment, error)

LoadHistory loads the shipment history from the JSON file

func (*ShipmentHistory) RecordShipment

func (h *ShipmentHistory) RecordShipment(consignments []*Consignment, versions map[string]*semver.Version, template string) (*Shipment, error)

RecordShipment records a new shipment in the history

func (*ShipmentHistory) RecordShipmentWithTags

func (h *ShipmentHistory) RecordShipmentWithTags(consignments []*Consignment, versions map[string]*semver.Version, template string, gitTags map[string]string) (*Shipment, error)

RecordShipmentWithTags records a new shipment in the history with provided git tags

func (*ShipmentHistory) SaveHistory

func (h *ShipmentHistory) SaveHistory(history []*Shipment) error

SaveHistory saves the shipment history to the JSON file

Jump to

Keyboard shortcuts

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