Documentation
¶
Index ¶
- Variables
- func GetManager() *manager
- func NewAddGroupToNilServerErr(name string) error
- func NewAddRouteToNilServerErr(route string) error
- func NewAttachErrorHandlerToNilServerErr(serverNames ...string) error
- func NewCreateServerErr(err error) error
- func NewFromMultipleServerErr() error
- func NewFromNilServerErr() error
- func NewGetRouteByNameErr(name string) error
- func NewGroupRouteNotExistErr(name string) error
- func NewNotImplementedErr() error
- func NewNotSupportedHttpMethodErr(method string) error
- func NewShutdownServerErr(err error) error
- func NewStartServerErr(addr string, err error) error
- func NewUpdateServerConfigErr(err error) error
- type AddGroupToNilServerErr
- type AddRouteToNilServerErr
- type AttachErrorHandlerToNilServerErr
- type CreateServerErr
- type FaviconMiddlewareConfig
- type FiberServer
- func (s *FiberServer) AddGroup(groupName string, f func(c *fiber.Ctx) error, groups ...string) error
- func (s *FiberServer) AddRoute(method string, path string, f func(c *fiber.Ctx) error, routeName string, ...) error
- func (s *FiberServer) AddRouteWithMultiHandlers(method string, path string, f []func(c *fiber.Ctx) error, routeName string, ...) error
- func (s *FiberServer) AttachErrorHandler(f func(ctx *fiber.Ctx, err error) error)
- func (s *FiberServer) GetAllRoutes() []fiber.Route
- func (s *FiberServer) GetRouteByName(name string) (*fiber.Route, error)
- func (s *FiberServer) Start() error
- func (s *FiberServer) Stop() error
- func (s *FiberServer) UpdateConfigs(config types.ServerConfig, rawConfig map[string]interface{}) error
- type FromMultipleServerErr
- type FromNilServerErr
- type GetRouteByNameErr
- type GinServer
- func (s *GinServer) AddGroup(groupName string, f gin.HandlerFunc, groups ...string) error
- func (s *GinServer) AddRoute(method string, path string, f func(c *gin.Context), routeName string, ...) error
- func (s *GinServer) AddRouteWithMultiHandlers(method string, path string, f []func(c *gin.Context), routeName string, ...) error
- func (s *GinServer) AttachErrorHandler(f func(ctx *gin.Context, err any))
- func (s *GinServer) GetAllRoutes() gin.RoutesInfo
- func (s *GinServer) Start() error
- func (s *GinServer) Stop() error
- func (s *GinServer) UpdateConfigs(config types.GinServerConfig, rawConfig map[string]interface{}) error
- type GroupRouteNotExistErr
- type LoggerMiddlewareConfig
- type NotImplementedErr
- type NotSupportedHttpMethodErr
- type ServerConfig
- type ShutdownServerErr
- type StartServerErr
- type UpdateServerConfigErr
Constants ¶
This section is empty.
Variables ¶
var (
HttpServerMaintenanceType = logTypes.NewLogType("HTTP_SERVER_MAINTENANCE")
)
Functions ¶
func GetManager ¶
func GetManager() *manager
GetManager - This function returns singleton instance of Logger Manager
func NewAddGroupToNilServerErr ¶
NewAddGroupToNilServerErr - return a new instance of AddGroupToNilServerErr
func NewAddRouteToNilServerErr ¶
NewAddRouteToNilServerErr - return a new instance of AddRouteToNilServerErr
func NewAttachErrorHandlerToNilServerErr ¶
NewAttachErrorHandlerToNilServerErr - return a new instance of AttachErrorHandlerToNilServerErr
func NewCreateServerErr ¶
NewCreateServerErr - return a new instance of CreateServerErr
func NewFromMultipleServerErr ¶
func NewFromMultipleServerErr() error
NewFromMultipleServerErr - return a new instance of FromMultipleServerErr
func NewFromNilServerErr ¶
func NewFromNilServerErr() error
NewFromNilServerErr - return a new instance of FromNilServerErr
func NewGetRouteByNameErr ¶
NewGetRouteByNameErr - return a new instance of GetRouteByNameErr
func NewGroupRouteNotExistErr ¶
NewGroupRouteNotExistErr - return a new instance of GroupRouteNotExistErr
func NewNotImplementedErr ¶
func NewNotImplementedErr() error
NewNotImplementedErr - return a new instance of NotImplementedErr
func NewNotSupportedHttpMethodErr ¶
NewNotSupportedHttpMethodErr - return a new instance of NotSupportedHttpMethodErr
func NewShutdownServerErr ¶
NewShutdownServerErr - return a new instance of StartServerErr
func NewStartServerErr ¶
NewStartServerErr - return a new instance of StartServerErr
func NewUpdateServerConfigErr ¶
NewUpdateServerConfigErr - return a new instance of UpdateServerConfigErr
Types ¶
type AddGroupToNilServerErr ¶
type AddGroupToNilServerErr struct {
// contains filtered or unexported fields
}
AddGroupToNilServerErr Error
func (*AddGroupToNilServerErr) Error ¶
func (err *AddGroupToNilServerErr) Error() string
Error method - satisfying error interface
type AddRouteToNilServerErr ¶
type AddRouteToNilServerErr struct {
// contains filtered or unexported fields
}
AddRouteToNilServerErr Error
func (*AddRouteToNilServerErr) Error ¶
func (err *AddRouteToNilServerErr) Error() string
Error method - satisfying error interface
type AttachErrorHandlerToNilServerErr ¶
type AttachErrorHandlerToNilServerErr struct {
// contains filtered or unexported fields
}
AttachErrorHandlerToNilServerErr Error
func (*AttachErrorHandlerToNilServerErr) Error ¶
func (err *AttachErrorHandlerToNilServerErr) Error() string
Error method - satisfying error interface
type CreateServerErr ¶
type CreateServerErr struct {
Err error
}
CreateServerErr Error
func (*CreateServerErr) Error ¶
func (err *CreateServerErr) Error() string
Error method - satisfying error interface
type FaviconMiddlewareConfig ¶
type FiberServer ¶
type FiberServer struct {
// contains filtered or unexported fields
}
Server struct
func NewServer ¶
func NewServer(name string, config types.ServerConfig, rawConfig map[string]interface{}) (*FiberServer, error)
NewServer - create a new instance of Server and return it
func (*FiberServer) AddGroup ¶
func (s *FiberServer) AddGroup(groupName string, f func(c *fiber.Ctx) error, groups ...string) error
AddGroup - add a group to the server
func (*FiberServer) AddRoute ¶
func (s *FiberServer) AddRoute(method string, path string, f func(c *fiber.Ctx) error, routeName string, versions []string, groups []string) error
AddRoute - add a route to the server
func (*FiberServer) AddRouteWithMultiHandlers ¶
func (s *FiberServer) AddRouteWithMultiHandlers(method string, path string, f []func(c *fiber.Ctx) error, routeName string, versions []string, groups []string) error
AddRouteWithMultiHandlers - add a route to the server
func (*FiberServer) AttachErrorHandler ¶
func (s *FiberServer) AttachErrorHandler(f func(ctx *fiber.Ctx, err error) error)
AttachErrorHandler - attach a custom error handler to the server
func (*FiberServer) GetAllRoutes ¶
func (s *FiberServer) GetAllRoutes() []fiber.Route
GetAllRoutes - Get all Routes
func (*FiberServer) GetRouteByName ¶
func (s *FiberServer) GetRouteByName(name string) (*fiber.Route, error)
GetRouteByName _ get route by its name
func (*FiberServer) Start ¶
func (s *FiberServer) Start() error
Start - start the server and listen to provided address
func (*FiberServer) UpdateConfigs ¶
func (s *FiberServer) UpdateConfigs(config types.ServerConfig, rawConfig map[string]interface{}) error
type FromMultipleServerErr ¶
type FromMultipleServerErr struct { }
FromMultipleServerErr Error
func (*FromMultipleServerErr) Error ¶
func (err *FromMultipleServerErr) Error() string
Error method - satisfying error interface
type FromNilServerErr ¶
type FromNilServerErr struct { }
FromNilServerErr Error
func (*FromNilServerErr) Error ¶
func (err *FromNilServerErr) Error() string
Error method - satisfying error interface
type GetRouteByNameErr ¶
type GetRouteByNameErr struct {
// contains filtered or unexported fields
}
GetRouteByNameErr Error
func (*GetRouteByNameErr) Error ¶
func (err *GetRouteByNameErr) Error() string
Error method - satisfying error interface
type GinServer ¶
type GinServer struct {
// contains filtered or unexported fields
}
GinServer struct
func NewGinServer ¶
func NewGinServer(name string, config types.GinServerConfig, rawConfig map[string]interface{}) (*GinServer, error)
NewGinServer - create a new instance of Server and return it
func (*GinServer) AddRouteWithMultiHandlers ¶
func (s *GinServer) AddRouteWithMultiHandlers(method string, path string, f []func(c *gin.Context), routeName string, versions []string, groups []string) error
AddRouteWithMultiHandlers - add a route to the server
func (*GinServer) AttachErrorHandler ¶
AttachErrorHandler - attach a custom error handler to the server
func (*GinServer) GetAllRoutes ¶
func (s *GinServer) GetAllRoutes() gin.RoutesInfo
GetAllRoutes - Get all Routes
func (*GinServer) UpdateConfigs ¶
func (s *GinServer) UpdateConfigs(config types.GinServerConfig, rawConfig map[string]interface{}) error
type GroupRouteNotExistErr ¶
type GroupRouteNotExistErr struct {
// contains filtered or unexported fields
}
GroupRouteNotExistErr Error
func (*GroupRouteNotExistErr) Error ¶
func (err *GroupRouteNotExistErr) Error() string
Error method - satisfying error interface
type LoggerMiddlewareConfig ¶
type LoggerMiddlewareConfig struct { Format string `json:"format"` TimeFormat string `json:"time_format"` TimeZone string `json:"time_zone"` TimeInterval int `json:"time_interval"` Output string `json:"output"` }
LoggerMiddlewareConfig - defines the config for middleware.
type NotImplementedErr ¶
type NotImplementedErr struct { }
NotImplementedErr Error
func (*NotImplementedErr) Error ¶
func (err *NotImplementedErr) Error() string
Error method - satisfying error interface
type NotSupportedHttpMethodErr ¶
type NotSupportedHttpMethodErr struct {
// contains filtered or unexported fields
}
NotSupportedHttpMethodErr Error
func (*NotSupportedHttpMethodErr) Error ¶
func (err *NotSupportedHttpMethodErr) Error() string
Error method - satisfying error interface
type ServerConfig ¶
type ServerConfig struct { ListenAddress string `json:"addr"` Name string `json:"name"` Versions []string `json:"versions"` SupportStatic bool `json:"support_static"` Config struct { ServerHeader string `json:"server_header"` StrictRouting bool `json:"strict_routing"` CaseSensitive bool `json:"case_sensitive"` UnescapePath bool `json:"unescape_path"` Etag bool `json:"etag"` BodyLimit int `json:"body_limit"` Concurrency int `json:"concurrency"` ReadTimeout int `json:"read_timeout"` WriteTimeout int `json:"write_timeout"` IdleTimeout int `json:"idle_timeout"` ReadBufferSize int `json:"read_buffer_size"` WriteBufferSize int `json:"write_buffer_size"` CompressedFileSuffix string `json:"compressed_file_suffix"` GetOnly bool `json:"get_only"` DisableKeepalive bool `json:"disable_keepalive"` Network string `json:"network"` EnablePrintRoutes bool `json:"enable_print_routes"` AttachErrorHandler bool `json:"attach_error_handler"` RequestMethods []string `json:"request_methods"` } `json:"conf"` Middlewares struct { Order []string `json:"order"` } `json:"middlewares"` Static struct { Prefix string `json:"prefix"` Root string `json:"root"` Config fiber.Static `json:"config"` } `json:"static"` }
type ShutdownServerErr ¶
type ShutdownServerErr struct {
Err error
}
ShutdownServerErr Error
func (*ShutdownServerErr) Error ¶
func (err *ShutdownServerErr) Error() string
Error method - satisfying error interface
type StartServerErr ¶
StartServerErr Error
func (*StartServerErr) Error ¶
func (err *StartServerErr) Error() string
Error method - satisfying error interface
type UpdateServerConfigErr ¶
type UpdateServerConfigErr struct {
Err error
}
UpdateServerConfigErr Error
func (*UpdateServerConfigErr) Error ¶
func (err *UpdateServerConfigErr) Error() string
Error method - satisfying error interface