models

package
v0.0.0-...-7a8bbb0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 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 APIKey

type APIKey struct {
	AccessToken string             `bson:"access_token" json:"access_token"`
	UserID      primitive.ObjectID `bson:"user_id" json:"user_id"`
	AppName     string             `bson:"app_name" json:"app_name"`
}

type ApplicationData

type ApplicationData struct {
	AppName string `bson:"app_name" json:"app_name"`
}

func (*ApplicationData) Serialize

func (ad *ApplicationData) Serialize()

type Id

type Id struct {
	Id string `bson:"_id" json:"id"`
}

type LoginData

type LoginData struct {
	Email    string   `json:"email,omitempty" validate:"required"`
	Password string   `json:"password" validate:"required"`
	UserType UserType `bson:"user_type" json:"user_type"`
}

func (*LoginData) Serialize

func (ld *LoginData) Serialize()

type RequestData

type RequestData struct {
	AccessToken string `bson:"access_token" json:"access_token"`
}

type RetrievedKeys

type RetrievedKeys struct {
	Keys []APIKey `bson:"api_keys" json:"api_keys"`
}

func (*RetrievedKeys) AddItem

func (rk *RetrievedKeys) AddItem(item APIKey) []APIKey

type User

type User struct {
	Email        string             `bson:"email" json:"email,omitempty" validate:"required"`
	PasswordHash string             `bson:"password_hash" json:"password_hash" validate:"required"`
	CreatedAt    primitive.DateTime `bson:"created_at" json:"created_at" bson:"created_at"`
	UserType     UserType           `bson:"user_type" json:"user_type"`
}

func (*User) Serialize

func (u *User) Serialize()

type UserType

type UserType string
const (
	DEFAULT UserType = "default"
	ADMIN   UserType = "admin"
)

func (UserType) String

func (ut UserType) String() string

Jump to

Keyboard shortcuts

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