Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorCreateCategoryCommandInvalidId = errors.New("category Id must be a valid ULID")
View Source
var ErrorCreateCategoryCommandInvalidName = errors.New("category Name cannot be empty")
View Source
var ErrorUpdateCategoryCommandInvalidName = errors.New("category Name cannot be empty")
Functions ¶
This section is empty.
Types ¶
type CategoryRepository ¶
type CategoryRepository interface { GetCategories(ctx context.Context) ([]*Category, int, error) GetCategory(ctx context.Context, id ulid.ULID) (*Category, error) CreateCategory(ctx context.Context, ccc *CreateCategoryCommand) error UpdateCategory(ctx context.Context, id ulid.ULID, ccc *UpdateCategoryCommand) error DeleteCategory(ctx context.Context, id ulid.ULID) error }
type CategoryService ¶
type CategoryService interface { GetCategories(ctx context.Context) ([]*Category, int, error) GetCategory(ctx context.Context, id ulid.ULID) (*Category, error) CreateCategory(ctx context.Context, ccc *CreateCategoryCommand) (*ulid.ULID, error) UpdateCategory(ctx context.Context, id ulid.ULID, ccc *UpdateCategoryCommand) error DeleteCategory(ctx context.Context, id ulid.ULID) error }
type CreateCategoryCommand ¶
type CreateCategoryCommand struct { Id ulid.ULID Name string `json:"name"` }
func (*CreateCategoryCommand) Validate ¶
func (ccc *CreateCategoryCommand) Validate() error
type UpdateCategoryCommand ¶
type UpdateCategoryCommand struct {
Name string `json:"name"`
}
func (*UpdateCategoryCommand) Validate ¶
func (ccc *UpdateCategoryCommand) Validate() error
Click to show internal directories.
Click to hide internal directories.