domain

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InventoryAlreadyCreated

func InventoryAlreadyCreated() errors.BusinessError

func NewInventoryCreatedDomainEvent

func NewInventoryCreatedDomainEvent(
	inventoryID InventoryID,
) base.DomainEvent

func NewInventoryFlavorUpdatedDomainEvent

func NewInventoryFlavorUpdatedDomainEvent(
	inventoryID InventoryID,
) base.DomainEvent

Types

type Inventory

type Inventory struct {
	base.DomainEntity

	ID           InventoryID
	UUID         string
	Namespace    string
	ProductSKU   string
	SerialNumber string
	Sizes        map[string]string
	NICs         []metalv1alpha4.NICSpec
}

func CreateInventory

func CreateInventory(
	inventoryIDGenerator InventoryIDGenerator,
	inventoryAlreadyExist InventoryAlreadyExist,
	UUID string,
	namespace string,
) (Inventory, errors.BusinessError)

func NewInventory

func NewInventory(
	ID InventoryID,
	UUID string,
	namespace string,
	productSKU string,
	serialNumber string,
	sizes map[string]string,
	NICs []metalv1alpha4.NICSpec,
) Inventory

func (*Inventory) IsMachine

func (i *Inventory) IsMachine() bool

type InventoryAlreadyExist

type InventoryAlreadyExist interface {
	Invoke(inventoryUUID string) bool
}

type InventoryCreatedDomainEvent

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

func (*InventoryCreatedDomainEvent) ID

func (*InventoryCreatedDomainEvent) Type

type InventoryFlavorUpdatedDomainEvent

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

func (*InventoryFlavorUpdatedDomainEvent) ID

func (*InventoryFlavorUpdatedDomainEvent) Type

type InventoryID

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

func NewInventoryID

func NewInventoryID(id string) InventoryID

func (*InventoryID) String

func (m *InventoryID) String() string

type InventoryIDGenerator

type InventoryIDGenerator interface {
	Generate() InventoryID
}

Jump to

Keyboard shortcuts

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