Documentation
¶
Index ¶
- type CUDCartRepository
- type CUDRepository
- type DescriptionAndSpecification
- type DescriptionLengthValidation
- type DescriptionMaxLengthErr
- type DescriptionMinLengthErr
- type DescriptionSpecification
- type ImageWeightErr
- type ImagesAndSpecification
- type ImagesMaxLength
- type ImagesMinLength
- type ImagesSpecification
- type ImagesWeightValidation
- type Parameters
- type Post
- type RCartRepository
- type RRepository
- type Specification
- type SpecificationManager
- type TagsAndSpecification
- type TagsLengthValidation
- type TagsMaxLength
- type TagsMinLength
- type TagsSpecification
- type TitleAndSpecification
- type TitleLengthValidation
- type TitleMaxLengthErr
- type TitleMinLengthErr
- type TitleSpecification
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CUDCartRepository ¶
type CUDRepository ¶
type CUDRepository interface { Create(ctx context.Context, post Post) (int, error) Update(ctx context.Context, post Post) (int, error) Delete(ctx context.Context, id uuid.UUID) (int, error) AddFavorite(ctx context.Context, userId uuid.UUID, postId uuid.UUID) (int, error) RemoveFavorite(ctx context.Context, userId uuid.UUID, postId uuid.UUID) (int, error) }
type DescriptionAndSpecification ¶
type DescriptionAndSpecification struct {
// contains filtered or unexported fields
}
func CreateDescriptionAndSpecification ¶
func CreateDescriptionAndSpecification(cfg config.Config) DescriptionAndSpecification
func (DescriptionAndSpecification) IsValid ¶
func (e DescriptionAndSpecification) IsValid(desc string) error
type DescriptionLengthValidation ¶
type DescriptionLengthValidation struct {
// contains filtered or unexported fields
}
func CreateDescriptionLengthValidation ¶
func CreateDescriptionLengthValidation(cfg config.Config) DescriptionLengthValidation
func (DescriptionLengthValidation) IsValid ¶
func (e DescriptionLengthValidation) IsValid(desc string) error
type DescriptionMaxLengthErr ¶
type DescriptionMaxLengthErr struct {
// contains filtered or unexported fields
}
func (DescriptionMaxLengthErr) Error ¶
func (e DescriptionMaxLengthErr) Error() string
type DescriptionMinLengthErr ¶
type DescriptionMinLengthErr struct {
// contains filtered or unexported fields
}
func (DescriptionMinLengthErr) Error ¶
func (e DescriptionMinLengthErr) Error() string
type DescriptionSpecification ¶
type DescriptionSpecification struct {
// contains filtered or unexported fields
}
func CreateDescriptionSpecification ¶
func CreateDescriptionSpecification(cfg config.Config) DescriptionSpecification
func (DescriptionSpecification) IsValid ¶
func (e DescriptionSpecification) IsValid(desc string) error
type ImageWeightErr ¶
type ImageWeightErr struct {
// contains filtered or unexported fields
}
func (ImageWeightErr) Error ¶
func (e ImageWeightErr) Error() string
type ImagesAndSpecification ¶
type ImagesAndSpecification struct {
// contains filtered or unexported fields
}
func CreateImagesAndSpecification ¶
func CreateImagesAndSpecification(cfg config.Config) ImagesAndSpecification
func (ImagesAndSpecification) IsValid ¶
func (e ImagesAndSpecification) IsValid(image string) error
type ImagesMaxLength ¶
type ImagesMaxLength struct {
// contains filtered or unexported fields
}
func (ImagesMaxLength) Error ¶
func (e ImagesMaxLength) Error() string
type ImagesMinLength ¶
type ImagesMinLength struct {
// contains filtered or unexported fields
}
func (ImagesMinLength) Error ¶
func (e ImagesMinLength) Error() string
type ImagesSpecification ¶
type ImagesSpecification struct {
// contains filtered or unexported fields
}
func CreateImagesSpecification ¶
func CreateImagesSpecification(cfg config.Config) ImagesSpecification
func (ImagesSpecification) IsValid ¶
func (e ImagesSpecification) IsValid(image string) error
type ImagesWeightValidation ¶
type ImagesWeightValidation struct {
// contains filtered or unexported fields
}
func CreateImagesCountValidation ¶
func CreateImagesCountValidation(cfg config.Config) ImagesWeightValidation
func (ImagesWeightValidation) IsValid ¶
func (e ImagesWeightValidation) IsValid(image string) error
type Parameters ¶
type Post ¶
type RCartRepository ¶
type RRepository ¶
type RRepository interface { GetIdPost(ctx context.Context, id uuid.UUID) (*Post, int, error) GetMiniPostSortNew(ctx context.Context, par Parameters) ([]Post, int, error) GetFavorite(ctx context.Context, userId uuid.UUID) ([]uuid.UUID, int, error) GetCart(ctx context.Context, postId []uuid.UUID) ([]Post, int, error) SearchPost(ctx context.Context, search string) ([]uuid.UUID, int, error) }
type Specification ¶
type Specification[T typeSpecification] interface {
IsValid(verifiable T) error
}
type SpecificationManager ¶
type SpecificationManager struct { Title Specification[string] Desciption Specification[string] Images Specification[string] Tags Specification[string] }
func CreateSpecificationManager ¶
func CreateSpecificationManager(cfg config.Config) SpecificationManager
type TagsAndSpecification ¶
type TagsAndSpecification struct {
// contains filtered or unexported fields
}
func CreateTagsAndSpecidication ¶
func CreateTagsAndSpecidication(cfg config.Config) TagsAndSpecification
func (TagsAndSpecification) IsValid ¶
func (e TagsAndSpecification) IsValid(tags string) error
type TagsLengthValidation ¶
type TagsLengthValidation struct {
// contains filtered or unexported fields
}
func CreateTagsLengthValidation ¶
func CreateTagsLengthValidation(cfg config.Config) TagsLengthValidation
func (TagsLengthValidation) IsValid ¶
func (e TagsLengthValidation) IsValid(tags string) error
type TagsMaxLength ¶
type TagsMaxLength struct {
// contains filtered or unexported fields
}
func (TagsMaxLength) Error ¶
func (e TagsMaxLength) Error() string
type TagsMinLength ¶
type TagsMinLength struct {
// contains filtered or unexported fields
}
func (TagsMinLength) Error ¶
func (e TagsMinLength) Error() string
type TagsSpecification ¶
type TagsSpecification struct {
// contains filtered or unexported fields
}
func CreateTagsSpecification ¶
func CreateTagsSpecification(cfg config.Config) TagsSpecification
func (TagsSpecification) IsValid ¶
func (e TagsSpecification) IsValid(tags string) error
type TitleAndSpecification ¶
type TitleAndSpecification struct {
// contains filtered or unexported fields
}
func CreateTitleAndSpecification ¶
func CreateTitleAndSpecification(cfg config.Config) TitleAndSpecification
func (TitleAndSpecification) IsValid ¶
func (e TitleAndSpecification) IsValid(title string) error
type TitleLengthValidation ¶
type TitleLengthValidation struct {
// contains filtered or unexported fields
}
func CreateTitleLengthValidation ¶
func CreateTitleLengthValidation(cfg config.Config) TitleLengthValidation
func (TitleLengthValidation) IsValid ¶
func (e TitleLengthValidation) IsValid(title string) error
type TitleMaxLengthErr ¶
type TitleMaxLengthErr struct {
// contains filtered or unexported fields
}
func (TitleMaxLengthErr) Error ¶
func (e TitleMaxLengthErr) Error() string
type TitleMinLengthErr ¶
type TitleMinLengthErr struct {
// contains filtered or unexported fields
}
func (TitleMinLengthErr) Error ¶
func (e TitleMinLengthErr) Error() string
type TitleSpecification ¶
type TitleSpecification struct {
// contains filtered or unexported fields
}
func CreateTitleSpecification ¶
func CreateTitleSpecification(cfg config.Config) TitleSpecification
func (TitleSpecification) IsValid ¶
func (e TitleSpecification) IsValid(title string) error
Click to show internal directories.
Click to hide internal directories.