Documentation
¶
Index ¶
- Variables
- type Filter
- type ListOrder
- type Option
- type Options
- type Repository
- type RepositoryImpl
- func (rep *RepositoryImpl) Approve(ctx context.Context, id uint64, message string) error
- func (rep *RepositoryImpl) Count(ctx context.Context, qops ...Option) (int64, error)
- func (rep *RepositoryImpl) Create(ctx context.Context, router *models.TrafficRouter) (uint64, error)
- func (rep *RepositoryImpl) Delete(ctx context.Context, id uint64) error
- func (rep *RepositoryImpl) FetchList(ctx context.Context, qops ...Option) ([]*models.TrafficRouter, error)
- func (rep *RepositoryImpl) Get(ctx context.Context, id uint64) (*models.TrafficRouter, error)
- func (rep *RepositoryImpl) Pause(ctx context.Context, id uint64, message string) error
- func (rep *RepositoryImpl) Reject(ctx context.Context, id uint64, message string) error
- func (rep *RepositoryImpl) Run(ctx context.Context, id uint64, message string) error
- func (rep *RepositoryImpl) Update(ctx context.Context, id uint64, router *models.TrafficRouter) error
- type Usecase
- type UsecaseImpl
- func (uc *UsecaseImpl) Approve(ctx context.Context, id uint64, message string) error
- func (uc *UsecaseImpl) Count(ctx context.Context, qops ...Option) (int64, error)
- func (uc *UsecaseImpl) Create(ctx context.Context, router *models.TrafficRouter) (uint64, error)
- func (uc *UsecaseImpl) Delete(ctx context.Context, id uint64) error
- func (uc *UsecaseImpl) FetchList(ctx context.Context, qops ...Option) ([]*models.TrafficRouter, error)
- func (uc *UsecaseImpl) Get(ctx context.Context, id uint64) (*models.TrafficRouter, error)
- func (uc *UsecaseImpl) Pause(ctx context.Context, id uint64, message string) error
- func (uc *UsecaseImpl) Reject(ctx context.Context, id uint64, message string) error
- func (uc *UsecaseImpl) Run(ctx context.Context, id uint64, message string) error
- func (uc *UsecaseImpl) Update(ctx context.Context, id uint64, router *models.TrafficRouter) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidTrafficRouter = errors.New(`invalid traffic router`)
)
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
ID []uint64
AccountID uint64
Active *models.ActiveStatus
RTBSourceIDs []uint64
Formats []string
DeviceTypes []uint64
Devices []uint64
OS []uint64
Browsers []uint64
Carriers []uint64
Categories []uint64
Countries []string
Languages []string
Domains []string
Applications []uint64
Zones []uint64
Secure int
AdBlock int
PrivateBrowsing int
IP int
}
Filter of the objects list
type ListOrder ¶
type ListOrder struct {
ID models.Order
Title models.Order
Active models.Order
Percent models.Order
CreatedAt models.Order
UpdatedAt models.Order
}
ListOrder of the objects list
type Repository ¶
type Repository interface {
Get(ctx context.Context, id uint64) (*models.TrafficRouter, error)
FetchList(ctx context.Context, qops ...Option) ([]*models.TrafficRouter, error)
Count(ctx context.Context, qops ...Option) (int64, error)
Create(ctx context.Context, router *models.TrafficRouter) (uint64, error)
Update(ctx context.Context, id uint64, router *models.TrafficRouter) error
Delete(ctx context.Context, id uint64) error
Run(ctx context.Context, id uint64, message string) error
Pause(ctx context.Context, id uint64, message string) error
Approve(ctx context.Context, id uint64, message string) error
Reject(ctx context.Context, id uint64, message string) error
}
type RepositoryImpl ¶
type RepositoryImpl struct {
repository.Repository
}
func NewRepositoryImpl ¶
func NewRepositoryImpl() *RepositoryImpl
NewRepositoryImpl creates a new instance of RepositoryImpl.
func (*RepositoryImpl) Create ¶
func (rep *RepositoryImpl) Create(ctx context.Context, router *models.TrafficRouter) (uint64, error)
Create creates a new TrafficRouter object.
func (*RepositoryImpl) Delete ¶
func (rep *RepositoryImpl) Delete(ctx context.Context, id uint64) error
Delete deletes a TrafficRouter object by ID.
func (*RepositoryImpl) FetchList ¶
func (rep *RepositoryImpl) FetchList(ctx context.Context, qops ...Option) ([]*models.TrafficRouter, error)
FetchList retrieves a list of TrafficRouter objects.
func (*RepositoryImpl) Get ¶
func (rep *RepositoryImpl) Get(ctx context.Context, id uint64) (*models.TrafficRouter, error)
Get returns the object by id
func (*RepositoryImpl) Update ¶
func (rep *RepositoryImpl) Update(ctx context.Context, id uint64, router *models.TrafficRouter) error
Update updates an existing TrafficRouter object.
type Usecase ¶
type Usecase interface {
Get(ctx context.Context, id uint64) (*models.TrafficRouter, error)
FetchList(ctx context.Context, qops ...Option) ([]*models.TrafficRouter, error)
Count(ctx context.Context, qops ...Option) (int64, error)
Create(ctx context.Context, router *models.TrafficRouter) (uint64, error)
Update(ctx context.Context, id uint64, router *models.TrafficRouter) error
Delete(ctx context.Context, id uint64) error
Run(ctx context.Context, id uint64, message string) error
Pause(ctx context.Context, id uint64, message string) error
Approve(ctx context.Context, id uint64, message string) error
Reject(ctx context.Context, id uint64, message string) error
}
type UsecaseImpl ¶
type UsecaseImpl struct {
// contains filtered or unexported fields
}
func NewUsecaseImpl ¶
func NewUsecaseImpl(repo Repository) *UsecaseImpl
NewUsecaseImpl creates a new instance of UsecaseImpl.
func (*UsecaseImpl) Create ¶
func (uc *UsecaseImpl) Create(ctx context.Context, router *models.TrafficRouter) (uint64, error)
Create creates a new TrafficRouter object.
func (*UsecaseImpl) Delete ¶
func (uc *UsecaseImpl) Delete(ctx context.Context, id uint64) error
Delete removes the object by id
func (*UsecaseImpl) FetchList ¶
func (uc *UsecaseImpl) FetchList(ctx context.Context, qops ...Option) ([]*models.TrafficRouter, error)
FetchList retrieves a list of TrafficRouter objects.
func (*UsecaseImpl) Get ¶
func (uc *UsecaseImpl) Get(ctx context.Context, id uint64) (*models.TrafficRouter, error)
Get returns the object by id
func (*UsecaseImpl) Update ¶
func (uc *UsecaseImpl) Update(ctx context.Context, id uint64, router *models.TrafficRouter) error
Update updates an existing TrafficRouter object.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.