(Probably) finished with docs and interfaces.

Starting to build out the actual logic.
This commit is contained in:
Caleb Gardner
2024-05-21 05:50:07 -05:00
parent 4244b6985a
commit e4f8b31e29
9 changed files with 235 additions and 96 deletions
+6 -4
View File
@@ -3,7 +3,7 @@ package darkstorm
import "errors"
var (
ErrIDNotFound = errors.New("id not found in table")
ErrNotFound = errors.New("no matches found in table")
)
type IDStruct interface {
@@ -12,12 +12,14 @@ type IDStruct interface {
type Table[T IDStruct] interface {
Get(ID string) (data T, err error)
Find(values map[string]any) ([]T, error)
Insert(data T) error
Update(data T) error
Remove(ID string)
Remove(ID string) error
FullUpdate(ID string, data T) error
PartUpdate(ID string, update map[string]any) error
}
type CrashTable interface {
Table[CrashReport]
InsertCrash(report IndividualCrash) error
InsertCrash(ID string, report IndividualCrash) error
}