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 创建海报
Click to show internal directories.
Click to hide internal directories.