entities

package
v0.0.0-...-f348597 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TOKEN_BYTES_LENGTH = 32
View Source
const TOKEN_LENGTH = 64

Variables

View Source
var (
	ErrEntityNotFound = errors.New("Entity wasn't found")
	ErrEntityExists   = errors.New("Entity already exist")
)
View Source
var (
	ErrLoginTaken  = errors.New("Login is already taken")
	ErrNoChange    = errors.New("No changes")
	ErrBanYourself = errors.New("You cannot ban yourself")
)
View Source
var (
	ErrTokenLen = fmt.Errorf("Token length should be equal to %d", TOKEN_LENGTH)
)

Functions

This section is empty.

Types

type Creds

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

type Session

type Session struct {
	SID       uuid.UUID `json:"sessionID"`
	UID       uuid.UUID `json:"usrID"`
	CreatedAt int64     `json:"createdAt"`
	DeviceInf string    `json:"deviceInf"`
	CreatorIP string    `json:"creatorIP"`
}

type User

type User struct {
	ID        uuid.UUID         `json:"id"`
	Username  username.Username `jsom:"username"`
	Login     string            `json:"login"`
	Name      string            `json:"name"`
	CreatedAt time.Time
}

type UserCreationOpts

type UserCreationOpts struct {
	Name string
	Creds
}

type UserWithoutLogin

type UserWithoutLogin struct {
	ID        uuid.UUID `json:"id"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"createdAt"`
}

Jump to

Keyboard shortcuts

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