add data interfaces
This commit is contained in:
parent
1460d2285b
commit
9b82a2c4e2
34
internal/data/data.go
Normal file
34
internal/data/data.go
Normal file
@ -0,0 +1,34 @@
|
||||
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
||||
|
||||
package data
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type Validator interface {
|
||||
Validate() error
|
||||
}
|
||||
|
||||
type Creator interface {
|
||||
Create(context.Context) error
|
||||
}
|
||||
|
||||
type Reader interface {
|
||||
Read(context.Context) ([]byte, error)
|
||||
}
|
||||
|
||||
type Updater interface {
|
||||
Update(context.Context) error
|
||||
}
|
||||
|
||||
type Deleter interface {
|
||||
Delete(context.Context) error
|
||||
}
|
||||
|
||||
type Crudder struct {
|
||||
Creator
|
||||
Reader
|
||||
Updater
|
||||
Deleter
|
||||
}
|
Loading…
Reference in New Issue
Block a user