Documentation
¶
Index ¶
- Variables
- type Asset
- type AssetModel
- func (m *AssetModel) Create(ctx context.Context, asset NewAsset) (Asset, error)
- func (m *AssetModel) DeleteByID(ctx context.Context, id int64) error
- func (m *AssetModel) GetByID(ctx context.Context, id int64) (Asset, error)
- func (m *AssetModel) List(ctx context.Context) ([]Asset, error)
- func (m *AssetModel) ListByModel(ctx context.Context, modelID int64) ([]Asset, error)
- func (m *AssetModel) UpdateByID(ctx context.Context, id int64, asset NewAsset) (Asset, error)
- type Model
- type ModelModel
- func (m *ModelModel) Create(ctx context.Context, model NewModel) (Model, error)
- func (m *ModelModel) DeleteByID(ctx context.Context, id int64) error
- func (m *ModelModel) GetByID(ctx context.Context, id int64) (Model, error)
- func (m *ModelModel) ListByVendorID(ctx context.Context, vendorID int64) ([]Model, error)
- func (m *ModelModel) ListModels(ctx context.Context) ([]Model, error)
- func (m *ModelModel) UpdateByID(ctx context.Context, id int64, model NewModel) (Model, error)
- type NewAsset
- type NewModel
- type NewVendor
- type Vendor
- type VendorModel
- func (m *VendorModel) Create(ctx context.Context, vendor NewVendor) (Vendor, error)
- func (m *VendorModel) DeleteByID(ctx context.Context, id int64) error
- func (m *VendorModel) GetByID(ctx context.Context, id int64) (Vendor, error)
- func (m *VendorModel) ListVendors(ctx context.Context) ([]Vendor, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAssetNotFound = fmt.Errorf("asset not found: %w", ErrNotFound)
View Source
var ErrAssetSerialNotUnique = errors.New("serial not unique within model")
View Source
var ErrModelHasAssets = errors.New("model contains assets")
View Source
var ErrModelNotFound = fmt.Errorf("model not found: %w", ErrNotFound)
View Source
var ErrModelNotUnique = errors.New("model not unique within vendor")
View Source
var ErrNotFound = errors.New("not found")
ErrNotFound indicates the resource being queried for does not exist.
View Source
var ErrVendorHasModels = errors.New("vendor with models cannot be deleted")
View Source
var ErrVendorNotFound = fmt.Errorf("vendor not found: %w", ErrNotFound)
Functions ¶
This section is empty.
Types ¶
type AssetModel ¶
type AssetModel struct {
// contains filtered or unexported fields
}
func NewAssetModel ¶
func (*AssetModel) DeleteByID ¶
func (m *AssetModel) DeleteByID(ctx context.Context, id int64) error
func (*AssetModel) ListByModel ¶
func (*AssetModel) UpdateByID ¶
type ModelModel ¶
type ModelModel struct {
// contains filtered or unexported fields
}
func NewModelModel ¶
func (*ModelModel) DeleteByID ¶
func (m *ModelModel) DeleteByID(ctx context.Context, id int64) error
func (*ModelModel) ListByVendorID ¶
func (*ModelModel) ListModels ¶
func (m *ModelModel) ListModels(ctx context.Context) ([]Model, error)
func (*ModelModel) UpdateByID ¶
type NewVendor ¶
type NewVendor struct {
Name string `json:"name" conform:"trim" validate:"required,min=1,max=150"`
}
type VendorModel ¶
type VendorModel struct {
// contains filtered or unexported fields
}
func NewVendorModel ¶
func (*VendorModel) DeleteByID ¶
func (m *VendorModel) DeleteByID(ctx context.Context, id int64) error
func (*VendorModel) ListVendors ¶
func (m *VendorModel) ListVendors(ctx context.Context) ([]Vendor, error)
Click to show internal directories.
Click to hide internal directories.