service

package
v0.13.0-alpha.101 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegistryService

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

func NewRegistryService

func NewRegistryService(db *sql.DB, registryDao *dao.Registry) *RegistryService

func (*RegistryService) Create

func (s *RegistryService) Create(ctx context.Context, registry model.Registry) (int64, error)

func (*RegistryService) DeleteByID

func (s *RegistryService) DeleteByID(ctx context.Context, registryID, userID int64) error

func (*RegistryService) GetByDomain

func (s *RegistryService) GetByDomain(ctx context.Context, domain string) (model.Registry, error)

func (*RegistryService) GetByID

func (s *RegistryService) GetByID(ctx context.Context, registryID, userID int64) (model.Registry, error)

func (*RegistryService) GetByUserID

func (s *RegistryService) GetByUserID(ctx context.Context, userID int64) ([]model.Registry, error)

func (*RegistryService) UpdateAllowImages

func (s *RegistryService) UpdateAllowImages(ctx context.Context, userID int64, allows []string, blockMessage string) (retErr error)

func (*RegistryService) UpdateAnonymousData

func (s *RegistryService) UpdateAnonymousData(ctx context.Context, userID int64, attr model.TokenAttr) (retErr error)

func (*RegistryService) UpdateByID

func (s *RegistryService) UpdateByID(ctx context.Context, registryID, userID int64, registry model.Registry) error

func (*RegistryService) UpdateIPData

func (s *RegistryService) UpdateIPData(ctx context.Context, userID int64, ips []string, attr model.TokenAttr) (retErr error)

type TokenService

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

func NewTokenService

func NewTokenService(db *sql.DB, tokenDao *dao.Token) *TokenService

func (*TokenService) Create

func (s *TokenService) Create(ctx context.Context, token model.Token) (int64, error)

func (*TokenService) Delete

func (s *TokenService) Delete(ctx context.Context, tokenID, userID int64) error

func (*TokenService) Get

func (s *TokenService) Get(ctx context.Context, tokenID, userID int64) (model.Token, error)

func (*TokenService) GetByAccount

func (s *TokenService) GetByAccount(ctx context.Context, userID int64, account, password string) (model.Token, error)

func (*TokenService) GetByUserID

func (s *TokenService) GetByUserID(ctx context.Context, userID int64) ([]model.Token, error)

type UserService

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

func NewUserService

func NewUserService(db *sql.DB, userDao *dao.User, loginDao *dao.Login) *UserService

func (*UserService) Create

func (s *UserService) Create(ctx context.Context, nickname, account, password string) (int64, error)

func (*UserService) GetByID

func (s *UserService) GetByID(ctx context.Context, id int64) (model.User, error)

func (*UserService) GetLoginByAccount

func (s *UserService) GetLoginByAccount(ctx context.Context, account string) (model.Login, error)

func (*UserService) GetLoginByID

func (s *UserService) GetLoginByID(ctx context.Context, id int64) (model.Login, error)

func (*UserService) UpdateNickname

func (s *UserService) UpdateNickname(ctx context.Context, id int64, nickname string) error

func (*UserService) UpdatePassword

func (s *UserService) UpdatePassword(ctx context.Context, account, newPassword string) error

Jump to

Keyboard shortcuts

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