model

package
v0.0.0-...-aecb27a Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ChatStatusActive = "active"
View Source
const ChatStatusCreated = "created"
View Source
const ChatStatusInactive = "inactive"
View Source
const RolAdmin = "admin"
View Source
const RolUser = "user"

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	Owner string `json:"owner"`
}

ACL s

type Chat

type Chat struct {
	ID        int       `xorm:"id BIGSERIAL not null autoincr pk" valid:""                     json:"id"`
	UserID    int       `xorm:"user_id BIGINT not null"           valid:"required"             json:"user_id"`
	Name      string    `xorm:"name varchar(50) not null"         valid:"required,name"        json:"name"`
	Code      string    `xorm:"code varchar(50) not null index"   valid:"required"             json:"code"`
	Status    string    `xorm:"status varchar(50) not null"       valid:"required,chat_status" json:"status"`
	ACL       *ACL      `xorm:"acl json not null"                 valid:"required"             json:"-"`
	CreatedAt time.Time `xorm:"created_at created"                                             json:"-"`
	UpdatedAt time.Time `xorm:"updated_at updated"                                             json:"-"`
	DeletedAt time.Time `xorm:"deleted_at deleted"                                             json:"-"`
	Version   int       `xorm:"version version"                                                json:"-"`
}

Chat s

func (*Chat) Check

func (u *Chat) Check() error

Check s

func (*Chat) TableName

func (u *Chat) TableName() string

TableName s

type Group

type Group struct {
	ID        int       `xorm:"id BIGSERIAL not null autoincr pk" valid:""`
	Name      string    `xorm:"name varchar(50) not null"         valid:"required,name"`
	Code      string    `xorm:"code varchar(50) not null"         valid:"required"`
	ACL       *ACL      `xorm:"acl json not null"                 valid:"required"`
	CreatedAt time.Time `xorm:"created_at created"`
	UpdatedAt time.Time `xorm:"updated_at updated"`
	Version   int       `xorm:"version version"`
}

func (*Group) TableName

func (u *Group) TableName() string

TableName s

type Message

type Message struct {
	ID        *primitive.ObjectID `json:"id"         bson:"_id"`
	Message   string              `json:"message"    bson:"message"`
	From      int                 `json:"from"       bson:"from"`
	FromName  string              `json:"from_name"  bson:"from_name"`
	CreatedAt *time.Time          `json:"created_at" bson:"created_at"`
}

type Model

type Model interface {
	TableName() string
	Check() error
}

Model s

type Notification

type Notification struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload"`
}

type NotificationType

type NotificationType string
var NotificationError NotificationType = "error"
var NotificationEvent NotificationType = "event"
var NotificationMessage NotificationType = "message"

type Rol

type Rol string

type User

type User struct {
	ID            int       `xorm:"id BIGSERIAL not null autoincr pk"         valid:""`
	Username      string    `xorm:"username varchar(20) not null unique"      valid:"username,required"`
	Email         string    `xorm:"email varchar(200) not null unique"        valid:"email,required"`
	Name          string    `xorm:"name varchar(50) not null"                 valid:"name,required"`
	LastName      string    `xorm:"lastname varchar(50) not null"             valid:"name,required"`
	DateBirth     time.Time `xorm:"date_birth DATE"                           valid:""`
	ImgSrc        string    `xorm:"imgSrc text"                               valid:""`
	Country       string    `xorm:"country varchar(2)"                        valid:""`
	Nationality   string    `xorm:"nationality varchar(2)"                    valid:""`
	Facebook      string    `xorm:"facebook varchar(255)"                     valid:""`
	Linkedin      string    `xorm:"linkedin varchar(255)"                     valid:""`
	Password      string    `xorm:"password varchar(100) not null"            valid:""            `
	ValidPassword string    `xorm:"-"                                         valid:"password"    json:"-"`
	RecoveryToken string    `xorm:"recovery_token varchar(100) not null"      valid:""            json:"-"`
	ACL           *ACL      `xorm:"acl json not null"                         valid:"required"    json:"-"`
	CreatedAt     time.Time `xorm:"created_at created"                        valid:""            json:"-"`
	UpdatedAt     time.Time `xorm:"updated_at updated"                        valid:""            json:"-"`
	Version       int       `xorm:"version version"                           valid:""            json:"-"`
}

User s

func (*User) Check

func (u *User) Check() error

Check s

func (*User) MarshalJSON

func (u *User) MarshalJSON() ([]byte, error)

MarshalJSON s

func (*User) SetPassword

func (u *User) SetPassword(password string) error

SetPassword s

func (*User) TableName

func (u *User) TableName() string

TableName s

func (*User) UnmarshalJSON

func (that *User) UnmarshalJSON(b []byte) error

UnmarshalJSON s

Jump to

Keyboard shortcuts

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