Small package which wraps error responses to follow jsonapi.org

Overview

Go-JsonError

Go Report Card Build Status Coveragestatus GoDoc Mentioned in Awesome Go

Go-JsonError is meant to allow us to easily create json response errors that follow the JsonApi spec.

Json API Spec

Usuage

In order to use jsonError you will need to initliaze the ErrorJson struct. Then when you would like to add an error you must pass in a ErrorComp struct to the AddError().

This follows the jsonapi spec where the error response must return an array.

Here is a basic example

	var err ErrorJSON

	errorComposition := ErrorComp{
		Detail: "this is a error message",
		Code:   "This is the code",
		Source: Source{
			Pointer: "/unit/tests",
		},
		Title:  "Title Test",
		Status: 200,
	}

	err.AddError(errorComposition)

	err.Error()
	err.ErrorByte()

Running the tests

This package is just using the standard test packge included with go. You can run the test cases with

go test ./...

Contributing

Please feel free to submit any pull requests.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • David Dymko

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Issues
Releases(v0.1.2)
  • v0.1.2(Sep 23, 2019)

    Enhancements

    • Added in json tag to the Errors within the ErrorJson struct so that Errors are marshaled as errors to fall in line with the json spec
    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Jul 12, 2019)

    Enhancements

    • Package name from jsonError to jsonerror to fall in line with go conventions
    • Renamed jsonError.go to json_error.go along with the appropriate test to fall in line with go conventions
    Source code(tar.gz)
    Source code(zip)
  • v.0.1.0(Oct 18, 2018)

Owner
David Dymko
It writes the code in the IDE or else it gets the hose again
David Dymko
Fast, concurrent, streaming access to Amazon S3, including gof3r, a CLI. http://godoc.org/github.com/rlmcpherson/s3gof3r

s3gof3r s3gof3r provides fast, parallelized, pipelined streaming access to Amazon S3. It includes a command-line interface: gof3r. It is optimized for

Randall McPherson 1.1k Jan 12, 2022
Clones github projects into ~/Projects/github/{org}/{repo}

Tidy clone Github cli extension (gh extension) to clone repos into ~/Projects/github/{org}/{repo} on the local filesystem Install gh extension install

Pascal Welsch 1 Jan 19, 2022
SLOs, Error windows and alerts are complicated. Here an attempt to make it easy

slo-computer SLOs, Error windows and alerts are complicated. Here's an attempt to make it easy SLO, burn_rate, error_rate, budget_spend are convoluted

last9 41 Jan 12, 2022
A very simple utility that allows you to run the desired command or script as soon as a certain process with a known PID completes correctly or with an error.

go-monkill A very simple utility that allows you to run the desired command or script as soon as a certain process with a known PID completes correctl

Michael Savin 6 Dec 9, 2021
Errhandle - A golang error handling framework

errhandle A golang error handling framework About errhandle: An error handling f

Krisna Pranav 2 Jan 3, 2022
A package manager written in Go which uses the LFS Symlink method.

pacsym A package manager powered by symlinks. How to use The package manager assumes that all software installed is installed with /usr/pkg/<packagena

Alex S. 2 Dec 11, 2021
This library provides a metrics package which can be used to instrument code, expose application metrics, and profile runtime performance in a flexible manner.

This library provides a metrics package which can be used to instrument code, expose application metrics, and profile runtime performance in a flexible manner.

null 0 Jan 18, 2022
a small form factor OpenShift/Kubernetes optimized for edge computing

Microshift Microshift is OpenShift1 Kubernetes in a small form factor and optimized for edge computing. Edge devices deployed out in the field pose ve

Red Hat Emerging Technologies 185 Jan 23, 2022
Small and easy server for web-hooks to deploy software on push from gitlab/github/hg and so on

Deployment mini-service This mini web-server is made to deploy your code without yaml-files headache. If you just need to update your code somewhere a

Roman Usachev 9 Aug 31, 2021
Small skeleton app running on k8s

k8s-go-app Small skeleton app running on k8s Usage NOTE Please replace ${repositry} in below and k8s/*.yml to point your private/public repositry. doc

mattn 4 Dec 18, 2021
Small helper to bridge between Vault and AWS Credential Process.

vault-aws-credential-helper The Vault AWS Credential Helper is a component that can be injected into a task environment and be used as a credential he

Michael Aldridge 1 Nov 21, 2021
Small demo of using physac 2d physics engine in golang

Physac-go 2D physics engine in golang For now this is just a small demo. Maybe later I'll convert it into a proper module. References Original Physac

Yury Kotov 8 Jan 4, 2022
A small application to find pod ip address by service name using go

k8s podipfinder This is a small application to find pod ip address by service na

Jeyaganesh 1 Dec 29, 2021
Small tool to pull/push several projects in one go

gitTool Small tool to push and pull several projects in one go. Written in Go 1.17 by Roy Dybing Contact: location name/handle github: rDybing linked

Roy Dybing 0 Dec 28, 2021
A simple download file manager that sorts your files into your desired folders, This was meant to be a small project and nothing big.

GoDFM Simply go to the tags and download the .exe file (or compile it yourself by running go build). Add it to your environment paths by going to sett

null 0 Jan 11, 2022
A small drunken bishop written in Go to represent bytes.

Go, Little Drunken Bishop! go get github.com/eloonstra/go-little-drunken-bishop Table of Contents How does it work? Usage Example License Contributin

eloonstra 2 Jan 19, 2022
A package for running subprocesses in Go, similar to Python's subprocesses package.

Subprocesses Spawn subprocesses in Go. Sanitized mode package main import ( "log" "github.com/estebangarcia21/subprocess" ) func main() { s := s

Esteban Garcia 3 Dec 31, 2021
A kubernetes plugin which enables dynamically add or remove GPU resources for a running Pod

GPU Mounter GPU Mounter is a kubernetes plugin which enables add or remove GPU resources for running Pods. This Introduction(In Chinese) is recommende

XinYuan 66 Jan 17, 2022
A sub module of EdgeGallery MECM which responsible for the app lifecycle management

mecm-applcm Description Application life cycle manager is part of MEP manager whose responsibility is to handle the host level life cycle management i

EdgeGallery 21 Jan 10, 2022