xbgin

package
v0.0.0-...-bc7acb5 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraceMiddleware

func GraceMiddleware(ctx *Context)

func NoRouteHandler

func NoRouteHandler(ctx *Context)

func RecordMiddleware

func RecordMiddleware(ctx *Context)

func ResponseMiddleware

func ResponseMiddleware(ctx *Context)

Types

type APISIXFlow

type APISIXFlow struct {
	RESTFlow
}

func (*APISIXFlow) GetConsumerGroupID

func (flow *APISIXFlow) GetConsumerGroupID() string

func (*APISIXFlow) GetConsumerName

func (flow *APISIXFlow) GetConsumerName() string

func (*APISIXFlow) GetRequestID

func (flow *APISIXFlow) GetRequestID() string

func (*APISIXFlow) Initiate

func (flow *APISIXFlow) Initiate(ctx *Context)

func (*APISIXFlow) IsAnonymousRequest

func (flow *APISIXFlow) IsAnonymousRequest() bool

func (*APISIXFlow) IsAuthenticatedRequest

func (flow *APISIXFlow) IsAuthenticatedRequest() bool

func (*APISIXFlow) IsClientRequest

func (flow *APISIXFlow) IsClientRequest() bool

func (*APISIXFlow) IsExternalRequest

func (flow *APISIXFlow) IsExternalRequest() bool

func (*APISIXFlow) IsInternalRequest

func (flow *APISIXFlow) IsInternalRequest() bool

func (*APISIXFlow) IsMonitorRequest

func (flow *APISIXFlow) IsMonitorRequest() bool

func (*APISIXFlow) IsServiceRequest

func (flow *APISIXFlow) IsServiceRequest() bool

func (*APISIXFlow) IsUserRequest

func (flow *APISIXFlow) IsUserRequest() bool

type BaseFlow

type BaseFlow = xbflow.BaseFlow

type CORSConfig

type CORSConfig = cors.Config

type Context

type Context = gin.Context

type Engine

type Engine = gin.Engine

type Flow

type Flow = xbflow.Flow

type GraceMiddlewareFlow

type GraceMiddlewareFlow struct {
	MiddlewareFlow
}

func (*GraceMiddlewareFlow) NextFlow

func (flow *GraceMiddlewareFlow) NextFlow()

type Handler

type Handler = gin.HandlerFunc

type JSONResponse

type JSONResponse struct {
	Code int `json:"-"`
	Meta any `json:"meta"`
	Data any `json:"data"`
}

func NewJSONResponse

func NewJSONResponse(message *MetaMessage, data any, options *JSONResponseOptions) *JSONResponse

type JSONResponseBaseData

type JSONResponseBaseData = xbdata.JSONResponseBaseData

type JSONResponseMeta

type JSONResponseMeta = xbdata.JSONResponseMeta

type JSONResponseOptions

type JSONResponseOptions struct {
	HTTPCode *int
	MetaArgs []any
	PageData *JSONResponsePageData
}

type JSONResponsePageData

type JSONResponsePageData = xbdata.JSONResponsePageData

type JSONResponsePageMeta

type JSONResponsePageMeta = xbdata.JSONResponsePageMeta

type KongFlow

type KongFlow struct {
	RESTFlow
}

func (*KongFlow) GetConsumerCustomID

func (flow *KongFlow) GetConsumerCustomID() string

func (*KongFlow) GetConsumerGroups

func (flow *KongFlow) GetConsumerGroups() []string

func (*KongFlow) GetRequestID

func (flow *KongFlow) GetRequestID() string

func (*KongFlow) Initiate

func (flow *KongFlow) Initiate(ctx *Context)

func (*KongFlow) IsAnonymousRequest

func (flow *KongFlow) IsAnonymousRequest() bool

func (*KongFlow) IsAuthenticatedRequest

func (flow *KongFlow) IsAuthenticatedRequest() bool

func (*KongFlow) IsClientRequest

func (flow *KongFlow) IsClientRequest() bool

func (*KongFlow) IsExternalRequest

func (flow *KongFlow) IsExternalRequest() bool

func (*KongFlow) IsInternalRequest

func (flow *KongFlow) IsInternalRequest() bool

func (*KongFlow) IsMonitorRequest

func (flow *KongFlow) IsMonitorRequest() bool

func (*KongFlow) IsServiceRequest

func (flow *KongFlow) IsServiceRequest() bool

func (*KongFlow) IsUserRequest

func (flow *KongFlow) IsUserRequest() bool

type MetaMessage

type MetaMessage = xbmtmsg.MetaMessage

type MiddlewareFlow

type MiddlewareFlow struct {
	RESTFlow
}

func (*MiddlewareFlow) NextFlow

func (flow *MiddlewareFlow) NextFlow()

type RESTFlow

type RESTFlow struct {
	BaseFlow
	// contains filtered or unexported fields
}

func (*RESTFlow) BindBody

func (flow *RESTFlow) BindBody(value any)

func (*RESTFlow) BindHeaders

func (flow *RESTFlow) BindHeaders(value any)

func (*RESTFlow) BindParams

func (flow *RESTFlow) BindParams(value any)

func (*RESTFlow) BindQueries

func (flow *RESTFlow) BindQueries(value any)

func (*RESTFlow) ContainBody

func (flow *RESTFlow) ContainBody() bool

func (*RESTFlow) ContainData

func (flow *RESTFlow) ContainData() bool

func (*RESTFlow) ContainHeaders

func (flow *RESTFlow) ContainHeaders() bool

func (*RESTFlow) ContainParams

func (flow *RESTFlow) ContainParams() bool

func (*RESTFlow) ContainQueries

func (flow *RESTFlow) ContainQueries() bool

func (*RESTFlow) GetBody

func (flow *RESTFlow) GetBody() io.ReadCloser

func (*RESTFlow) GetContext

func (flow *RESTFlow) GetContext() *Context

func (*RESTFlow) GetHeader

func (flow *RESTFlow) GetHeader(key string) string

func (*RESTFlow) GetHeaderValues

func (flow *RESTFlow) GetHeaderValues() http.Header

func (*RESTFlow) GetMethod

func (flow *RESTFlow) GetMethod() string

func (*RESTFlow) GetParam

func (flow *RESTFlow) GetParam(key string) string

func (*RESTFlow) GetQuery

func (flow *RESTFlow) GetQuery(key string) string

func (*RESTFlow) GetQueryFallback

func (flow *RESTFlow) GetQueryFallback(key, fallback string) string

func (*RESTFlow) GetQueryMap

func (flow *RESTFlow) GetQueryMap(key string) map[string]string

func (*RESTFlow) GetQuerySlice

func (flow *RESTFlow) GetQuerySlice(key string) []string

func (*RESTFlow) GetQueryValues

func (flow *RESTFlow) GetQueryValues() url.Values

func (*RESTFlow) GetRequest

func (flow *RESTFlow) GetRequest() *http.Request

func (*RESTFlow) GetRequestIP

func (flow *RESTFlow) GetRequestIP() string

func (*RESTFlow) GetRequestURI

func (flow *RESTFlow) GetRequestURI() string

func (*RESTFlow) GetWriter

func (flow *RESTFlow) GetWriter() ResponseWriter

func (*RESTFlow) Inherit

func (flow *RESTFlow) Inherit(fore Flow)

func (*RESTFlow) Initiate

func (flow *RESTFlow) Initiate(context *Context)

func (*RESTFlow) IsDeleteMethod

func (flow *RESTFlow) IsDeleteMethod() bool

func (*RESTFlow) IsGetMethod

func (flow *RESTFlow) IsGetMethod() bool

func (*RESTFlow) IsHeadMethod

func (flow *RESTFlow) IsHeadMethod() bool

func (*RESTFlow) IsOptionsMethod

func (flow *RESTFlow) IsOptionsMethod() bool

func (*RESTFlow) IsPatchMethod

func (flow *RESTFlow) IsPatchMethod() bool

func (*RESTFlow) IsPostMethod

func (flow *RESTFlow) IsPostMethod() bool

func (*RESTFlow) IsPutMethod

func (flow *RESTFlow) IsPutMethod() bool

func (*RESTFlow) IsTraceMethod

func (flow *RESTFlow) IsTraceMethod() bool

func (*RESTFlow) RequireBody

func (flow *RESTFlow) RequireBody() any

func (*RESTFlow) RequireData

func (flow *RESTFlow) RequireData() []byte

func (*RESTFlow) RequireHeaders

func (flow *RESTFlow) RequireHeaders() any

func (*RESTFlow) RequireParams

func (flow *RESTFlow) RequireParams() any

func (*RESTFlow) RequireQueries

func (flow *RESTFlow) RequireQueries() any

func (*RESTFlow) RespondFile

func (flow *RESTFlow) RespondFile(path string)

func (*RESTFlow) RespondJSON

func (flow *RESTFlow) RespondJSON(message *MetaMessage, data any, options *JSONResponseOptions)

func (*RESTFlow) SetError

func (flow *RESTFlow) SetError(err error)

func (*RESTFlow) SetHeader

func (flow *RESTFlow) SetHeader(key, value string)

func (*RESTFlow) SetNotFoundError

func (flow *RESTFlow) SetNotFoundError()

type RecordMiddlewareFlow

type RecordMiddlewareFlow struct {
	MiddlewareFlow
	// contains filtered or unexported fields
}

func (*RecordMiddlewareFlow) Initiate

func (flow *RecordMiddlewareFlow) Initiate(ctx *Context)

func (*RecordMiddlewareFlow) SetBodies

func (flow *RecordMiddlewareFlow) SetBodies()

func (*RecordMiddlewareFlow) SetFields

func (flow *RecordMiddlewareFlow) SetFields()

func (*RecordMiddlewareFlow) SetResult

func (flow *RecordMiddlewareFlow) SetResult()

type ResponseMiddlewareFlow

type ResponseMiddlewareFlow struct {
	MiddlewareFlow
}

func (*ResponseMiddlewareFlow) SetResult

func (flow *ResponseMiddlewareFlow) SetResult()

type ResponseWriter

type ResponseWriter = gin.ResponseWriter

type Router

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

func NewRouter

func NewRouter() *Router

func (*Router) GetCORSConfig

func (router *Router) GetCORSConfig() *CORSConfig

func (*Router) GetEngine

func (router *Router) GetEngine() *Engine

func (*Router) NewMiddlewares

func (router *Router) NewMiddlewares() []Handler

func (*Router) SetMiddlewares

func (router *Router) SetMiddlewares(handlers ...Handler)

func (*Router) SetRouterGroup

func (router *Router) SetRouterGroup(stems ...RouterStem)

func (*Router) UseMiddlewares

func (router *Router) UseMiddlewares()

type RouterGroup

type RouterGroup = gin.RouterGroup

type RouterLeaf

type RouterLeaf struct {
	Method   string
	Path     string
	Handlers []Handler
}

type RouterStem

type RouterStem struct {
	Path     string
	Handlers []Handler
	Leaves   []RouterLeaf
	Stems    []RouterStem
}

Jump to

Keyboard shortcuts

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