Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachable ¶
type Attachable[T any] interface { // Attach generic binary to path // Path is internal address Attach(ctx context.Context, meta T, payload io.Reader) (T, *types.CommonError) GetAttachment(ctx context.Context, userID string, refIDs []string, ID string) (payload io.ReadCloser, meta T, err *types.CommonError) }
type ID ¶
Mutator or modifier, fluent style It enables the usecase to get and modify the underlying data
type RefIDs ¶
type RefIDs interface {
RefIDs() []string
}
Secondary indexes of the content, allowing to be queried other than user ID, parent ID, & user ID
type Usecase ¶
type Usecase[T any] interface { // Post (create new or overwrite) resource here Post(ctx context.Context, data T, meta any) (T, *types.CommonError) // Get all of your resource for your user ID here Get(ctx context.Context, namespace string, refIDs []string, ID string) ([]T, *types.CommonError) // Delete your resource here // the implementation can check whether there are linked resource or not Delete(ctx context.Context, namespace string, refIDs []string, ID string) (T, *types.CommonError) }
type UsecaseAttachment ¶
type UsecaseAttachment[T any] interface { Usecase[T] Attachable[T] }
type Validator ¶
type Validator interface {
Validate() *types.CommonError
}
Click to show internal directories.
Click to hide internal directories.