models

package
v0.0.0-...-5ee8369 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 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 Book

type Book struct {
	ID       uuid.UUID `json:"id" bson:"id,omitempty"`
	ISBN     string    `json:"isbn" bson:"isbn,omitempty"`
	BookName string    `json:"name" bson:"name,omitempty"`
	Price    float64   `json:"price" bson:"price,omitempty"`
}

type Gender

type Gender int
const (
	Male Gender = iota
	Female
	Transgender
	PreferNotToSay
	Others = Transgender
)

func (Gender) String

func (i Gender) String() string

type User

type User struct {
	ID       uuid.UUID `json:"id" bson:"id,omitempty"`
	Username string    `json:"username" bson:"username,omitempty"`
	Password string    `json:"password" bson:"password,omitempty"`
	Role     UserRole  `json:"role" bson:"gender,omitempty"`
	Name     string    `json:"name" bson:"name,omitempty"`
	Age      int       `json:"age" bson:"age,omitempty"`
	Gender   Gender    `json:"gender" bson:"gender,omitempty"`
	Contact  string    `json:"contact" bson:"contact,omitempty"`
}

type UserRole

type UserRole int
const (
	Other UserRole = iota + 1
	Admin
	Regular
)

func (UserRole) EnumIndex

func (r UserRole) EnumIndex() int

EnumIndex - Creating common behavior - give the type a EnumIndex function

func (UserRole) String

func (r UserRole) String() string

String - Creating common behavior - give the type a String function

Jump to

Keyboard shortcuts

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