cml04-falcon-ui/storage/storage.go

44 lines
1.2 KiB
Go
Raw Normal View History

2024-10-04 20:02:51 +02:00
package storage
2024-10-06 04:55:38 +02:00
import (
"context"
2024-10-07 10:25:25 +02:00
"fmt"
2024-10-06 04:55:38 +02:00
"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)
}
2024-10-04 20:02:51 +02:00
type storage struct{}
2024-10-06 04:55:38 +02:00
// 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) {
2024-10-07 10:25:25 +02:00
fmt.Println(lb, inicio, final)
return []types.Barcode{}, nil
2024-10-06 04:55:38 +02:00
}
// Barcode implements Storager.
func (s *storage) Barcode(ctx context.Context, reading string) (barcode *types.Barcode, err error) {
2024-10-07 10:25:25 +02:00
fmt.Println(reading)
return &types.Barcode{}, nil
2024-10-06 04:55:38 +02:00
}
2024-10-04 20:02:51 +02:00
func New() Storager {
return &storage{}
}