service

package
v0.0.0-...-ca0e800 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateUrl     error = errors.New("duplicate url")
	ErrResourceNotFound error = errors.New("resource not found")
)
View Source
var (
	ErrUserAlreadyExists  error = errors.New("user already exists")
	ErrInvalidCredentials error = errors.New("invalid credentials")
)

Functions

This section is empty.

Types

type Service

type Service interface {
	RegisterUser(ctx context.Context, email, username, password string) error
	LoginUser(ctx context.Context, email, password string) (*model.User, error)

	AddLink(ctx context.Context, link *entity.Link) error
	RecoverLinks(ctx context.Context, user_id string) ([]model.Link, error)
	RecoverLink(ctx context.Context, slug string) (*model.Link, error)
	SearchLinksByDescription(
		ctx context.Context, description, user_id string,
	) ([]model.Link, error)
	UpdateLink(ctx context.Context, description string, id int) error
	RemoveLink(ctx context.Context, slug, user_id string) error
}

Service is the business logic of the application.

func New

func New(repo repository.Repository) Service

Jump to

Keyboard shortcuts

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