transport

package
v2.3.55 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

GENERATED BY 'T'ransport 'G'enerator. DO NOT EDIT.

Index

Constants

View Source
const (

	// Version defines the version of the JSON RPC implementation
	Version = "2.0"
)
View Source
const VersionTg = "v2.3.29"

Variables

View Source
var RequestCount = kitPrometheus.NewCounterFrom(stdPrometheus.CounterOpts{
	Help:      "Number of requests received",
	Name:      "count",
	Namespace: "service",
	Subsystem: "requests",
}, []string{"method", "service", "success"})
View Source
var RequestCountAll = kitPrometheus.NewCounterFrom(stdPrometheus.CounterOpts{
	Help:      "Number of all requests received",
	Name:      "all_count",
	Namespace: "service",
	Subsystem: "requests",
}, []string{"method", "service"})
View Source
var RequestLatency = kitPrometheus.NewSummaryFrom(stdPrometheus.SummaryOpts{
	Help:      "Total duration of requests in microseconds",
	Name:      "latency_microseconds",
	Namespace: "service",
	Subsystem: "requests",
}, []string{"method", "service", "success"})

Functions

func ExitOnError

func ExitOnError(log zerolog.Logger, err error, msg string)

func NewExampleRPC

func NewExampleRPC(svcExampleRPC interfaces.ExampleRPC) (srv *httpExampleRPC)

func NewUser

func NewUser(svcUser interfaces.User) (srv *httpUser)

func ServeMetrics

func ServeMetrics(log zerolog.Logger, address string)

Types

type ErrorHandler

type ErrorHandler func(err error) error

type ExampleRPCTest

type ExampleRPCTest func(ctx context.Context, arg0 int, arg1 string, opts ...interface{}) (ret1 int, ret2 string, err error)

type ExampleRPCTest2 added in v2.2.3

type ExampleRPCTest2 func(ctx context.Context, arg0 int, arg1 string, opts ...interface{}) (ret1 int, ret2 string, err error)

type Handler

type Handler = fiber.Handler
type Header struct {
	SpanKey       string
	SpanValue     interface{}
	RequestKey    string
	RequestValue  interface{}
	ResponseKey   string
	ResponseValue interface{}
	LogKey        string
	LogValue      interface{}
}

type HeaderHandler added in v2.1.4

type HeaderHandler func(value string) Header

type MiddlewareExampleRPC

type MiddlewareExampleRPC func(next interfaces.ExampleRPC) interfaces.ExampleRPC

type MiddlewareExampleRPCTest

type MiddlewareExampleRPCTest func(next ExampleRPCTest) ExampleRPCTest

type MiddlewareExampleRPCTest2 added in v2.2.3

type MiddlewareExampleRPCTest2 func(next ExampleRPCTest2) ExampleRPCTest2

type MiddlewareSetExampleRPC

type MiddlewareSetExampleRPC interface {
	Wrap(m MiddlewareExampleRPC)
	WrapTest(m MiddlewareExampleRPCTest)
	WrapTest2(m MiddlewareExampleRPCTest2)

	WithTrace()
	WithMetrics()
	WithLog()
}

type MiddlewareSetUser

type MiddlewareSetUser interface {
	Wrap(m MiddlewareUser)
	WrapGetUser(m MiddlewareUserGetUser)
	WrapCustomResponse(m MiddlewareUserCustomResponse)
	WrapCustomHandler(m MiddlewareUserCustomHandler)

	WithTrace()
	WithMetrics()
	WithLog()
}

type MiddlewareUser

type MiddlewareUser func(next interfaces.User) interfaces.User

type MiddlewareUserCustomHandler

type MiddlewareUserCustomHandler func(next UserCustomHandler) UserCustomHandler

type MiddlewareUserCustomResponse

type MiddlewareUserCustomResponse func(next UserCustomResponse) UserCustomResponse

type MiddlewareUserGetUser

type MiddlewareUserGetUser func(next UserGetUser) UserGetUser

type Option

type Option func(srv *Server)

func ExampleRPC

func ExampleRPC(svc *httpExampleRPC) Option

func MaxBatchSize added in v2.3.18

func MaxBatchSize(size int) Option

func MaxBatchWorkers added in v2.3.18

func MaxBatchWorkers(size int) Option

func MaxBodySize

func MaxBodySize(max int) Option

func ReadTimeout

func ReadTimeout(timeout time.Duration) Option

func Service

func Service(svc ServiceRoute) Option

func SetFiberCfg added in v2.1.4

func SetFiberCfg(cfg fiber.Config) Option

func SetReadBufferSize added in v2.1.4

func SetReadBufferSize(size int) Option

func Use

func Use(args ...interface{}) Option

func User

func User(svc *httpUser) Option

func WithHeader added in v2.1.4

func WithHeader(headerName string, handler HeaderHandler) Option

func WithRequestID added in v2.1.4

func WithRequestID(headerName string) Option

func WriteTimeout

func WriteTimeout(timeout time.Duration) Option

type Server

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

func New

func New(log zerolog.Logger, options ...Option) (srv *Server)

func (*Server) ExampleRPC

func (srv *Server) ExampleRPC() *httpExampleRPC

func (*Server) Fiber

func (srv *Server) Fiber() *fiber.App

func (*Server) ServeHealth

func (srv *Server) ServeHealth(address string, response interface{})

func (*Server) Shutdown

func (srv *Server) Shutdown()

func (*Server) TraceJaeger

func (srv *Server) TraceJaeger(serviceName string) *Server

func (*Server) TraceZipkin

func (srv *Server) TraceZipkin(serviceName string, zipkinUrl string) *Server

func (*Server) User

func (srv *Server) User() *httpUser

func (*Server) WithLog

func (srv *Server) WithLog() *Server

func (*Server) WithMetrics

func (srv *Server) WithMetrics() *Server

func (*Server) WithTrace

func (srv *Server) WithTrace() *Server

type ServiceRoute

type ServiceRoute interface {
	SetRoutes(route *fiber.App)
}

type UserCustomHandler

type UserCustomHandler func(ctx context.Context, arg0 int, arg1 string, opts ...interface{}) (err error)

type UserCustomResponse

type UserCustomResponse func(ctx context.Context, arg0 int, arg1 string, opts ...interface{}) (err error)

type UserGetUser

type UserGetUser func(ctx context.Context, cookie string, userAgent string) (user *types.User, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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