data

package
v0.0.0-...-9126271 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: MIT, MIT Imports: 12 Imported by: 0

README

Data

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is data providers.

Functions

func NewDB

func NewDB(conf *conf.Data, logger log.Logger) *gorm.DB

func NewGreeterRepo

func NewGreeterRepo(data *Data, logger log.Logger) biz.GreeterRepo

NewGreeterRepo .

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data .

func NewData

func NewData(c *conf.Data, logger log.Logger) (*Data, func(), error)

NewData .

func (*Data) GetDBIns

func (d *Data) GetDBIns() *gorm.DB

type User

type User struct {
	// Standard object's metadata
	metadata.ObjectMeta `json:"metadata,omitempty"`

	Status int `json:"ID" `

	// Required: true
	Nickname string `json:"nickname" gorm:"column:nickname" validate:"required,min=1,max=30"`

	// Required: true
	Password string `json:"password,omitempty" gorm:"column:password" validate:"required"`

	// Required: true
	Email string `json:"email" gorm:"column:email" validate:"required,email,min=1,max=100"`

	Phone string `json:"phone" gorm:"column:phone" validate:"omitempty"`

	IsAdmin int `json:"isAdmin,omitempty" gorm:"column:isAdmin" validate:"omitempty"`

	TotalPolicy int64 `json:"totalPolicy" gorm:"-" validate:"omitempty"`

	LoginedAt time.Time `json:"loginedAt,omitempty" gorm:"column:loginedAt"`
}

User is a user model. It is also used as gorm model.

type UserList

type UserList struct {

	// Standard list metadata.
	// +optional
	metadata.ListMeta `json:",inline"`

	Items []*User `json:"items"`
}

UserList is the whole list of all users which have been stored in storage.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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