Documentation ¶
Overview ¶
Package store is a collection of composable interfaces that are can be implemented in order to build a storage driver
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action func(ctx context.Context, w http.ResponseWriter, r *http.Request) (*jsh.Object, jsh.ErrorType)
Action is a handler that performs a specific action on a resource.
type CRUD ¶
type CRUD interface { Save(ctx context.Context, object *jsh.Object) (*jsh.Object, jsh.ErrorType) Get(ctx context.Context, id string) (*jsh.Object, jsh.ErrorType) List(ctx context.Context) (jsh.List, jsh.ErrorType) Update(ctx context.Context, object *jsh.Object) (*jsh.Object, jsh.ErrorType) Delete(ctx context.Context, id string) jsh.ErrorType }
CRUD is a resource controller interface.
type ToMany ¶
type ToMany interface { ListResources(ctx context.Context, id string) (jsh.List, jsh.ErrorType) List(ctx context.Context, id string) (jsh.IDList, jsh.ErrorType) Save(ctx context.Context, id string, list jsh.IDList) (jsh.IDList, jsh.ErrorType) Update(ctx context.Context, id string, list jsh.IDList) (jsh.IDList, jsh.ErrorType) Delete(ctx context.Context, id string, list jsh.IDList) (jsh.IDList, jsh.ErrorType) }
ToMany is a to-many resource relationship controller interface.
type ToManyList ¶
List all relationships of a resource from storage.
type ToManyListResources ¶
List all resources related to a resource from storage.
type ToManyUpdate ¶
Update existing relationships in storage.
type ToOne ¶
type ToOne interface { GetResource(ctx context.Context, id string) (*jsh.Object, jsh.ErrorType) Get(ctx context.Context, id string) (*jsh.IDObject, jsh.ErrorType) Update(ctx context.Context, id string, relationship *jsh.IDObject) (*jsh.IDObject, jsh.ErrorType) }
ToOne is a to-one resource relationship controller interface.
type ToOneUpdate ¶
type ToOneUpdate func(ctx context.Context, id string, relationship *jsh.IDObject) (*jsh.IDObject, jsh.ErrorType)
Update an existing relationship in storage.
Click to show internal directories.
Click to hide internal directories.