Documentation ¶
Index ¶
- type GormRepository
- func (r *GormRepository) Create(record metav1.Resource) error
- func (r *GormRepository) Exist(conditions interface{}) (bool, error)
- func (r *GormRepository) Find(conditions interface{}) (record metav1.Resource, err error)
- func (r *GormRepository) FindAll(conditions interface{}) (records []metav1.Resource, err error)
- func (r *GormRepository) Get(id int) (record metav1.Resource, err error)
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GormRepository ¶
type GormRepository struct { // gorm db connection. Db *gorm.DB // contains filtered or unexported fields }
func NewGormRepository ¶
func NewGormRepository(db *gorm.DB, logger *zap.Logger) *GormRepository
func (*GormRepository) Exist ¶
func (r *GormRepository) Exist(conditions interface{}) (bool, error)
func (*GormRepository) Find ¶
func (r *GormRepository) Find(conditions interface{}) (record metav1.Resource, err error)
type Repository ¶
type Repository interface { // Get returns the record for the given id. Get(id int) (record metav1.Resource, err error) // Find return one record filter by the conditions. Find(conditions interface{}) (record metav1.Resource, err error) // FindAll return all records filter by the conditions. FindAll(conditions interface{}) (records []metav1.Resource, err error) // Exist return one record does exist in table. Exist(conditions interface{}) (bool, error) // Create record. Create(record metav1.Resource) error }
Repository is an interface for a repository.
Click to show internal directories.
Click to hide internal directories.