Documentation
¶
Index ¶
- Variables
- func CalculatePriceTaxAmount(price float64, taxRate float64, includesTax bool) float64
- func ConvertMiddleware(m []func(fiber.Ctx) error) []any
- func CreateToAddress(data *types.AddressCreatePayload) *models.Address
- func ErrorHandler(ctx fiber.Ctx, err error) error
- func GeneratePostgresAlterColumnIfExistStatement(tableName string, columns []string, alterExpression string) string
- func GetSetDifference[T any](original []T, compare []T) []T
- func GetUser(context fiber.Ctx) uuid.UUID
- func MergeMaps(maps ...map[string]interface{}) map[string]interface{}
- func Remove[T any](slice []T, s int) []T
- func ToAddress(data *types.AddressPayload) *models.Address
- type ApplictaionError
- type ApplictaionErrorType
- type Country
- type Currency
- type Query
Constants ¶
This section is empty.
Variables ¶
View Source
var Countries = []Country{}/* 250 elements not displayed */
View Source
var Currencies = map[string]Currency{}/* 120 elements not displayed */
Functions ¶
func CalculatePriceTaxAmount ¶
func ConvertMiddleware ¶
func CreateToAddress ¶
func CreateToAddress(data *types.AddressCreatePayload) *models.Address
func ErrorHandler ¶
func GetSetDifference ¶
func GetSetDifference[T any](original []T, compare []T) []T
Types ¶
type ApplictaionError ¶
type ApplictaionError struct { Type ApplictaionErrorType Message string Code string Date time.Time }
@oas:schema:Error title: "Response Error" type: object properties:
code: type: string description: A slug code to indicate the type of the error. enum: [invalid_state_error, invalid_request_error, api_error, unknown_error] message: type: string description: Description of the error that occurred. example: "first_name must be a string" type: type: string description: A slug indicating the type of the error. enum: [QueryRunnerAlreadyReleasedError, TransactionAlreadyStartedError, TransactionNotStartedError, conflict, unauthorized, payment_authorization_error, duplicate_error, not_allowed, invalid_data, not_found, database_error, unexpected_state, invalid_argument, unknown_error]
func NewApplictaionError ¶
func NewApplictaionError(typeStr ApplictaionErrorType, message string, params ...interface{}) *ApplictaionError
func ParseToUUID ¶
func ParseToUUID(input interface{}) (uuid.UUID, *ApplictaionError)
func ParseUUIDs ¶
func ParseUUIDs(str []string) (uuid.UUIDs, *ApplictaionError)
func (*ApplictaionError) Error ¶
func (e *ApplictaionError) Error() string
type ApplictaionErrorType ¶
type ApplictaionErrorType string
const ( DB_ERROR ApplictaionErrorType = "DB_ERROR" DUPLICATE_ERROR ApplictaionErrorType = "DUPLICATE_ERROR" INVALID_ARGUMENT ApplictaionErrorType = "INVALID_ARGUMENT" INVALID_DATA ApplictaionErrorType = "INVALID_DATA" UNAUTHORIZED ApplictaionErrorType = "UNAUTHORIZED" NOT_FOUND ApplictaionErrorType = "NOT_FOUND" NOT_ALLOWED ApplictaionErrorType = "NOT_ALLOWED" UNEXPECTED_STATE ApplictaionErrorType = "UNEXPECTED_STATE" CONFLICT ApplictaionErrorType = "CONFLICT" PAYMENT_AUTHORIZATION_ERROR ApplictaionErrorType = "PAYMENT_AUTHORIZATION_ERROR" INSUFFICIENT_INVENTORY ApplictaionErrorType = "INSUFFICIENT_INVENTORY" CART_INCOMPATIBLE_STATE ApplictaionErrorType = "CART_INCOMPATIBLE_STATE" QueryRunnerAlreadyReleasedError ApplictaionErrorType = "QueryRunnerAlreadyReleasedError" TransactionAlreadyStartedError ApplictaionErrorType = "TransactionAlreadyStartedError" TransactionNotStartedError ApplictaionErrorType = "TransactionNotStartedError" )
Click to show internal directories.
Click to hide internal directories.