pkg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Domain 服务
	Domain domain.Service
	// User 用户服务
	User user.Service
	// Application 应用
	Application application.Service
	// Token 令牌服务
	Token token.Service
	// Micro todo
	Micro micro.Service
	// Role 角色服务
	Role role.Service
	// Endpoint 端点服务
	Endpoint endpoint.Service
	// Policy 厕所里
	Policy policy.Service
	// Department 部分服务
	Department department.Service
)

Functions

func GetTokenFromContext

func GetTokenFromContext(r *http.Request) (*token.Token, error)

GetTokenFromContext 从上下文中获取Token

func InitService

func InitService() error

InitService 初始化所有服务

func InitV1HTTPAPI

func InitV1HTTPAPI(pathPrefix string, root router.Router) error

InitV1HTTPAPI 初始化API服务

func LoadedService

func LoadedService() []string

LoadedService 查询加载成功的服务

func NewInternalAuther

func NewInternalAuther() router.Auther

NewInternalAuther 内部使用的auther

func RegistryHTTPV1

func RegistryHTTPV1(name string, api HTTPAPI)

RegistryHTTPV1 注册HTTP服务

func RegistryService

func RegistryService(name string, svr Service)

RegistryService 服务实例注册

Types

type HTTPAPI

type HTTPAPI interface {
	Registry(router router.SubRouter)
	Config() error
}

HTTPAPI restful 服务

type Service

type Service interface {
	Config() error
}

Service 注册上的服务必须实现的方法

Jump to

Keyboard shortcuts

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