go-gin-mgo-demo

command module
v0.0.0-...-ce6400d Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: MIT Imports: 7 Imported by: 0

README

go-gin-mgo-demo

A demo CRUD application in golang using the popular gin-gonic framework

Development

  1. Clone the (forked) repo.
  2. Then, run
$ go get github.com/codegangsta/gin

codegangsta/gin is used to to automatically compile files while you are developing

  1. Run
$ go get && go install && PORT=7000 DEBUG=* gin -p 9000 -a 7000 -i run # or run make dev

Then visit localhost:7000

  1. MONGODB_URL and PORT can be configured by setting the env variable.
$ export MONGODB_URL=mongodb://
$ export PORT=7000
  1. godep is used for dependency management. So if you add or remove deps, make sure you run godep save before pushing code. Refer to its documentation for more info on how to use it.

Usage

$ go get github.com/madhums/go-gin-mgo-demo
$ PORT=7000 GIN_MODE=release go-gin-mgo-demo # should start listening on port 7000
Credits

Thanks to all the dependent packages

Documentation

Overview

Package main is the CLI. You can use the CLI via Terminal.

Directories

Path Synopsis
Godeps
_workspace/src/golang.org/x/net/context
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
_workspace/src/gopkg.in/bluesuncorp/validator.v5
Package validator implements value validations for structs and individual fields based on tags.
Package validator implements value validations for structs and individual fields based on tags.
_workspace/src/gopkg.in/mgo.v2
Package mgo offers a rich MongoDB driver for Go.
Package mgo offers a rich MongoDB driver for Go.
_workspace/src/gopkg.in/mgo.v2/bson
Package bson is an implementation of the BSON specification for Go:
Package bson is an implementation of the BSON specification for Go:
_workspace/src/gopkg.in/mgo.v2/internal/scram
Pacakage scram implements a SCRAM-{SHA-1,etc} client per RFC5802.
Pacakage scram implements a SCRAM-{SHA-1,etc} client per RFC5802.
_workspace/src/gopkg.in/mgo.v2/testserver
WARNING: This package was replaced by mgo.v2/dbtest.
WARNING: This package was replaced by mgo.v2/dbtest.
_workspace/src/gopkg.in/mgo.v2/txn
The txn package implements support for multi-document transactions.
The txn package implements support for multi-document transactions.
Package GinHTMLRender provides some sugar for gin's template rendering
Package GinHTMLRender provides some sugar for gin's template rendering
handlers
Package middlewares contains gin middlewares Usage: router.Use(middlewares.Connect)
Package middlewares contains gin middlewares Usage: router.Use(middlewares.Connect)

Jump to

Keyboard shortcuts

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