structs

package
v0.0.0-...-824ed62 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessCookieName  = "access-cookie"
	RefreshCookieName = "refresh-cookie"
)

Variables

View Source
var (
	ErrForeignViolation     = errors.New("wrong foreign key")
	ErrUniqueRestriction    = errors.New("violation of the database unique restriction")
	ErrNoRowAffected        = errors.New("no one row was affected")
	ErrNotFound             = errors.New("nothing was found")
	ErrCheckCaptcha         = errors.New("captha doesn't confirm the checking")
	ErrMailSending          = errors.New("error happaned while sendin email")
	ErrWrongBody            = errors.New("wrong body")
	ErrInvalidSigningMethod = errors.New("invalid signing metod")
	ErrWrongTokenClaimType  = errors.New("token claims are not of type *tokenClaims")
	ErrTimeout              = errors.New("timeout")
	ErrEmptyField           = errors.New("field shoud be not empty")
	ErrNotMatch             = errors.New("the pasword doesn't match")
	ErrNoSession            = errors.New("there is no such session")
)

Functions

func SHA256

func SHA256(password, salt string) string

Types

type Card

type Card struct {
	ID          uuid.UUID       `json:"id" db:"id" params:"id"`
	Title       string          `json:"title" db:"title"`
	Thumb       string          `json:"thumb" db:"thumb"`
	Alt         string          `json:"alt" db:"alt"`
	Description json.RawMessage `json:"description" db:"description"`
	Created     time.Time       `json:"created" db:"created"`
	Modified    time.Time       `json:"modified" db:"modified"`
}

type CardQueryParameters

type CardQueryParameters struct {
	Page  int `json:"page" query:"page"`
	Limit int `json:"limit" query:"limit"`
}

type CardsResponse

type CardsResponse struct {
	Code  int    `json:"code"`
	Total int    `json:"total"`
	Cards []Card `json:"cards"`
}

type Claims

type Claims struct {
	jwt.StandardClaims
	UserID string
}

type Contact

type Contact struct {
	Phone1 string `json:"phone1" db:"phone1"`
	Phone2 string `json:"phone2" db:"phone2"`
	Email  string `json:"email" db:"email"`
}

type Feedback

type Feedback struct {
	Name    string `json:"name"`
	Email   string `json:"email"`
	Comment string `json:"comment"`
	Token   string `json:"token"`
}

func (Feedback) Valiadate

func (f Feedback) Valiadate() error

type IdentityData

type IdentityData struct {
	Login    string `json:"login"`
	Password string `jsdon:"password"`
}

type Message

type Message struct {
	From     string
	To       string
	Subject  string
	BodyHTML []byte
	Buffer   *bytes.Buffer
}

func (*Message) AddBody

func (m *Message) AddBody(content string, contentType string)

func (*Message) SetHeader

func (m *Message) SetHeader(key, value string)

type Partner

type Partner struct {
	ID       uuid.UUID `json:"id" db:"id"`
	Alt      string    `json:"alt" db:"alt"`
	Thumb    string    `json:"thumb" db:"thumb"`
	Created  time.Time `json:"created" db:"created"`
	Modified time.Time `json:"modified" db:"modified"`
}

type PartnerQueryParameters

type PartnerQueryParameters struct {
	Limit int `json:"limit" query:"limit"`
	Page  int `json:"page" query:"page"`
}

type PartnerResponse

type PartnerResponse struct {
	Code     int       `json:"code"`
	Total    int       `json:"total"`
	Partners []Partner `json:"partners"`
}

type PasswordsContainer

type PasswordsContainer struct {
	CurrentPassword      string `json:"currentPassword"`
	NewPassword          string `json:"newPassword"`
	NewPasswordConfirmed string `json:"newPasswordConfirmed"`
}

func (PasswordsContainer) Validate

func (p PasswordsContainer) Validate() error

type ReportResponse

type ReportResponse struct {
	Code int    `json:"code"`
	File string `json:"file"`
}

type Response

type Response struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

func SetResponse

func SetResponse(code int, message string) Response

type Slide

type Slide struct {
	ID       uuid.UUID `json:"id" db:"id"`
	Title    string    `json:"title" db:"title"`
	Thumb    string    `json:"thumb" db:"thumb"`
	Alt      string    `json:"alt" db:"alt"`
	Created  time.Time `json:"created" db:"created"`
	Modified time.Time `json:"modified" db:"modified"`
}

type SliderResponse

type SliderResponse struct {
	Code   int     `json:"code"`
	Slider []Slide `json:"slider"`
}

type TokenPair

type TokenPair struct {
	AccessToken   string `json:"access_token"`
	AccessExpire  time.Time
	RefreshToken  string `json:"refresh_token"`
	RefresgExpire time.Time
}

Jump to

Keyboard shortcuts

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