httpnet

package module
v0.0.0-...-7b0e155 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Authorization = "Authorization"
	TokenKey      = "client_id"
)

Variables

This section is empty.

Functions

func IndentedJSON

func IndentedJSON(c *gin.Context, err error, data interface{})

func WrapHandler

func WrapHandler(handler func(c *gin.Context) (interface{}, error)) func(*gin.Context)

Types

type APIHandler

type APIHandler interface {
	Handle(IRouter)
}

type IRouter

type IRouter = gin.IRouter

type Option

type Option func(*config)

func WithName

func WithName(name string) Option

func WithPrefix

func WithPrefix(prefix string) Option

func WithSwagger

func WithSwagger(swaggerUrl string) Option

func WithTLS

func WithTLS(key, cert string) Option

type Server

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

func NewServer

func NewServer(addr string, opts ...Option) *Server

func (*Server) AddHandler

func (s *Server) AddHandler(handler APIHandler)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Run

func (s *Server) Run()

func (*Server) Use

func (s *Server) Use(middleware ...gin.HandlerFunc)

Directories

Path Synopsis
middleware
jwt

Jump to

Keyboard shortcuts

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