service

package
v2.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProfileNotFound = apperr.New("profile_not_found", apperr.WithTextTranslate(i18n.ErrProfileNotFound), apperr.WithCode(code.NotFound))
	ErrProfileExists   = apperr.New("profile_exists_error", apperr.WithTextTranslate(i18n.ErrProfileExists), apperr.WithCode(code.InvalidArgument))
)

Functions

This section is empty.

Types

type ProfileCreateInput

type ProfileCreateInput struct {
	Login string
	Name  string
}

type ProfileService

type ProfileService[Model model.Profile, CreateInput ProfileCreateInput, UpdateInput ProfileUpdateInput, UpdateProfileInput ProfileUpdateProfileInput] struct {
	// contains filtered or unexported fields
}

func NewProfileService

func NewProfileService[Model model.Profile, CreateInput ProfileCreateInput, UpdateInput ProfileUpdateInput, UpdateProfileInput ProfileUpdateProfileInput](
	profileRepository repository.IProfileRepository,
) ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Create

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Create(ctx context.Context, userID int, input CreateInput) (*Model, error)

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Delete

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Delete(ctx context.Context, userID int) error

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) GetById

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) GetById(ctx context.Context, userID int) (*Model, error)

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) GetByIds

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) GetByIds(ctx context.Context, userID ...int) ([]Model, error)

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Trx

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Trx(db *gorm.DB) profile.IProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Update

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Update(ctx context.Context, userID int, input UpdateInput) error

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) UpdateProfile

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) UpdateProfile(ctx context.Context, userID int, input UpdateProfileInput) error

type ProfileUpdateInput

type ProfileUpdateInput struct {
	Login *string
	Name  *string
}

type ProfileUpdateProfileInput

type ProfileUpdateProfileInput struct {
	Login *string
	Name  *string
}

Jump to

Keyboard shortcuts

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