package
2.4.6
Repository: https://github.com/jobaldw/shared.git
Documentation: pkg.go.dev

# README

shared | errors

Error package with built in structs designed for dependent client controller errors and mongo operation errors.

Built-In Error Structs

Client error structs.

type ClientErr struct {
	Client     string `json:"client,omitempty"`
	URI        string `json:"uri,omitempty"`
	Status     string `json:"status,omitempty"`
	StatusCode int    `json:"code,omitempty"`
	Msg        string `json:"message,omitempty"`
	Err        error  `json:"error,omitempty"`
}

Mongo error structs.

type MongoErr struct {
	Operation  string `json:"operation,omitempty"`
	Collection string `json:"collection,omitempty"`
	Err        error  `json:"error,omitempty"`
}

# Functions

NewClientErr creates and fills a new ClientErr struct.
NewMongoErr creates and fills a new MongoErr struct.

# Constants

Delete Mongo operation key.
Insert Mongo operation key.
Read Mongo operation key.
Update Mongo operation key.

# Variables

an error occurred trying to delete a document.
an error occurred trying to create a new document.
an error occurred trying to retrieve a document.
an error occurred trying to update a document.

# Structs

struct for client errors.
struct for mongo errors.