repository

package
v0.0.0-...-20a5a9c Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repositories

type Repositories struct {
	Users  UsersRepository
	Tokens TokensRepository
}

type TokensRepository

type TokensRepository interface {
	Get(ctx context.Context, userID, tokenID uuid.UUID) (domain.Token, error)
	GetByKey(ctx context.Context, key string) (domain.Token, error)
	GetByUserID(ctx context.Context, userID uuid.UUID) ([]domain.Token, error)
	GetByTokenID(ctx context.Context, tokenID uuid.UUID) (domain.Token, error)
	Set(ctx context.Context, token *domain.Token, ttl time.Duration) error
	Delete(ctx context.Context, key string) error
	DeleteByUserID(ctx context.Context, userID uuid.UUID) error
	DeleteByTokenID(ctx context.Context, tokenID uuid.UUID) error
}

type UsersRepository

type UsersRepository interface {
	Save(ctx context.Context, user *domain.User) error
	Get(ctx context.Context, id uuid.UUID) (domain.User, error)
	GetByCredentials(ctx context.Context, email, password string) (domain.User, error)
	// Update domain.User Name, Email and Password by ID
	Update(ctx context.Context, user *domain.User) error
	Delete(ctx context.Context, id uuid.UUID) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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