Documentation ¶
Index ¶
- Constants
- func CacheDel(ctx context.Context, id int64)
- func CacheGet(ctx context.Context, id int64) (map[string]string, error)
- func CacheSet(ctx context.Context, id int64)
- func Run()
- type Server
- func (s *Server) UserAdd(ctx context.Context, in *pb.UserBase) (out *pb.UserBase, outerr error)
- func (s *Server) UserDelete(ctx context.Context, in *pb.UserID) (out *pb.UserID, outerr error)
- func (s *Server) UserQueryAll(ctx context.Context, in *pb.UserAllOption) (*pb.UserAll, error)
- func (s *Server) UserQueryOne(ctx context.Context, in *pb.UserID) (out *pb.UserBase, outerr error)
- func (s *Server) UserUpdate(ctx context.Context, in *pb.UserBase) (out *pb.UserBase, outerr error)
- type User
Constants ¶
View Source
const ( KeyMaxExpire = 500 // 秒 AgainGetStopTime = 100 * time.Millisecond )
View Source
const ( SexMan = 1 SexWoman = 2 SexOther = 3 )
性别
View Source
const (
CacheIDPrefix = "ucid"
)
View Source
const (
SN = "srv-user" // 定义services名称
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct{}
func (*Server) UserDelete ¶
func (*Server) UserQueryAll ¶
func (*Server) UserQueryOne ¶
type User ¶
type User struct { ID int64 `json:"id" db:"id" valid:"int~用户id类型为int"` UserName string `json:"user_name" db:"user_name" valid:"required~用户名称必须存在"` Password string `json:"password" db:"password" valid:"required~密码必须存在"` Iphone string `json:"iphone" db:"iphone" valid:"required~手机号码必须存在"` Sex int32 `json:"sex" db:"sex" valid:"required~性别必须存在"` IsUsable int32 `json:"-" db:"is_usable"` Page utils.Page }
Click to show internal directories.
Click to hide internal directories.