service

package
v0.0.0-...-31e44ea Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ContextReqUUid = "req_uuid"

ContextReqUUid 请求UUID

Variables

This section is empty.

Functions

This section is empty.

Types

type Add

type Add struct {
	A int `json:"a"` // 第一个数
	B int `json:"b"` // 第二个数
}

Add 加法结构体

type AddAck

type AddAck struct {
	Res int `json:"res"` // 结果
}

AddAck 结果

type Login

type Login struct {
	Account  string `json:"account"`
	Password string `json:"password"`
}

Login 登录请求

type LoginAck

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

LoginAck 登录响应

type NewMiddlewareServer

type NewMiddlewareServer func(Service) Service

NewMiddlewareServer 创建中间件服务的方法

func NewLogMiddlewareServer

func NewLogMiddlewareServer(log *zap.Logger) NewMiddlewareServer

NewLogMiddlewareServer 创建日志中间件服务 @param log zap日志对象

type Service

type Service interface {
	// TestAdd 加法
	TestAdd(ctx context.Context, in Add) AddAck

	// Login 登录
	Login(ctx context.Context, in Login) (ack LoginAck, err error)
}

TestAdd 服务接口

func NewService

func NewService(log *zap.Logger) Service

NewService 创建服务 @param log zap日志对象

Jump to

Keyboard shortcuts

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