warehouse/controller/resource.go
2024-11-13 21:16:22 +01:00

25 lines
503 B
Go

package controller
import (
"git.schreifuchs.ch/schreifuchs/warehouse/api"
"git.schreifuchs.ch/schreifuchs/warehouse/model"
)
// Implement the interface
type Controller struct {
db database
}
func New(db database) *Controller {
return &Controller{
db: db,
}
}
type database interface {
InsertBucket(bucket *model.Bucket) error
FindApiBuckets(limit, offset int) (buckets []api.Bucket, err error)
FindBucketIdByName(name string) (id uint, err error)
DeleteBucketByName(name string) error
}