usecase

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package usecase provides business logic for option management

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Usecase

type Usecase struct {
	// contains filtered or unexported fields
}

Usecase implements business logic for option access and management

func NewUsecase

func NewUsecase(repo option.Repository) *Usecase

NewUsecase creates and returns a new Usecase instance

func (*Usecase) Count

func (a *Usecase) Count(ctx context.Context, opts ...option.QOption) (int64, error)

Count returns the total count of options matching the filter with permission checks

func (*Usecase) Delete

func (a *Usecase) Delete(ctx context.Context, name string, otype models.OptionType, targetID uint64) error

Delete removes an option with permission checks

func (*Usecase) FetchList

func (a *Usecase) FetchList(ctx context.Context, opts ...option.QOption) ([]*models.Option, error)

FetchList retrieves a list of options filtered and ordered with permission checks

func (*Usecase) Get

func (a *Usecase) Get(ctx context.Context, name string, otype models.OptionType, targetID uint64) (*models.Option, error)

Get retrieves an option by name, type, and target ID with permission checks

func (*Usecase) Set

func (a *Usecase) Set(ctx context.Context, targetObj *models.Option) error

Set creates or updates an option with permission checks

func (*Usecase) SetOption added in v0.2.5

func (a *Usecase) SetOption(ctx context.Context, name string, otype models.OptionType, targetID uint64, value any) error

SetOption sets an option value by name, type, and target ID

Jump to

Keyboard shortcuts

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