Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entity ¶
type Entity interface { // TableName returns the table/collection name for a certain entity. TableName() string // SingularName returns the entity's name in singular. SingularName() string // PluralName returns the entity's name in plural. PluralName() string }
Entity represents a generic entity. Entities represent models to be used with a certain Repository.
type Filter ¶
type Filter interface { // Template represents a SQL Syntax. // Example: `name = ? AND age = ?` Template() string // Values returns the values used by the SQL Syntax. // Example: `["Test", 33]` Values() []interface{} }
Filter represents a generic filter used by repositories to filter data by a key-value set.
type Repository ¶
type Repository interface { Create([]Entity) ([]Entity, error) Find(output interface{}, offset, limit *int, filters ...Filter) error FindOne(entity Entity, filters ...Filter) error Update(data interface{}, filters ...Filter) error Delete(filters ...Filter) error SingularName() string PluralName() string Model() Entity }
Repository represents a generic repository layer interface.
Click to show internal directories.
Click to hide internal directories.