From 9b82a2c4e2e772945d6677ab21539d7615607dcd Mon Sep 17 00:00:00 2001 From: Matthew Rich Date: Mon, 1 Jul 2024 14:55:23 -0700 Subject: [PATCH] add data interfaces --- internal/data/data.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 internal/data/data.go diff --git a/internal/data/data.go b/internal/data/data.go new file mode 100644 index 0000000..b7989aa --- /dev/null +++ b/internal/data/data.go @@ -0,0 +1,34 @@ +// Copyright 2024 Matthew Rich . 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 +}