Documentation
¶
Index ¶
- Variables
- func NewDecoder(decimalSeparator string) *form.Decoder
- type APIRouter
- type Asset
- type AssetListPage
- type AssetRepo
- type Barcode
- type Category
- type Control
- type DeleteAssetsPageViewModel
- type EditAssetsPageViewModel
- type File
- type Label
- type LabelSheetCreatorPageViewModel
- type LabelSize
- type ListAssetsPageViewModel
- type ListAssetsQuery
- type ListAssetsQuerySearch
- type ListCategoriesQuery
- type MetaInfo
- type MonetaryAmount
- type PageLayout
- type PageSize
- type Part
- type PurchaseInfo
- type RepoSQLite
- func (ar *RepoSQLite) Create(ctx context.Context, exec bob.Executor, asset *Asset) (*Asset, error)
- func (ar *RepoSQLite) CreateParts(ctx context.Context, exec bob.Executor, parts []*Part) error
- func (ar *RepoSQLite) Delete(ctx context.Context, exec bob.Executor, id int64) error
- func (ar *RepoSQLite) DeleteParts(ctx context.Context, exec bob.Executor, assetID int64) error
- func (ar *RepoSQLite) Get(ctx context.Context, exec bob.Executor, idOrTag string) (*Asset, error)
- func (ar *RepoSQLite) List(ctx context.Context, exec bob.Executor, query ListAssetsQuery) (*AssetListPage, error)
- func (ar *RepoSQLite) ListCategories(ctx context.Context, exec bob.Executor, query ListCategoriesQuery) ([]Category, error)
- func (ar *RepoSQLite) ListForExport(ctx context.Context, exec bob.Executor, query ListAssetsQuery) (*AssetListPage, error)
- func (ar *RepoSQLite) Update(ctx context.Context, exec bob.Executor, asset *Asset) (*Asset, error)
- type Sheet
- type Status
- type UIRouter
- type ViewAssetsPageViewModel
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAssetNotFound = errors.New("asset not found")
Functions ¶
func NewDecoder ¶
Types ¶
type Asset ¶
type Asset struct {
ID int64 `form:"-"`
ParentAssetID int64 `form:"parent_asset_id"`
Parent *Asset `form:"-"`
Children []*Asset `form:"-"`
Status Status `form:"status"`
Tag string `form:"tag"`
Name string `form:"name"`
Category string `form:"category"`
Model string `form:"model"`
ModelNo string `form:"model_no"`
SerialNo string `form:"serial_no"`
Manufacturer string `form:"manufacturer"`
Notes string `form:"notes"`
ImageURL string `form:"-"`
ThumbnailURL string `form:"-"`
WarrantyUntil time.Time `form:"warranty_until,omitempty"`
CustomAttrs map[string]any `form:"custom_attrs"`
CheckedOutTo int64 `form:"checked_out_to"`
Location string `form:"location"`
PositionCode string `form:"position_code"`
PurchaseInfo PurchaseInfo `form:"purchase"`
PartsTotalCounter int `form:"parts_total_counter"`
Parts []*Part `form:"parts"`
MetaInfo MetaInfo `form:"-"`
}
type AssetListPage ¶
type AssetRepo ¶
type AssetRepo interface {
Get(ctx context.Context, exec bob.Executor, idOrTag string) (*Asset, error)
List(ctx context.Context, exec bob.Executor, query ListAssetsQuery) (*AssetListPage, error)
ListForExport(ctx context.Context, exec bob.Executor, query ListAssetsQuery) (*AssetListPage, error)
Create(ctx context.Context, exec bob.Executor, asset *Asset) (*Asset, error)
Update(ctx context.Context, exec bob.Executor, asset *Asset) (*Asset, error)
Delete(ctx context.Context, exec bob.Executor, id int64) error
CreateParts(ctx context.Context, exec bob.Executor, parts []*Part) error
DeleteParts(ctx context.Context, exec bob.Executor, assetID int64) error
ListCategories(ctx context.Context, exec bob.Executor, query ListCategoriesQuery) ([]Category, error)
}
type EditAssetsPageViewModel ¶
type LabelSheetCreatorPageViewModel ¶
type LabelSheetCreatorPageViewModel struct {
Template string `form:"template"`
SelectedAssetIDs []int64 `form:"-"`
PageSize string `form:"page_size"`
SkipLabels int `form:"skip_labels"`
NumColumns int `form:"page_cols"`
NumRows int `form:"page_rows"`
MarginLeft float64 `form:"page_margin_left"`
MarginTop float64 `form:"page_margin_top"`
MarginRight float64 `form:"page_margin_right"`
MarginBottom float64 `form:"page_margin_bottom"`
ShowBorders bool `form:"label_show_borders"`
FontSize float64 `form:"label_font_size"`
Width float64 `form:"label_width"`
Height float64 `form:"label_height"`
VerticalPadding float64 `form:"label_vertical_padding"`
HorizontalPadding float64 `form:"label_horizontal_padding"`
VerticalSpacing float64 `form:"label_vertical_spacing"`
HorizontalSpacing float64 `form:"label_horizontal_spacing"`
Assets []*Asset `form:"-"`
ValidationErrs map[string]string `form:"-"`
}
type LabelSize ¶
type LabelSize struct {
FontSize float64
// Height of a single label in mm including padding.
Height float64
// Width of a single label in mm including padding.
Width float64
// VerticalPadding applied to the inside of the label in mm.
VerticalPadding float64
// HorizontalPadding applied to the inside of the label in mm.
HorizontalPadding float64
// VerticalSpacing between each label in mm.
VerticalSpacing float64
// HorizontalSpacing between each label in mm.
HorizontalSpacing float64
}
type ListAssetsPageViewModel ¶
type ListAssetsPageViewModel struct {
Page *AssetListPage
Query ListAssetsQuery
Columns map[string]bool
Compact bool
}
type ListAssetsQuery ¶
type ListAssetsQuerySearch ¶
type ListCategoriesQuery ¶
type MonetaryAmount ¶
type MonetaryAmount int
func (MonetaryAmount) Format ¶
func (c MonetaryAmount) Format(decimalSeparator string) string
type PageLayout ¶
type Part ¶
type Part struct {
ID int64 `from:"id"`
AssetID int64 `form:"asset_id"`
Tag string `form:"tag"`
Name string `form:"name"`
Location string `form:"location"`
PositionCode string `form:"position_code"`
Notes string `form:"notes"`
CreatedBy int64 `form:"-"`
CreatedAt time.Time `form:"-"`
UpdatedAt time.Time `form:"-"`
}
type PurchaseInfo ¶
type RepoSQLite ¶
type RepoSQLite struct{}
func (*RepoSQLite) CreateParts ¶
func (*RepoSQLite) DeleteParts ¶
func (*RepoSQLite) List ¶
func (ar *RepoSQLite) List(ctx context.Context, exec bob.Executor, query ListAssetsQuery) (*AssetListPage, error)
func (*RepoSQLite) ListCategories ¶
func (ar *RepoSQLite) ListCategories(ctx context.Context, exec bob.Executor, query ListCategoriesQuery) ([]Category, error)
func (*RepoSQLite) ListForExport ¶
func (ar *RepoSQLite) ListForExport(ctx context.Context, exec bob.Executor, query ListAssetsQuery) (*AssetListPage, error)
type Sheet ¶
Click to show internal directories.
Click to hide internal directories.