Skip to content

I-GEAR-GEEK/igg-golang-api-response

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IGG Golang Standard API Response Format

Install

go get github.com/igeargeek/igg-golang-api-response/v2

How to use

package main

import "github.com/igeargeek/igg-golang-api-response/v2/response"

func Simple(c context) error {
    status, resData := response.InternalServerError("Update profile error", "error message something", "UPDATE_PROFILE_ERROR")
    return c.Status(status).JSON(resData)
}

Function

response.Item(item interface{}, message string)
response.Success(item interface{}, message string)
response.Pagination(data Pagination, message string)
response.Accepted(item interface{}, message string)
response.Created(message string, item interface{})
response.Updated(message string, item interface{})
response.Deleted(message string)
response.BadRequest(message string, code string)
response.Unauthorized(message string, code string)
response.Forbidden(message string, code string)
response.NotFound(message string, code string)
response.ValidateFailed(message string, errorMessages interface{})
response.InternalServerError(message string, detail string, code string)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages