srv

package
v0.0.0-...-00fa1e9 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

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
	ERRNO_AGAIN           = 602
	ERRNO_NO_PERMISSION   = 603
	ERRNO_SIGN            = 604
	ERRNO_MEMBER          = 605
	ERRNO_APP_VER         = 606
)
View Source
const (
	SERVICE_SMTP  = "smtp"
	SERVICE_REDIS = "redis"
	SERVICE_HTTP  = "http"
	SERVICE_OSS   = "oss"
)
View Source
const (
	ROLE_OWNER      = "owner"
	ROLE_READ_WRITE = "readwrite"
	ROLE_READ_ONLY  = "readonly"
)
View Source
const (
	SERVICE_CONFIG = "abi-app-store"
)

Variables

This section is empty.

Functions

func IsErrno

func IsErrno(err error, errno int32) bool

Types

type App

type App struct {
	Id   string      `json:"id"`
	Info interface{} `json:"info,omitempty"`
}

type AppApproveTask

type AppApproveTask struct {
	Token       string `json:"token"`
	Id          string `json:"id"`
	ContainerId string `json:"containerId"`
}

type AppCreateTask

type AppCreateTask struct {
	Token string      `json:"token"`
	Info  interface{} `json:"info,omitempty"`
}

type AppGetTask

type AppGetTask struct {
	Token string `json:"token"`
	Id    string `json:"id"`
}

type AppMemberAddTask

type AppMemberAddTask struct {
	Token string `json:"token"`
	Id    string `json:"id"`
	Email string `json:"email"`
	Role  string `json:"role"`
}

type AppMemberRemoveTask

type AppMemberRemoveTask struct {
	Token string `json:"token"`
	Id    string `json:"id"`
	Email string `json:"email"`
}

type AppSetTask

type AppSetTask struct {
	Token string      `json:"token"`
	Id    string      `json:"id"`
	Info  interface{} `json:"info,omitempty"`
}

type AppUnapproveTask

type AppUnapproveTask struct {
	Token       string `json:"token"`
	Id          string `json:"id"`
	ContainerId string `json:"containerId"`
}

type AppVerDoneTask

type AppVerDoneTask struct {
	Token string      `json:"token"`
	Id    string      `json:"id"`
	Ver   string      `json:"ver"`
	Info  interface{} `json:"info,omitempty"`
}

type AppVerInfoGetTask

type AppVerInfoGetTask struct {
	Token string `json:"token"`
	Id    string `json:"id"`
	Ver   string `json:"ver"`
}

type AppVerUpResult

type AppVerUpResult struct {
	Url string `json:"url"`
}

type AppVerUpTask

type AppVerUpTask struct {
	Token   string `json:"token"`
	Id      string `json:"id"`
	Ver     string `json:"ver"`
	Ability string `json:"ability"`
}

type ConfigService

type ConfigService struct {
	Db             string `json:"db"`
	Collection     string `json:"collection"`
	Prefix         string `json:"prefix"`
	CodeLength     int    `json:"code-length"`
	EmailSubject   string `json:"email-subject"`
	EmailBody      string `json:"email-body"`
	EmailBodyType  string `json:"email-body-type"`
	EmailExpires   int    `json:"email-expires"`    //邮件超时时间(秒)
	EmailReExpires int    `json:"email-re-expires"` //重发邮件间隔时间(秒)
	EmailEnabled   bool   `json:"email-enabled"`
	TokenExpires   int    `json:"token-expires"`
	UserSvc        string `json:"user-svc"`
	CacheExpires   int    `json:"cache-expires"`
	AppUpExpires   int    `json:"app-up-expires"`
	AppGetExpires  int    `json:"app-get-expires"`
	// contains filtered or unexported fields
}

func GetConfigService

func GetConfigService(ctx micro.Context, name string) (*ConfigService, error)

func (*ConfigService) Config

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

* * 服务配置 *

func (*ConfigService) Name

func (s *ConfigService) Name() string

* * 服务名称 *

func (*ConfigService) NewCode

func (s *ConfigService) NewCode() string

func (*ConfigService) NewID

func (s *ConfigService) NewID(ctx micro.Context) string

func (*ConfigService) NewSecret

func (s *ConfigService) NewSecret() string

func (*ConfigService) NewToken

func (s *ConfigService) NewToken() string

func (*ConfigService) OnInit

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

* * 初始化服务 *

func (*ConfigService) OnValid

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

* * 校验服务是否可用 *

func (*ConfigService) Recycle

func (s *ConfigService) Recycle()

func (*ConfigService) Sign

func (s *ConfigService) Sign(secret string, data map[string]interface{}) string

type Container

type Container struct {
	Id     string      `json:"id"`
	Info   interface{} `json:"info,omitempty"`
	Ver    int         `json:"ver"`
	Secret string      `json:"secret"`
}

type ContainerAppGetResult

type ContainerAppGetResult struct {
	Info interface{} `json:"info,omitempty"`
	Url  string      `json:"url,omitempty"`
}

type ContainerAppGetTask

type ContainerAppGetTask struct {
	Id        string `json:"id"`
	Appid     string `json:"appid"`
	Ver       string `json:"ver"`
	Ability   string `json:"ability"`
	Sign      string `json:"sign"`
	Timestamp int64  `json:"timestamp"`
}

type ContainerCreateTask

type ContainerCreateTask struct {
	Token string      `json:"token"`
	Info  interface{} `json:"info"`
}

type ContainerGetTask

type ContainerGetTask struct {
	Token string `json:"token"`
	Id    string `json:"id"`
}

type ContainerInfoGetResult

type ContainerInfoGetResult struct {
	Info interface{} `json:"info,omitempty"`
	Ver  int         `json:"ver"`
}

type ContainerInfoGetTask

type ContainerInfoGetTask struct {
	Sign      string `json:"sign"`
	Id        string `json:"id"`
	Timestamp int64  `json:"timestamp"`
	Ver       int    `json:"ver"`
}

type ContainerMemberAddTask

type ContainerMemberAddTask struct {
	Token string `json:"token"`
	Id    string `json:"id"`
	Email string `json:"email"`
	Role  string `json:"role"`
}

type ContainerMemberRemoveTask

type ContainerMemberRemoveTask struct {
	Token string `json:"token"`
	Id    string `json:"id"`
	Email string `json:"email"`
}

type ContainerSetTask

type ContainerSetTask struct {
	Token  string      `json:"token"`
	Id     string      `json:"id"`
	Info   interface{} `json:"info"`
	Secret bool        `json:"secret"`
}

type LoginResult

type LoginResult struct {
	Token string `json:"token"`
	User  *User  `json:"user"`
}

type LoginTask

type LoginTask struct {
	Email string `json:"email"`
	Code  string `json:"code"`
}

type Member

type Member struct {
	Id   string `json:"id"`
	Role string `json:"role"`
}

type SendMailTask

type SendMailTask struct {
	Email string `json:"email"`
}

type Server

type Server struct {
}

func (*Server) AppApprove

func (s *Server) AppApprove(ctx micro.Context, task *AppApproveTask) (interface{}, error)

func (*Server) AppCreate

func (s *Server) AppCreate(ctx micro.Context, task *AppCreateTask) (*App, error)

func (*Server) AppGet

func (s *Server) AppGet(ctx micro.Context, task *AppGetTask) (*App, error)

func (*Server) AppMemberAdd

func (s *Server) AppMemberAdd(ctx micro.Context, task *AppMemberAddTask) (*Member, error)

func (*Server) AppMemberRemove

func (s *Server) AppMemberRemove(ctx micro.Context, task *AppMemberAddTask) (interface{}, error)

func (*Server) AppSet

func (s *Server) AppSet(ctx micro.Context, task *AppSetTask) (*App, error)

func (*Server) AppUnapprove

func (s *Server) AppUnapprove(ctx micro.Context, task *AppUnapproveTask) (interface{}, error)

func (*Server) AppVerDone

func (s *Server) AppVerDone(ctx micro.Context, task *AppVerDoneTask) (interface{}, error)

func (*Server) AppVerInfoGet

func (s *Server) AppVerInfoGet(ctx micro.Context, task *AppVerInfoGetTask) (interface{}, error)

func (*Server) AppVerUp

func (s *Server) AppVerUp(ctx micro.Context, task *AppVerUpTask) (*AppVerUpResult, error)

func (*Server) ContainerAppGet

func (s *Server) ContainerAppGet(ctx micro.Context, task *ContainerAppGetTask) (*ContainerAppGetResult, error)

func (*Server) ContainerCreate

func (s *Server) ContainerCreate(ctx micro.Context, task *ContainerCreateTask) (*Container, error)

func (*Server) ContainerGet

func (s *Server) ContainerGet(ctx micro.Context, task *ContainerGetTask) (*Container, error)

func (*Server) ContainerInfoGet

func (s *Server) ContainerInfoGet(ctx micro.Context, task *ContainerInfoGetTask) (*ContainerInfoGetResult, error)

func (*Server) ContainerMemberAdd

func (s *Server) ContainerMemberAdd(ctx micro.Context, task *ContainerMemberAddTask) (*Member, error)

func (*Server) ContainerMemberRemove

func (s *Server) ContainerMemberRemove(ctx micro.Context, task *ContainerMemberAddTask) (interface{}, error)

func (*Server) ContainerSet

func (s *Server) ContainerSet(ctx micro.Context, task *ContainerSetTask) (*Container, error)

func (*Server) Login

func (s *Server) Login(ctx micro.Context, task *LoginTask) (*LoginResult, error)

func (*Server) MailSend

func (s *Server) MailSend(ctx micro.Context, task *SendMailTask) (interface{}, error)

func (*Server) UserGet

func (s *Server) UserGet(ctx micro.Context, task *UserGetTask) (*User, error)

type User

type User struct {
	Id    string `json:"id"`
	Email string `json:"email"`
}

type UserGetTask

type UserGetTask struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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