hapibase

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestToProto

func RequestToProto(r *http.Request) (*hapi.Request, error)

Types

type HApiBase

type HApiBase struct {
	module.ModuleBase
	// contains filtered or unexported fields
}

func (*HApiBase) GetType

func (this *HApiBase) GetType() string

func (*HApiBase) Init

func (this *HApiBase) Init(subclass app.IRPCModule, settings *conf.ModuleSettings, opts ...hapi.Option)

func (*HApiBase) OnDestroy

func (this *HApiBase) OnDestroy()

func (*HApiBase) OnInit

func (this *HApiBase) OnInit(settings *conf.ModuleSettings)

func (*HApiBase) Options

func (this *HApiBase) Options() hapi.Options

func (*HApiBase) RouterGroup

func (this *HApiBase) RouterGroup() *gin.RouterGroup

func (*HApiBase) Run

func (this *HApiBase) Run(closeSig chan bool)

func (*HApiBase) Version

func (this *HApiBase) Version() string

type HttpHandler

type HttpHandler struct {
	Opts hapi.Options
}

HttpHandler 网关handler

func NewHandler

func NewHandler(opts hapi.Options) *HttpHandler

NewHandler 创建常规http handler

func (*HttpHandler) ServeHTTP

func (h *HttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

API handler is the default handler which takes api.Request and returns api.Response

Jump to

Keyboard shortcuts

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