44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
package storage
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"git.espin.casa/albert/cml04-falcon-ui/types"
|
|
)
|
|
|
|
type Storager interface {
|
|
Barcode(ctx context.Context, reading string) (barcode *types.Barcode, err error)
|
|
ListBarcode(ctx context.Context, lb types.LoadingBed, inicio, final string) (barcodes []types.Barcode, err error)
|
|
Bundle(ctx context.Context, ua string) (bundle *types.BundleData, err error)
|
|
ListBundle(ctx context.Context)
|
|
}
|
|
|
|
type storage struct{}
|
|
|
|
// ListBundle implements Storager.
|
|
func (s *storage) ListBundle(ctx context.Context) {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
// Bundle implements Storager.
|
|
func (s *storage) Bundle(ctx context.Context, ua string) (bundle *types.BundleData, err error) {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
// ListBarcode implements Storager.
|
|
func (s *storage) ListBarcode(ctx context.Context, lb types.LoadingBed, inicio string, final string) (barcodes []types.Barcode, err error) {
|
|
fmt.Println(lb, inicio, final)
|
|
return []types.Barcode{}, nil
|
|
}
|
|
|
|
// Barcode implements Storager.
|
|
func (s *storage) Barcode(ctx context.Context, reading string) (barcode *types.Barcode, err error) {
|
|
fmt.Println(reading)
|
|
return &types.Barcode{}, nil
|
|
}
|
|
|
|
func New() Storager {
|
|
return &storage{}
|
|
}
|