hello

package
v0.0.0-...-f2c0506 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByeDecodeRequest

func ByeDecodeRequest(c context.Context, request *http.Request) (interface{}, error)

ByeDecodeRequest 解码 后封装至 EndPoint中定义的 Request格式中

func ByeDecodeResponseFunc

func ByeDecodeResponseFunc(c context.Context, res *http.Response) (response interface{}, err error)

ByeDecodeResponseFunc : 解密服务方传回的数据

func ByeEncodeRequestFunc

func ByeEncodeRequestFunc(c context.Context, request *http.Request, r interface{}) error

ByeEncodeRequestFunc : 处理请求数据符合服务方要求的数据

func ByeEncodeResponse

func ByeEncodeResponse(c context.Context, w http.ResponseWriter, response interface{}) error

ByeEncodeResponse sayEncodeResponse 通过响应封装成 EndPoint中定义的 Response结构体即可

func HelloDecodeRequest

func HelloDecodeRequest(c context.Context, request *http.Request) (interface{}, error)

HelloDecodeRequest 解码 后封装至 EndPoint中定义的 Request格式中

func HelloDecodeResponseFunc

func HelloDecodeResponseFunc(c context.Context, res *http.Response) (response interface{}, err error)

HelloDecodeResponseFunc HelloDecodeResponseFunc: 解密服务方传回的数据

func HelloEncodeRequestFunc

func HelloEncodeRequestFunc(c context.Context, request *http.Request, r interface{}) error

HelloEncodeRequestFunc HelloEncodeRequestFunc: 处理请求数据符合服务方要求的数据

func HelloEncodeResponse

func HelloEncodeResponse(c context.Context, w http.ResponseWriter, response interface{}) error

HelloEncodeResponse 通过响应封装成 EndPoint中定义的 Response结构体即可

func MakeServerEndPointBye

func MakeServerEndPointBye(s IServer) endpoint.Endpoint

MakeServerEndPointBye 这里创建构造函数 Bye方法的业务处理

func MakeServerEndPointHello

func MakeServerEndPointHello(s IServer) endpoint.Endpoint

MakeServerEndPointHello 这里创建 “构造函数“ hello方法的业务处理

Types

type ByeRequest

type ByeRequest struct {
	Name string `json:"name"`
}

ByeRequest 请求格式

type ByeResponse

type ByeResponse struct {
	Reply string `json:"reply"`
}

ByeResponse 响应格式

type HelloRequest

type HelloRequest struct {
	Name string `json:"name"`
}

HelloRequest 请求格式

type HelloResponse

type HelloResponse struct {
	Reply string `json:"reply"`
}

HelloResponse 响应格式

type IServer

type IServer interface {
	Hello(name string) string
	Bye(name string) string
}

type Request

type Request struct {
	Name string `json:"name"`
}

Request 请求格式

type Response

type Response struct {
	Reply string `json:"reply"`
}

Response 响应格式

type Server

type Server struct {
}

func (Server) Bye

func (s Server) Bye(name string) string

func (Server) Hello

func (s Server) Hello(name string) string

Jump to

Keyboard shortcuts

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