Categorygithub.com/ishtiaqhimel/go-api-server
modulepackage
0.0.0-20241213062446-b9a3588341c9
Repository: https://github.com/ishtiaqhimel/go-api-server.git
Documentation: pkg.go.dev

# README

API server Using Go

Go Report Card

RESTful API using go, cobra CLI, go-chi/chi, Basic Auth, JWT Auth


API Endpoints

EndpointFunctionMethodStatusCodeAuth
/api/loginLogInPOSTSuccess - 200, Failure - 401Basic
/api/studentStudentGetGETSuccess - 200, Failure - 401JWT
/api/studentStudentPostPOSTSuccess - 200, Failure - 401, 409JWT
/api/student/{id}StudentUpdatePUTSuccess - 200, Failure - 401, 404JWT
/api/student/{id}StudentDeleteDELETESuccess - 200, Failure - 401, 404JWT
/api/subjectSubjectGetGETSuccess - 200, Failure - 401JWT
/api/subjectSubjectPostPOSTSuccess - 200, Failure - 401, 409JWT
/api/subject/{id}SubjectUpdatePUTSuccess - 200, Failure - 401, 404JWT
/api/subject/{id}SubjectDeleteDELETESuccess - 200, Failure - 401, 404JWT

Data Model

package model

type Student struct {
	Id        string    `json:"id"`
	FirstName string    `json:"firstName"`
	LastName  string    `json:"lastName"`
	Subjects  []Subject `json:"subjects"`
}

package model

type Subject struct {
	Id    string `json:"id"`
	Title string `json:"title"`
	Code  string `json:"code"`
}


Installation

  • go install github.com/ishtiaqhimel/go-api-server@latest

Run

  • go-api-server start

CLI Commands

  • build the app locally make build
  • help with the start commands ./bin/apiserver start -h or ./bin/apiserver start --help

Authentication Method

  • Basic Authentication
  • JWT Authentication

Resources:

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author