models

package
v0.0.0-...-e1bd9c8 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var User_Role_name = map[int32]string{
	0: "ROLE_USER",
	1: "ROLE_CONTENT_ADMIN",
	2: "ROLE_ADMIN",
}
View Source
var User_Role_value = map[string]int32{
	"ROLE_USER":          0,
	"ROLE_CONTENT_ADMIN": 1,
	"ROLE_ADMIN":         2,
}

Functions

This section is empty.

Types

type User

type User struct {
	ID        uint32 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	CreatedAt uint32 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt uint32 `protobuf:"varint,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	FirstName string `protobuf:"bytes,4,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	LastName  string `protobuf:"bytes,5,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
	// @inject_tag: gorm:"unique;not null"
	Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty" gorm:"unique;not null"`
	// @inject_tag: json:"-"
	Password string `protobuf:"bytes,7,opt,name=password,proto3" json:"-"`
	// @inject_tag: json:"role"
	Role                 User_Role `protobuf:"varint,8,opt,name=role,proto3,enum=models.User_Role" json:"role"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*User) BeforeCreate

func (u *User) BeforeCreate(scope *gorm.Scope) error

Add custom hooks here, e.g. for ORM

func (*User) BeforeUpdate

func (u *User) BeforeUpdate(scope *gorm.Scope) error

func (*User) Descriptor

func (*User) Descriptor() ([]byte, []int)

func (*User) GetCreatedAt

func (m *User) GetCreatedAt() uint32

func (*User) GetFirstName

func (m *User) GetFirstName() string

func (*User) GetID

func (m *User) GetID() uint32

func (*User) GetLastName

func (m *User) GetLastName() string

func (*User) GetPassword

func (m *User) GetPassword() string

func (*User) GetRole

func (m *User) GetRole() User_Role

func (*User) GetUpdatedAt

func (m *User) GetUpdatedAt() uint32

func (*User) GetUsername

func (m *User) GetUsername() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*User) XXX_Merge

func (dst *User) XXX_Merge(src proto.Message)

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

func (m *User) XXX_Unmarshal(b []byte) error

type User_Role

type User_Role int32
const (
	User_ROLE_USER          User_Role = 0
	User_ROLE_CONTENT_ADMIN User_Role = 1
	User_ROLE_ADMIN         User_Role = 2
)

func (User_Role) EnumDescriptor

func (User_Role) EnumDescriptor() ([]byte, []int)

func (User_Role) String

func (x User_Role) String() string

Jump to

Keyboard shortcuts

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