srv

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SERVICE_LRUCACHE = "lrucache"
	SERVICE_REDIS    = "redis"
	SERVICE_OSS      = "oss"
	SERVICE_MONGODB  = "mongodb"
	SERVICE_USER     = "uv-user"
)
View Source
const (
	ERRNO_OK              = 200
	ERRNO_NOT_FOUND       = 404
	ERRNO_INTERNAL_SERVER = 500
	ERRNO_INPUT_DATA      = 400
	ERRNO_INDEX_VALUE     = 600
	ERRNO_LOGIN           = 601
)

Variables

This section is empty.

Functions

func Reg

func Reg(s *G.Server)

Types

type UserService

type UserService struct {
	Prefix   string   `json:"prefix"`
	BasePath string   `json:"basePath"`
	Aid      int64    `json:"aid"`     //区域ID
	Nid      int64    `json:"nid"`     //节点ID
	Expires  int64    `json:"expires"` //过期秒数
	Db       string   `json:"db"`      // mongodb db
	Secret   string   `json:"secret"`  // secret
	IID      *iid.IID `json:"-"`
	// contains filtered or unexported fields
}

func GetUserService

func GetUserService(ctx micro.Context, name string) (*UserService, error)

func (*UserService) Config

func (s *UserService) Config() interface{}

* * 服务配置 *

func (*UserService) GetInfoDB

func (s *UserService) GetInfoDB(uid string) string

func (*UserService) GetUserDB

func (s *UserService) GetUserDB() string

func (*UserService) Name

func (s *UserService) Name() string

* * 服务名称 *

func (*UserService) NewID

func (s *UserService) NewID() string

func (*UserService) NewPassword

func (s *UserService) NewPassword() string

func (*UserService) OnInit

func (s *UserService) OnInit(ctx micro.Context) error

* * 初始化服务 *

func (*UserService) OnValid

func (s *UserService) OnValid(ctx micro.Context) error

* * 校验服务是否可用 *

func (*UserService) Recycle

func (s *UserService) Recycle()

func (*UserService) SecPassword

func (s *UserService) SecPassword(p string) string

Jump to

Keyboard shortcuts

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