infra

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package infra provides infrastructure-related error types for the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseError

type DatabaseError struct {
	*InfrastructureError
	Operation string `json:"operation,omitempty"`
	Table     string `json:"table,omitempty"`
}

DatabaseError represents a database operation failure. It extends InfrastructureError with database-specific information.

func NewDatabaseError

func NewDatabaseError(message string, operation string, table string, cause error) *DatabaseError

NewDatabaseError creates a new DatabaseError.

func (*DatabaseError) IsDatabaseError

func (e *DatabaseError) IsDatabaseError() bool

IsDatabaseError identifies this as a database error.

type ExternalServiceError

type ExternalServiceError struct {
	*InfrastructureError
	ServiceName string `json:"service_name,omitempty"`
	Endpoint    string `json:"endpoint,omitempty"`
}

ExternalServiceError represents an external service call failure. It extends InfrastructureError with service-specific information.

func NewExternalServiceError

func NewExternalServiceError(message string, serviceName string, endpoint string, cause error) *ExternalServiceError

NewExternalServiceError creates a new ExternalServiceError.

func (*ExternalServiceError) IsExternalServiceError

func (e *ExternalServiceError) IsExternalServiceError() bool

IsExternalServiceError identifies this as an external service error.

type InfrastructureError

type InfrastructureError struct {
	*core.BaseError
}

InfrastructureError represents an infrastructure-related error. It extends BaseError with infrastructure-specific information.

func NewInfrastructureError

func NewInfrastructureError(code core.ErrorCode, message string, cause error) *InfrastructureError

NewInfrastructureError creates a new InfrastructureError.

func (*InfrastructureError) IsInfrastructureError

func (e *InfrastructureError) IsInfrastructureError() bool

IsInfrastructureError identifies this as an infrastructure error.

type NetworkError

type NetworkError struct {
	*InfrastructureError
	Host string `json:"host,omitempty"`
	Port string `json:"port,omitempty"`
}

NetworkError represents a network-related error. It extends InfrastructureError with network-specific information.

func NewNetworkError

func NewNetworkError(message string, host string, port string, cause error) *NetworkError

NewNetworkError creates a new NetworkError.

func (*NetworkError) IsNetworkError

func (e *NetworkError) IsNetworkError() bool

IsNetworkError identifies this as a network error.

Jump to

Keyboard shortcuts

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