Documentation ¶
Overview ¶
Package resources
Summary ¶
This package collect CRUD interface based signature contracts that commonly appears upon interacting with external resources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Creator ¶
type Creator interface { // Create takes a ptr to a entity<T> and store it into the resource. // It also updates the entity<T> ext:"ID" field with the associated uniq resource id. // The reason behind this links the id and not returning the id is that, // in most case the Create error value is the only thing that is checked for errors, // and introducing an extra value also introduce boiler plates in the handling. Create(ctx context.Context, ptr interface{}) error }
type Deleter ¶
type Deleter interface { // DeleteByID will remove a <T> type entity from the storage by a given ID DeleteByID(ctx context.Context, T interface{}, id string) error }
Deleter request to destroy a business entity in the Resource that implement it's test.
type Finder ¶
type Finder interface { // FindByID will link an entity that is found in the resource to the received ptr, // and report back if it succeeded finding the entity in the resource. // It also reports if there was an unexpected exception during the execution. // It was an intentional decision to not use error to represent "not found" case, // but tell explicitly this information in the form of return bool value. FindByID(ctx context.Context, ptr interface{}, id string) (_found bool, _err error) // FindAll will return all entity that has <T> type FindAll(ctx context.Context, T interface{}) frameless.Iterator }
type TestEntity ¶
type TestEntity struct {
ID string `ext:"ID"`
}
Directories ¶
Path | Synopsis |
---|---|
Package specs Summary This package implements generic CRUD operation related testing specifications that commonly appears upon interacting with external resources.
|
Package specs Summary This package implements generic CRUD operation related testing specifications that commonly appears upon interacting with external resources. |
Click to show internal directories.
Click to hide internal directories.