Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct { UUID uuid.UUID `gorm:"type:uuid;primaryKey" json:"uuid" binding:"-"` CreatedAt time.Time `json:"createdAt" binding:"-"` UpdatedAt time.Time `json:"updatedAt" binding:"-"` DeletedAt gorm.DeletedAt `json:"-" binding:"-"` Name string `json:"name" binding:"required"` Description string `json:"description" ` Parent uuid.UUID `json:"parent" gorm:"index:category_parent"` Owner uuid.UUID `gorm:"index:category_owner;not null" json:"owner" ` }
Category to iterate with database
func (*Category) BeforeCreate ¶
BeforeCreate execute commands before creating a Category
type Repository ¶
type Repository interface { Delete(ctx context.Context, pk uuid.UUID, owner uuid.UUID) error Get(ctx context.Context, pk uuid.UUID, owner uuid.UUID) (*Category, error) Save(ctx context.Context, row *Category) error Query(ctx context.Context, filters *rest.Query) ([]Category, error) }
Repository interface defines methods to manipute user categories
Click to show internal directories.
Click to hide internal directories.