admin

package
v0.0.0-...-902682f Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 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 AdminUsecase

type AdminUsecase struct {
	Repo Repository

	ConfigJWT middlewares.ConfigJWT
	// contains filtered or unexported fields
}

func (*AdminUsecase) GetById

func (usecase *AdminUsecase) GetById(ctx context.Context, id int) (Domain, error)

func (*AdminUsecase) Login

func (usecase *AdminUsecase) Login(ctx context.Context, domain Domain) (Domain, error)

type Domain

type Domain struct {
	Id        int
	Name      string
	Username  string
	Password  string
	JWTToken  string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Repository

type Repository interface {
	Login(ctx context.Context, username string, password string) (Domain, error)
	GetById(ctx context.Context, id int) (Domain, error)
}

type Usecase

type Usecase interface {
	Login(ctx context.Context, domain Domain) (Domain, error)
	GetById(ctx context.Context, id int) (Domain, error)
}

func NewUsecase

func NewUsecase(repo Repository, timeout time.Duration, configJWT middlewares.ConfigJWT) Usecase

Jump to

Keyboard shortcuts

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