models

package
v0.0.0-...-f39c433 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapError

func WrapError(customErr string, originalErr error) error

WrapError wraps a plain error into a custom error

Types

type DataValidationError

type DataValidationError struct {
	Message string
}

DataValidationError represents the error returned when the format of request is valid but the data is invalid

func (DataValidationError) Error

func (e DataValidationError) Error() string

Error returns message field of DataValidationError struct

type FormatValidationError

type FormatValidationError struct {
	Message string
}

FormatValidationError represents the error returned in case the request body has

a wrong format which the server cannot work with

func (FormatValidationError) Error

func (e FormatValidationError) Error() string

Error returns message field of FormatValidationError struct

type HTTPError

type HTTPError struct {
	Code    int    `json:"code"`
	Type    string `json:"type"`
	Message string `json:"message"`
}

HTTPError is http error returned to the client

func (HTTPError) Error

func (e HTTPError) Error() string

Error returns message field of HTTPError struct

type InvalidJSONError

type InvalidJSONError struct {
	Message string
}

InvalidJSONError represents the error returned when request body contains invalid JSON

func (InvalidJSONError) Error

func (e InvalidJSONError) Error() string

Error returns message field of InvalidJSONError struct

type NotFoundError

type NotFoundError struct {
	Message string
}

NotFoundError represents the error returned in case a resource or route is not found

func (NotFoundError) Error

func (e NotFoundError) Error() string

Error returns message field of NotFoundError struct

type Reminder

type Reminder struct {
	ID        int           `json:"id"`
	Title     string        `json:"title"`
	Message   string        `json:"message"`
	Duration  time.Duration `json:"duration"`
	CreatedAt time.Time     `json:"created_at"`
	UpdatedAt time.Time     `json:"updated_at"`
}

Reminder describes reminder structure

Jump to

Keyboard shortcuts

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