Documentation ¶
Index ¶
- func RequestFromServerContext(ctx context.Context) (*http.Request, bool)
- func SetOperation(ctx context.Context, op string)
- type Server
- type ServerOption
- func TLSConfig(c *tls.Config) ServerOption
- func WithAddress(addr string) ServerOption
- func WithEnableProfiling(profiling bool) ServerOption
- func WithMetric(metric metric.GinMetric) ServerOption
- func WithMiddlewares(middlewares []string) ServerOption
- func WithMode(mode string) ServerOption
- func WithServiceName(srvName string) ServerOption
- func WithTimeout(timeout time.Duration) ServerOption
- type Transport
- func (tr *Transport) Endpoint() string
- func (tr *Transport) Kind() transport.Kind
- func (tr *Transport) Operation() string
- func (tr *Transport) PathTemplate() string
- func (tr *Transport) ReplyHeader() transport.Header
- func (tr *Transport) Request() *http.Request
- func (tr *Transport) RequestHeader() transport.Header
- type Transporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestFromServerContext ¶
RequestFromServerContext returns request from context.
func SetOperation ¶
SetOperation sets the transport operation.
Types ¶
type Server ¶
wrapper for gin.Engine
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
type ServerOption ¶
type ServerOption func(*Server)
func WithAddress ¶
func WithAddress(addr string) ServerOption
func WithEnableProfiling ¶
func WithEnableProfiling(profiling bool) ServerOption
func WithMetric ¶ added in v0.0.3
func WithMetric(metric metric.GinMetric) ServerOption
func WithMiddlewares ¶
func WithMiddlewares(middlewares []string) ServerOption
func WithMode ¶
func WithMode(mode string) ServerOption
func WithServiceName ¶
func WithServiceName(srvName string) ServerOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ServerOption
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is an HTTP transport.
func (*Transport) PathTemplate ¶
PathTemplate returns the http path template.
func (*Transport) ReplyHeader ¶
ReplyHeader returns the reply header.
func (*Transport) RequestHeader ¶
RequestHeader returns the request header.
type Transporter ¶
type Transporter interface { transport.Transporter Request() *http.Request PathTemplate() string }
Transporter is http Transporter
Click to show internal directories.
Click to hide internal directories.