models

package
v0.0.0-...-a67f385 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id        int        `json:"id,omitempty" db:"id"`
	PublicId  uuid.UUID  `json:"public_id" db:"public_id"`
	Name      string     `json:"name" binding:"required"`
	Username  string     `json:"username" binding:"required"`
	Password  string     `json:"password,omitempty"`
	Token     string     `json:"token,omitempty"`
	Role      Role       `json:"role" db:"role"`
	CreatedAt *time.Time `json:"created_at" db:"created_at"`
}

type Event

type Event struct {
	Type  EventType
	Value interface{}
}

type EventType

type EventType string
const (
	EVENT_ACCOUNT_CREATED EventType = "auth.created"
	EVENT_ACCOUNT_UPDATED EventType = "auth.updated"
	EVENT_ACCOUNT_REMOVED EventType = "auth.removed"
)

type Role

type Role int
const (
	Employee Role = iota // TODO перевести все константы в верхний регистр
	Manager
	Accountant
	Admin
)

type SignInInput

type SignInInput struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

Jump to

Keyboard shortcuts

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