Skip to content

Import path: gitlab.soludian.com/soludian/fountain/libs/fnet/fhttp

fhttp

go
import "gitlab.soludian.com/soludian/fountain/libs/fnet/fhttp"

Index

Constants

go
const (
    // HeaderAcceptEncoding ...
    HeaderAcceptEncoding = "Accept-Encoding"
    // HeaderContentType ...
    HeaderContentType = "Content-Type"
    // HeaderGRPCPROXYError ...
    HeaderGRPCPROXYError = "GRPC-Proxy-Error"

    // MIMEApplicationJSON ...
    MIMEApplicationJSON = "application/json"
    // MIMEApplicationJSONCharsetUTF8 ...
    MIMEApplicationJSONCharsetUTF8 = MIMEApplicationJSON + "; " + charsetUTF8
    // MIMEApplicationProtobuf ...
    MIMEApplicationProtobuf = "application/protobuf"
)

go
const KDefaultCookieName = "cookie:fountain-session"

go
const KDefaultCookieSecret = "b2tlbGEtZW5jcnlwdC1zZWNyZXQtY29va2llcy1rZXk="

go
const (
    KPackageName = "fhttp"
)

Variables

CopyContextToFiberContext copies the values of context.Context to a fasthttp.RequestCtx

go
var CopyContextToFiberContext = adaptor.CopyContextToFiberContext

go
var DefaultHTTPClient = &http.Client{
    Timeout: 30 * time.Second,
    Transport: &http.Transport{
        MaxIdleConns:    50,
        MaxConnsPerHost: 50,
    },
}

FiberApp wraps fiber app to net/http handler func

go
var FiberApp = adaptor.FiberApp

FiberHandler wraps fiber handler to net/http handler

go
var FiberHandler = adaptor.FiberHandler

FiberHandlerFunc wraps fiber handler to net/http handler func

go
var FiberHandlerFunc = adaptor.FiberHandlerFunc

GetClientIP lấy địa chỉ IP thực tế của client từ HTTP request context. Hàm này tuân theo thứ tự ưu tiên để xác định địa chỉ IP đáng tin cậy nhất:

  1. CF-Connecting-IP header (IP thực của client từ Cloudflare) 2. X-Forwarded-For header (lấy IP đầu tiên từ danh sách phân cách bằng dấu phẩy) 3. X-Real-IP header (thường được set bởi Nginx) 4. Fallback về ctx.IP() (phương thức phát hiện IP built-in của Fiber)

Tham số:

  • ctx: fiber.Ctx - Context của Fiber chứa HTTP request

Trả về:

  • string: Địa chỉ IP của client dưới dạng chuỗi

Lưu ý: Tất cả giá trị header đều được trim khoảng trắng trước khi trả về. Hàm này được thiết kế để hoạt động sau proxy và load balancer.

Usage:

app.Get("/api/user", func(c fiber.Ctx) error {
    clientIP := fhttp.GetClientIP(c)
    log.Printf("Request từ IP: %s", clientIP)
    return c.JSON(fiber.Map{"client_ip": clientIP})
})

// Hoặc sử dụng hàm wrapper IP()
clientIP := fhttp.IP(c)
fmt.Printf("Client IP: %s", clientIP)
go
var GetClientIP = middleware.GetClientIP

go
var GetFountainInstance = Lib.GetFountainInstance

go
var GetFountainManager = Lib.GetFountainManager

HTTPHandler wraps net/http handler to fiber handler

go
var HTTPHandler = adaptor.HTTPHandler

HTTPHandlerFunc wraps net/http handler func to fiber handler

go
var HTTPHandlerFunc = adaptor.HTTPHandlerFunc

HTTPMiddleware wraps net/http middleware to fiber middleware

go
var HTTPMiddleware = adaptor.HTTPMiddleware

IP lấy địa chỉ IP thực tế của client từ HTTP request context. Hàm này tuân theo thứ tự ưu tiên để xác định địa chỉ IP đáng tin cậy nhất:

  1. CF-Connecting-IP header (IP thực của client từ Cloudflare) 2. X-Forwarded-For header (lấy IP đầu tiên từ danh sách phân cách bằng dấu phẩy) 3. X-Real-IP header (thường được set bởi Nginx) 4. Fallback về ctx.IP() (phương thức phát hiện IP built-in của Fiber)

Tham số:

  • ctx: fiber.Ctx - Context của Fiber chứa HTTP request

Trả về:

  • string: Địa chỉ IP của client dưới dạng chuỗi

Lưu ý: Tất cả giá trị header đều được trim khoảng trắng trước khi trả về. Hàm này được thiết kế để hoạt động sau proxy và load balancer.

Usage:

app.Get("/api/user", func(c fiber.Ctx) error {
    clientIP := fhttp.GetClientIP(c)
    log.Printf("Request từ IP: %s", clientIP)
    return c.JSON(fiber.Map{"client_ip": clientIP})
})

// Hoặc sử dụng hàm wrapper IP()
clientIP := fhttp.IP(c)
fmt.Printf("Client IP: %s", clientIP)
go
var IP = GetClientIP

Sử dụng khi config instance ở dạng key:value; Nếu config instance ở dạng key:array thì sử dụng hàm InstallFountainInstances Nếu config ở dạng key:array thì sẽ chỉ install config phần tử đầu tiên mà thôi

Install with config format <key>:<value>; eg: fhttp:<value>

Usage:

config.yaml:

	fhttp:
	  name: default_name
	  ...

	code.go

	fhttp.InstallFountainInstance()

 fhttp.WithConfigKey("fhttp").InstallFountainInstance()
go
var InstallFountainInstance = Lib.InstallFountainInstance

Sử dụng khi config instance ở dạng key:array<value>; Sẽ luôn cố gắng khởi tạo kể cả khi config ở dạng key:value

Install with config format <key>:array<value>; eg: fhttp:array<value>

Usage:

config.yaml:

fhttp:
  - name: default_name
    ...

code.go

fhttp.InstallFountainInstances()

fhttp.WithConfigKey("fhttp").InstallFountainInstances()
go
var InstallFountainInstances = Lib.InstallFountainInstances

go
var KDefaultServerName = env.GetFullAppService(KPackageName)

Truy cập thẳng tới bộ quản lý thư viện

go
var Lib = lib_3rd.NewLib(newServer, lib_3rd.WithDefaultConfigFunc[config, Server](DefaultConfig))

Copy and modify from "github.com/gofiber/fiber/v3/middleware/timeout"; The handler h must return error; DO NOT USER CTX WRITE

Usage:

var h = func(ctx *fiber.Ctx) error {
// Heavy logic with err from timeoutContext
// DO NOT USE: fhttp.Write... or ctx.Send...
    return err
}

app := fhttp.GetFountainInstance()
app.Get("/longtime", middleware.TimeoutMiddleware(h, 2*time.Second))
go
var TimeoutMiddleware = middleware.TimeoutMiddleware(WriteError)

go
var WithConfigKey = Lib.WithConfigKey

func AddFiberConfigs

go
func AddFiberConfigs(fiberConfigs ...fiber.Config) lib_3rd.Option[config]

func AddTrustedCloudflareIPs

go
func AddTrustedCloudflareIPs(ips ...string) lib_3rd.Option[config]

func BodyToContext

go
func BodyToContext(c fiber.Ctx) error

Parse all data from body and set all into context

func CreateCookie

go
func CreateCookie(ctx fiber.Ctx, domain, name, value string, expires time.Time, opts ...CookieOption)

CreateCookie set cookie với security defaults — HTTPOnly=true, Secure=prod, SameSite=Lax, Path="/". Phù hợp cho auth-token / session cookie. Dùng CookieOption để override default khi cần.

# Auth cookie cơ bản:
fhttp.CreateCookie(c, "", "__ac_tk", token, time.Now().Add(24*time.Hour))

# Cookie cho JS (vd locale):
fhttp.CreateCookie(c, "", "lang", "vi", time.Now().Add(365*24*time.Hour),
    fhttp.WithCookieHTTPOnly(false),
)

func DataToContext

go
func DataToContext(reqParams ...ReqParam) func(c fiber.Ctx) error

Set data{Name, DefaultValue} to context

func DeleteCookie

go
func DeleteCookie(ctx fiber.Ctx, domain, name string, opts ...CookieOption)

DeleteCookie xoá cookie bằng cách set Expires về quá khứ + MaxAge âm. Browser drop ngay. Cookie attributes khác (Path/Domain/Secure/SameSite) PHẢI khớp với cookie ban đầu — nếu không browser sẽ giữ cookie cũ. Truyền cùng các CookieOption mà CreateCookie đã dùng.

func FormRequest

go
func FormRequest(endpoint string, request any, encoder Encoder, authFn any) (*http.Request, error)

func GRPCProxy

go
func GRPCProxy(h any) fiber.Handler

GRPCProxy experimental

func GetQueryOffsetLimit

go
func GetQueryOffsetLimit(ctx fiber.Ctx, defaultLimit ...int) (offset, limit int)

Cố gắng tìm kiếm các cặp query {offset, limit} hoặc {page, page_size} để tạo offset và limit Ưu tiên sử dụng {page, page_size} trước tiên

func HTTPWriteError

go
func HTTPWriteError(w http.ResponseWriter, err *froto.RpcError) error

*

  • Returns an error response

func HTTPWriteErrorWithExtend

go
func HTTPWriteErrorWithExtend(w http.ResponseWriter, err *froto.RpcError, extend map[froto.Constructor]froto.ObjectInf) error

*

  • Returns a success response

func HTTPWriteSuccess

go
func HTTPWriteSuccess(w http.ResponseWriter, v any) error

*

  • Returns a success response

func HTTPWriteSuccessEmptyContent

go
func HTTPWriteSuccessEmptyContent(w http.ResponseWriter) error

*

  • Returns a success response without content

func HTTPWriteSuccessWithExtend

go
func HTTPWriteSuccessWithExtend(w http.ResponseWriter, data any, extend map[froto.Constructor]froto.ObjectInf) error

*

  • Returns a success response

func HasAuxiliaryServer

go
func HasAuxiliaryServer() bool

func HeaderToMetadataIncoming

go
func HeaderToMetadataIncoming(c fiber.Ctx) error

Middleware này sẽ được protoc-gen-fhttp tự động thêm vào các route được tạo ra từ file proto

func HttpRequest

go
func HttpRequest[T any](client *http.Client, req *http.Request, response T) error

func NewFErrorResponse

go
func NewFErrorResponse(err *froto.RpcError) (string, *froto.RpcError)

func ParamToBody

go
func ParamToBody(reqParams ...ReqParam) func(c fiber.Ctx) error

Parse data from param and set all into body

func ParamToContext

go
func ParamToContext(reqParams ...ReqParam) func(c fiber.Ctx) error

Parse data from param and set all into context

func QueryToBody

go
func QueryToBody(reqParams ...ReqParam) func(c fiber.Ctx) error

Parse data from param and set all into body

func QueryToContext

go
func QueryToContext(reqParams ...ReqParam) func(c fiber.Ctx) error

Parse data from query and set all into context

func StructToQueryString

go
func StructToQueryString(v any) string

func TrustedInternalIPs

go
func TrustedInternalIPs() []string

func Validate

go
func Validate(m any) *froto.RpcError

*

  • Validates model before do something

func WithAccessInterceptorReqResFilter

go
func WithAccessInterceptorReqResFilter(filter string) lib_3rd.Option[config]

func WithAddress

go
func WithAddress(addr string) lib_3rd.Option[config]

func WithBlockFallback

go
func WithBlockFallback(blockFallback func(fiber.Ctx) error) lib_3rd.Option[config]

func WithCORSAllowCredentials

go
func WithCORSAllowCredentials(allow ...bool) lib_3rd.Option[config]

func WithCORSAllowOrigins

go
func WithCORSAllowOrigins(origins ...string) lib_3rd.Option[config]

func WithCacheExpiration

go
func WithCacheExpiration(d time.Duration) lib_3rd.Option[config]

func WithCacheStorageName

go
func WithCacheStorageName(name string) lib_3rd.Option[config]

func WithContextTimeout

go
func WithContextTimeout(timeout time.Duration) lib_3rd.Option[config]

func WithDisableAccessInterceptor

go
func WithDisableAccessInterceptor(disable ...bool) lib_3rd.Option[config]

func WithDisableMetricInterceptor

go
func WithDisableMetricInterceptor(disable ...bool) lib_3rd.Option[config]

func WithDisableTraceInterceptor

go
func WithDisableTraceInterceptor(disable ...bool) lib_3rd.Option[config]

func WithEmbedFs

go
func WithEmbedFs(fs embed.FS) lib_3rd.Option[config]

func WithEmbedPath

go
func WithEmbedPath(path string) lib_3rd.Option[config]

func WithEnableAccessInterceptorReq

go
func WithEnableAccessInterceptorReq(enable ...bool) lib_3rd.Option[config]

func WithEnableAccessInterceptorRes

go
func WithEnableAccessInterceptorRes(enable ...bool) lib_3rd.Option[config]

func WithEnableCORS

go
func WithEnableCORS(enable ...bool) lib_3rd.Option[config]

func WithEnableCache

go
func WithEnableCache(enable ...bool) lib_3rd.Option[config]

func WithEnableLimiter

go
func WithEnableLimiter(enable ...bool) lib_3rd.Option[config]

func WithEnableLocalMainIP

go
func WithEnableLocalMainIP(enable ...bool) lib_3rd.Option[config]

func WithEnableMinify

go
func WithEnableMinify(enable ...bool) lib_3rd.Option[config]

func WithEnableOPA

go
func WithEnableOPA(enable ...bool) lib_3rd.Option[config]

func WithEnableResponseTime

go
func WithEnableResponseTime(enable ...bool) lib_3rd.Option[config]

func WithEnableSentinel

go
func WithEnableSentinel(enable ...bool) lib_3rd.Option[config]

func WithEnableSouin

go
func WithEnableSouin(enable ...bool) lib_3rd.Option[config]

func WithEnableTLS

go
func WithEnableTLS(enable ...bool) lib_3rd.Option[config]

func WithEnableTrustedCustomHeader

go
func WithEnableTrustedCustomHeader(enable ...bool) lib_3rd.Option[config]

func WithEnableWAF

go
func WithEnableWAF(enable ...bool) lib_3rd.Option[config]

func WithEnableWebsocketCheckOrigin

go
func WithEnableWebsocketCheckOrigin(enable ...bool) lib_3rd.Option[config]

func WithEnableWebsocketCompression

go
func WithEnableWebsocketCompression(enable ...bool) lib_3rd.Option[config]

func WithFiberConfigs

go
func WithFiberConfigs(fiberConfigs ...fiber.Config) lib_3rd.Option[config]

func WithIdempotencyKeyHeader

go
func WithIdempotencyKeyHeader(header string) lib_3rd.Option[config]

func WithIdempotencyKeySecret

go
func WithIdempotencyKeySecret(secret string) lib_3rd.Option[config]

func WithIdempotencyLifetime

go
func WithIdempotencyLifetime(d time.Duration) lib_3rd.Option[config]

func WithIdempotencyStorageName

go
func WithIdempotencyStorageName(name string) lib_3rd.Option[config]

func WithLimiterExpiration

go
func WithLimiterExpiration(d time.Duration) lib_3rd.Option[config]

func WithLimiterMax

go
func WithLimiterMax(max int) lib_3rd.Option[config]

func WithLimiterStorageName

go
func WithLimiterStorageName(name string) lib_3rd.Option[config]

func WithMetricCounter

go
func WithMetricCounter(counter metrics.Counter) lib_3rd.Option[config]

func WithMetricHistogram

go
func WithMetricHistogram(histogram metrics.Histogram) lib_3rd.Option[config]

func WithMetricProviderName

go
func WithMetricProviderName(name string) lib_3rd.Option[config]

func WithMinifyMinifyJSON

go
func WithMinifyMinifyJSON(enable ...bool) lib_3rd.Option[config]

func WithMinifyMinifySVG

go
func WithMinifyMinifySVG(enable ...bool) lib_3rd.Option[config]

func WithMinifyMinifyXML

go
func WithMinifyMinifyXML(enable ...bool) lib_3rd.Option[config]

func WithName

go
func WithName(name string) lib_3rd.Option[config]

func WithNetworkProtocol

go
func WithNetworkProtocol(protocol string) lib_3rd.Option[config]

func WithOPAPolicy

go
func WithOPAPolicy(policy string) lib_3rd.Option[config]

func WithOPAQuery

go
func WithOPAQuery(query string) lib_3rd.Option[config]

func WithOPAURL

go
func WithOPAURL(url string) lib_3rd.Option[config]

func WithResourceExtract

go
func WithResourceExtract(resourceExtract func(fiber.Ctx) string) lib_3rd.Option[config]

func WithServerHTTPTimeout

go
func WithServerHTTPTimeout(timeout time.Duration) lib_3rd.Option[config]

func WithServerReadHeaderTimeout

go
func WithServerReadHeaderTimeout(timeout time.Duration) lib_3rd.Option[config]

func WithServerReadTimeout

go
func WithServerReadTimeout(timeout time.Duration) lib_3rd.Option[config]

func WithServerWriteTimeout

go
func WithServerWriteTimeout(timeout time.Duration) lib_3rd.Option[config]

func WithSlowLogThreshold

go
func WithSlowLogThreshold(duration time.Duration) lib_3rd.Option[config]

func WithSouinExcludedRegex

go
func WithSouinExcludedRegex(regex string) lib_3rd.Option[config]

func WithSouinHandler

go
func WithSouinHandler(h middleware.SouinHandler) lib_3rd.Option[config]

WithSouinHandler injects a pre-built SouinHandler into the config. This avoids importing Souin's heavy transitive dependency chain (Caddy, etc.) from the fhttp package.

Usage:

// In application code (imports souin/pkg/middleware directly):
cfg := middleware.BuildSouinConfiguration(
    middleware.SouinWithTTL(30*time.Second),
)
handler := souinmw.NewHTTPCacheHandler(cfg)
fhttp.WithSouinHandler(myAdapter{handler})

func WithSouinLogLevel

go
func WithSouinLogLevel(level string) lib_3rd.Option[config]

func WithSouinTTL

go
func WithSouinTTL(d time.Duration) lib_3rd.Option[config]

func WithTLSCertFile

go
func WithTLSCertFile(path string) lib_3rd.Option[config]

func WithTLSClientAuth

go
func WithTLSClientAuth(auth string) lib_3rd.Option[config]

func WithTLSClientCAs

go
func WithTLSClientCAs(ca []string) lib_3rd.Option[config]

func WithTLSKeyFile

go
func WithTLSKeyFile(path string) lib_3rd.Option[config]

func WithTLSSessionCache

go
func WithTLSSessionCache(s tls.ClientSessionCache) lib_3rd.Option[config]

func WithTrustedPlatform

go
func WithTrustedPlatform(platform string) lib_3rd.Option[config]

func WithWAFBlock

go
func WithWAFBlock(block ...bool) lib_3rd.Option[config]

func WithWAFDirectives

go
func WithWAFDirectives(directives string) lib_3rd.Option[config]

func WithWebsocketHandshakeTimeout

go
func WithWebsocketHandshakeTimeout(timeout time.Duration) lib_3rd.Option[config]

func WithWebsocketReadBufferSize

go
func WithWebsocketReadBufferSize(size int) lib_3rd.Option[config]

func WithWebsocketWriteBufferSize

go
func WithWebsocketWriteBufferSize(size int) lib_3rd.Option[config]

func WriteError

go
func WriteError(c fiber.Ctx, err *froto.RpcError) error

*

  • Returns an error response

func WriteErrorWithExtend

go
func WriteErrorWithExtend(c fiber.Ctx, err *froto.RpcError, extend any) error

*

  • Returns a success response

func WriteErrorWithGRPCExtend

go
func WriteErrorWithGRPCExtend(c fiber.Ctx, err *froto.RpcError, extend map[froto.Constructor]froto.ObjectInf) error

*

  • Returns a success response

func WriteNotImplementedError

go
func WriteNotImplementedError(c fiber.Ctx) error

*

  • Returns an error response

func WriteSuccess

go
func WriteSuccess(c fiber.Ctx, v any) error

*

  • Returns a success response

func WriteSuccessEmptyContent

go
func WriteSuccessEmptyContent(c fiber.Ctx) error

*

  • Returns a success response without content

func WriteSuccessWithExtend

go
func WriteSuccessWithExtend(c fiber.Ctx, data any, extend any) error

*

  • Returns a success response

func WriteSuccessWithGRPCExtend

go
func WriteSuccessWithGRPCExtend(c fiber.Ctx, data any, extend map[froto.Constructor]froto.ObjectInf) error

*

  • Returns a success response

func WriteSuccessWithPaging

go
func WriteSuccessWithPaging(c fiber.Ctx, v any, paging *Paging) error

*

  • Returns a success response

func WriteSuccessWithStatus

go
func WriteSuccessWithStatus(c fiber.Ctx, code int, v any) error

*

  • Returns a success response

func WriteWithErrorProcess

go
func WriteWithErrorProcess(c fiber.Ctx, err error) error

type CookieOption

CookieOption tinh chỉnh cookie attribute. Dùng cho CreateCookie / DeleteCookie khi cần override default (vd cookie không HTTPOnly cho JS-side feature flag, hoặc SameSite=None cho cross-site iframe).

go
type CookieOption func(*fiber.Cookie)

func WithCookieHTTPOnly

go
func WithCookieHTTPOnly(httpOnly bool) CookieOption

WithCookieHTTPOnly bật/tắt HTTPOnly. Default true (an toàn nhất, JS không đọc được — chống XSS đánh cắp). Tắt khi cookie cần JS đọc (analytics, ...).

func WithCookieMaxAge

go
func WithCookieMaxAge(seconds int) CookieOption

WithCookieMaxAge set MaxAge (seconds). 0 = session cookie. <0 = delete ngay. Browser ưu tiên MaxAge hơn Expires khi cả hai cùng set.

func WithCookiePath

go
func WithCookiePath(path string) CookieOption

WithCookiePath set Path attribute (default "/").

func WithCookieSameSite

go
func WithCookieSameSite(mode string) CookieOption

WithCookieSameSite set SameSite mode. Default "Lax". Dùng "Strict" cho extra CSRF protection (chặn cross-origin link clicks), "None" cho 3rd-party embed (yêu cầu Secure=true).

func WithCookieSecure

go
func WithCookieSecure(secure bool) CookieOption

WithCookieSecure bật/tắt Secure (HTTPS-only). Default = env.IsProdEnvironment(). Override để force-on trong dev (https://localhost) hoặc force-off cho test.

type Decoder

go
type Decoder interface {
    Decode(dst any, src map[string][]string) error
}

type Encoder

go
type Encoder interface {
    Encode(src any, dst map[string][]string) error
}

type FormAuthorization

go
type FormAuthorization func(url.Values)

type Paging

go
type Paging struct {
    CurrentOffset int `json:"current_offset,omitempty"` // for load more
    NextOffset    int `json:"next_offset,omitempty"`    // for load more
    Limit         int `json:"limit,omitempty"`          // for load more
    Total         int `json:"total,omitempty"`          // total items
    CurrentPage   int `json:"current_page,omitempty"`   // for page
    PageSize      int `json:"page_size,omitempty"`      // for page
    NextPage      int `json:"next_page,omitempty"`      // for page
    PrevPage      int `json:"prev_page,omitempty"`      // for page
    TotalPages    int `json:"total_pages,omitempty"`    // for page
}

type ProbesFn

go
type ProbesFn func(context.Context) error

type ReqParam

Models

go
type ReqParam struct {
    Param        string
    Name         string // Name of param when it convert to body
    DefaultValue string
}

type RequestAuthorization

go
type RequestAuthorization func(*http.Request)

func AuthorizeBasic

go
func AuthorizeBasic(user, password string) RequestAuthorization

type Response

*

  • Defines a response object
go
type Response[T any] struct {
    Message     string  `json:"message,omitempty"`
    Data        T       `json:"data,omitempty"`
    DataExtend  any     `json:"data_extend,omitempty"` // map[froto.Constructor]froto.ObjectInf or encrypted data as base64 string
    Paging      *Paging `json:"paging,omitempty"`
    Description string  `json:"description,omitempty"`
    Status      int     `json:"status,omitempty"`
}

func NewResponse

go
func NewResponse[T any]() *Response[T]

func (*Response[T]) Parse

go
func (res *Response[T]) Parse(body []byte) error

type Server

FountainAPI type;

go
type Server struct {
    *runnable.ServerInstance
    *fiber.App
    Store *session.Store
    // contains filtered or unexported fields
}

func GetAuxiliaryServer

go
func GetAuxiliaryServer() *Server

Panic if auxiliary server is not available

func (*Server) CreateGovernanceServer

go
func (s *Server) CreateGovernanceServer()

CreateGovernanceServer func;

func (*Server) CreateMetricsServer

go
func (s *Server) CreateMetricsServer()

CreateMetricsServer func;

CHANGELOG (fiber v3 migration): the Fiber v2 monitor middleware is no longer available in v3 and there is no in-tree replacement, so the previous /monitor route has been removed. The Prometheus /metrics route remains and is the supported observability surface going forward.

func (*Server) Destroy

go
func (s *Server) Destroy() (err error)

Stop func;

func (*Server) GetConfig

go
func (s *Server) GetConfig() *config

func (*Server) GetName

go
func (s *Server) GetName() string

Name configuration name

func (*Server) GetPackageName

go
func (s *Server) GetPackageName() string

PackageName package name

func (*Server) GracefulStop

go
func (s *Server) GracefulStop(ctx context.Context) error

func (*Server) InitHealthCheckPath

go
func (s *Server) InitHealthCheckPath(path string)

func (*Server) InitHealthCheckRoute

go
func (s *Server) InitHealthCheckRoute(router fiber.Router)

func (*Server) RegisterReadyProbes

go
func (s *Server) RegisterReadyProbes(name string, probesFn ProbesFn) *Server

func (*Server) Serve

go
func (s *Server) Serve() (err error)

Serve func; Need run in a goroutine

func (*Server) Serving

go
func (s *Server) Serving()

Serving func; Need run in a goroutine

func (*Server) SetAccessInterceptorResCelProgram

go
func (s *Server) SetAccessInterceptorResCelProgram() *Server

Generated by gomarkdoc