Documentation ¶
Index ¶
- Variables
- func ConstructKey(prefix, key string) string
- func CorsMiddleware() gin.HandlerFunc
- func ExtractTokenFromHeader(r *http.Request) string
- func GetPageNumber(page string) int
- func GetServerAddrs(addrs string) []string
- func InitLogger(mode string)
- func Join(strs ...string) string
- func LoggingMiddleware(logger HttpLogger) gin.HandlerFunc
- func MaxAllowed(n int64) gin.HandlerFunc
- type Closer
- type ErrResponse
- type GrpcServer
- type HttpLogger
- type HttpServer
- type IDGenerator
- type Pagination
- type Runner
- type Server
- type SuccessPagingResponse
- type SuccessResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidParam = errors.New("invalid parameter") ErrServer = errors.New("server error") )
View Source
var ( JWTAuthHeader = "Authorization" JaegerHeader = "Trace-Id" )
Functions ¶
func ConstructKey ¶
func CorsMiddleware ¶
func CorsMiddleware() gin.HandlerFunc
func ExtractTokenFromHeader ¶
func GetPageNumber ¶
func GetServerAddrs ¶
func InitLogger ¶
func InitLogger(mode string)
func LoggingMiddleware ¶
func LoggingMiddleware(logger HttpLogger) gin.HandlerFunc
func MaxAllowed ¶
func MaxAllowed(n int64) gin.HandlerFunc
Types ¶
type ErrResponse ¶
type GrpcServer ¶
type GrpcServer interface { Register() Run() GracefulStop() }
type HttpLogger ¶
func NewHttpLogger ¶
func NewHttpLogger() HttpLogger
type HttpServer ¶
type IDGenerator ¶
func NewIDGenerator ¶
func NewIDGenerator() (IDGenerator, error)
type Pagination ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GracefulShutdown ¶
type SuccessPagingResponse ¶
type SuccessPagingResponse[T any] struct { Success bool `json:"success" example:"true"` Data T `json:"data"` Pagination Pagination `json:"pagination"` }
type SuccessResponse ¶
Click to show internal directories.
Click to hide internal directories.