SexModel

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	SexDB.Model
	Street string `json:"street,omitempty"`
	State  string `json:"state,omitempty"`
	Number string `json:"number,omitempty"`
	Code   string `json:"cep,omitempty"`
	City   string `json:"city,omitempty"`
	Neigh  string `json:"neighborhood,omitempty"`
	Compl  string `json:"complement,omitempty" gorm:"default:NULL"`
}

Sex Address Template

func (*Address) FromPostalCode

func (model *Address) FromPostalCode(cep string) *Address

Function to search location info by CEP

func (Address) TableName

func (m Address) TableName() string

type Event

type Event struct {
	SexDB.Model
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`

	AddrId uint    `json:"-"`
	Addr   Address `json:"address,omitempty" gorm:"-"`

	BeginAt time.Time `json:"begin,omitempty"`
	EndAt   time.Time `json:"end,omitempty"`
}

Sex Event Template

func (Event) TableName

func (m Event) TableName() string

type Role

type Role struct {
	SexDB.Model
	Name string `json:"name,omitempty" gorm:"unique"`
	Desc string `json:"desc,omitempty" gorm:"unique"`
}

Sex Role Template

func (Role) TableName

func (m Role) TableName() string

type Token

type Token struct {
	SexDB.Model
	ID string `json:"token,omitempty" gorm:"PrimaryKey, NOT NULL"`

	UserId uint `json:"-" gorm:"index,NOT NULL"`
}

Sex User Token Template

func (Token) TableName

func (m Token) TableName() string

type User

type User struct {
	SexDB.Model

	Email    string    `json:"email,omitempty" gorm:"unique,default:null"`
	Name     string    `json:"name,omitempty" gorm:"index"`
	Born     time.Time `json:"born_date,omitempty" gorm:"index"`
	Genre    string    `json:"genre,omitempty" gorm:"default:'male'"`
	PassHash string    `json:"-"`
}

Sex User Template

func (*User) CheckPass

func (model *User) CheckPass(s string) bool

Function to validate User password

func (*User) SetPass

func (model *User) SetPass(s string) (string, error)

Function to encode User password

func (User) TableName

func (m User) TableName() string

Jump to

Keyboard shortcuts

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