diff --git a/internal/data/IDatastore.go b/internal/data/IDatastore.go index 3f6255c..70eaf19 100644 --- a/internal/data/IDatastore.go +++ b/internal/data/IDatastore.go @@ -1,6 +1,7 @@ package data -// TODO docstring +// Defines the first layer of abstraction on the interface to a persistent data +// store. This may be a file or database. type IDatastore interface { Set(key string, val string) error KeyExists(key string) (bool, error) diff --git a/internal/data/IIdentifiable.go b/internal/data/IIdentifiable.go index 3398305..4e76159 100644 --- a/internal/data/IIdentifiable.go +++ b/internal/data/IIdentifiable.go @@ -1,6 +1,7 @@ package data -// TODO docstring +// Defines an Id function that uniquely identifies an object. This may be used +// as a primary key in a database/ datastore. type IIdentifiable interface { Id() string // not allowed to contain a ':' } diff --git a/internal/data/ISearchCriteria.go b/internal/data/ISearchCriteria.go index 678adcd..bd0c246 100644 --- a/internal/data/ISearchCriteria.go +++ b/internal/data/ISearchCriteria.go @@ -1,6 +1,7 @@ package data -// TODO docstring +// Defines a Weight function that determines a order on type T. As an example +// this may be used to sort article by date or filter for a search term. type ISortCriteria[T any] interface { Weight(t T) int }