option

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package option present full API functionality of the specific object

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Type        []model.OptionType
	TargetID    []uint64
	Name        []string
	NamePattern []string
}

Filter of the objects list

func (*Filter) PrepareQuery

func (fl *Filter) PrepareQuery(q *gorm.DB) *gorm.DB

PrepareQuery returns the query with applied filters

type ListOrder

type ListOrder struct {
	Name      model.Order
	Type      model.Order
	TargetID  model.Order
	CreatedAt model.Order
	UpdatedAt model.Order
}

ListOrder object with order values which is not NULL

func (*ListOrder) PrepareQuery

func (ord *ListOrder) PrepareQuery(q *gorm.DB) *gorm.DB

PrepareQuery returns the query with applied order

type Repository

type Repository interface {
	Get(ctx context.Context, name string, otype model.OptionType, targetID uint64) (*model.Option, error)
	FetchList(ctx context.Context, filter *Filter, order *ListOrder, pagination *repository.Pagination) ([]*model.Option, error)
	Count(ctx context.Context, filter *Filter) (int64, error)
	Set(ctx context.Context, opt *model.Option) error
	Delete(ctx context.Context, name string, otype model.OptionType, targetID uint64) error
}

Repository of access to the option

type Usecase

type Usecase interface {
	Get(ctx context.Context, name string, otype model.OptionType, targetID uint64) (*model.Option, error)
	FetchList(ctx context.Context, filter *Filter, order *ListOrder, pagination *repository.Pagination) ([]*model.Option, error)
	Count(ctx context.Context, filter *Filter) (int64, error)
	Set(ctx context.Context, opt *model.Option) error
	Delete(ctx context.Context, name string, otype model.OptionType, targetID uint64) error
}

Usecase of the Option

Directories

Path Synopsis
delivery
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package repository implements methods of working with the repository objects
Package repository implements methods of working with the repository objects
Package usecase account implementation
Package usecase account implementation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL