domain

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HttpPathKey          = log.Path{Parent: &HttpRequestContextKey, Identifier: "path"}
	HttpFullPathKey      = log.Path{Parent: &HttpRequestContextKey, Identifier: "full_path"}
	HttpMethodKey        = log.Path{Parent: &HttpRequestContextKey, Identifier: "method"}
	HttpCorrelationIdKey = log.Path{Parent: &HttpRequestContextKey, Identifier: "correlation_id", IsMetricTag: true}
)
View Source
var (
	LogHTTPScope = log.Path{Identifier: "http"}

	LogRouteScope    = log.Path{Parent: &LogHTTPScope, Identifier: "route"}
	LogResponseScope = log.Path{Parent: &LogHTTPScope, Identifier: "response"}
)
View Source
var (
	LogHttpMethodField       = log.Path{Parent: &LogRouteScope, Identifier: "method"}
	LogHttpPathField         = log.Path{Parent: &LogRouteScope, Identifier: "path"}
	LogHttpHandlerCountField = log.Path{Parent: &LogRouteScope, Identifier: "handler_count"}
	LogHttpHandlerNameField  = log.Path{Parent: &LogRouteScope, Identifier: "handler"}

	LogHttpResponseStatusCodeField = log.Path{Parent: &LogResponseScope, Identifier: "status"}
	LogHttpResponseTimeField       = log.Path{Parent: &LogResponseScope, Identifier: "ms"}
)
View Source
var HttpContextKey = log.Path{Identifier: "http"}
View Source
var HttpRequestContextKey = log.Path{Parent: &HttpContextKey, Identifier: "request"}
View Source
var HttpResponseContextKey = log.Path{Parent: &HttpContextKey, Identifier: "response"}

Functions

This section is empty.

Types

type BadRequestError

type BadRequestError struct {
	Msg string
}

func (*BadRequestError) Error

func (e *BadRequestError) Error() string

func (*BadRequestError) RestCode

func (e *BadRequestError) RestCode() int

type HttpServerConfig

type HttpServerConfig struct {
	// Bind Address
	Host string `config:"HTTP_BIND_ADDRESS" default:"0.0.0.0"`
	Port int    `config:"HTTP_BIND_PORT" default:"8080"`

	// CORS
	AllowedOrigins string `config:"HTTP_ALLOWED_ORIGINS" default:"*"`
}

type InternalErrorCode

type InternalErrorCode interface {
	InternalErrorCode() string
}

type InternalServerError

type InternalServerError struct {
}

func (*InternalServerError) Error

func (e *InternalServerError) Error() string

func (*InternalServerError) RestCode

func (e *InternalServerError) RestCode() int

type PageNotFoundError

type PageNotFoundError struct {
	Msg string

	Method string
	Path   string
}

func (*PageNotFoundError) Error

func (e *PageNotFoundError) Error() string

func (*PageNotFoundError) RestCode

func (e *PageNotFoundError) RestCode() int

type ResponseError

type ResponseError struct {
	Code        string `json:"code,omitempty"`
	Message     string `json:"message"`
	Translation string `json:"translation,omitempty"`
}

type RestErrorCode

type RestErrorCode interface {
	RestCode() int
}

Jump to

Keyboard shortcuts

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