transport

package
v0.0.0-...-5b0cbe9 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultReadTimeout 请求超时
	DefaultReadTimeout = 10
	// DefaultWriteTimeout 响应超时
	DefaultWriteTimeout = 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCTransport

type GRPCTransport struct {
	// contains filtered or unexported fields
}

GRPCTransport 提供grpc服务生成海报

func NewGRPCTransport

func NewGRPCTransport(cfg *config.GRPCConfig) *GRPCTransport

NewGRPCTransport 创建grpc接口对象

func (*GRPCTransport) ListenAndServe

func (s *GRPCTransport) ListenAndServe(debug bool) (err error)

ListenAndServe 监听启动服务

type HTTPTransport

type HTTPTransport struct {
	// contains filtered or unexported fields
}

HTTPTransport 提供http服务生成海报

func NewHTTPTransport

func NewHTTPTransport(cfg *config.HTTPConfig) *HTTPTransport

NewHTTPTransport 创建http接口对象

func (*HTTPTransport) ListenAndServe

func (s *HTTPTransport) ListenAndServe(debug bool) (err error)

ListenAndServe 监听启动服务

type PosterServer

type PosterServer struct {
}

PosterServer 实现grpc服务接口

func (*PosterServer) CreatePoster

func (ps *PosterServer) CreatePoster(ctx context.Context, req *proto.CreatePosterRequest) (rsp *proto.CreatePosterReply, err error)

CreatePoster 创建海报

Jump to

Keyboard shortcuts

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