domain

package
v0.0.0-...-fa0bdc9 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Label  string   `json:"label"`
	Values []string `json:"values"`
}

type Auth

type Auth struct {
	ID       int64
	UUID     string `json:"uuid"`
	Login    string `json:"login"`
	Password string `json:"password"`
}

type AuthRepository

type AuthRepository interface {
	GetByLogin(ctx context.Context, login string) (*Auth, error)
	StoreWithUser(ctx context.Context, a *Auth, u *User) error
	Update(ctx context.Context, a *Auth) error
}

type AuthService

type AuthService interface {
	EncodePass(ctx context.Context, pass string) string
	PassIsEqualHashedPass(ctx context.Context, pass string, hashedPass string) bool
}

type AuthUseCase

type AuthUseCase interface {
	Login(ctx context.Context, a *Auth) (Token, error)
	SignUp(ctx context.Context, a *Auth, u *User) (Token, error)
	ForgotPassCode(ctx context.Context, login string) error
	ForgotPassReset(ctx context.Context, code *Code, newPass string) (Token, error)
}

type AuthValidator

type AuthValidator interface {
	Validate(ctx context.Context, a *Auth) (IsValid, Message)
	ValidateLogin(ctx context.Context, login string) (IsValid, Message)
}

type Code

type Code struct {
	Value      string
	Identifier string
}

type CodeRepository

type CodeRepository interface {
	Store(ctx context.Context, code *Code) error
	GetByValue(ctx context.Context, value string) (*Code, error)
	DeleteByValue(ctx context.Context, value string) error
}

type CodeService

type CodeService interface {
	GenerateNewCode(ctx context.Context, identifier string, length int8, number bool, symbol bool) (*Code, error)
	GenerateNewCodeFake(ctx context.Context)
	ValidateCode(ctx context.Context, c *Code) (IsValid, error)
}

type IsValid

type IsValid bool

type Message

type Message string

type MessageConfig

type MessageConfig struct {
	Medium            string
	From              string
	To                string
	Subject           string
	Message           string
	HasTemplate       bool
	TemplateID        string
	TemplateVariables map[string]string
}

type MessageService

type MessageService interface {
	SendMessage(ctx context.Context, mc *MessageConfig) error
	SendMessageFake(ctx context.Context)
}

type Product

type Product struct {
	ID         int64
	UUID       string      `json:"uuid"`
	Rate       float32     `json:"rate"`
	Pictures   []string    `json:"pictures"`
	Name       string      `json:"name"`
	Detail     string      `json:"detail"`
	Favorite   bool        `json:"favorite"`
	Attributes []Attribute `json:"attributes"`
}

type ProductRepository

type ProductRepository interface {
	GetByUUID(ctx context.Context, uuid string) (*Product, error)
}

type ProductUseCase

type ProductUseCase interface {
	Get(ctx context.Context, uuid string) (*Product, error)
}

type Token

type Token string

type TokenInfo

type TokenInfo struct {
	Info string
}

type TokenService

type TokenService interface {
	Sign(ctx context.Context, info TokenInfo, expirationInMinutes int64) (Token, error)
	IsValid(ctx context.Context, token Token) (IsValid, error)
}

type User

type User struct {
	ID          int64
	UUID        string      `json:"uuid"`
	Email       string      `json:"email"`
	FirstName   string      `json:"firstName"`
	LastName    string      `json:"lastName"`
	PhoneNumber string      `json:"phoneNumber"`
	Address     UserAddress `json:"address"`
}

type UserAddress

type UserAddress struct {
	City         string `json:"city"`
	State        string `json:"state"`
	Neighborhood string `json:"neighborhood"`
	Street       string `json:"street"`
	Number       string `json:"number"`
	ZipCode      string `json:"zipcode"`
}

type UserRepository

type UserRepository interface {
	GetByEmail(ctx context.Context, email string) (*User, error)
}

type UserValidator

type UserValidator interface {
	Validate(ctx context.Context, u *User) (IsValid, Message)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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