go-starter-api

command module
v0.0.0-...-07785dc Latest Latest
Warning

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

Go to latest
Published: May 12, 2019 License: MIT Imports: 6 Imported by: 0

README

go-starter-api

This is an attempt at creating a starter project for creating secure APIs in go-lang.

Consider this a work in progress. Advice and suggestions are welcome, and should be sent via email to mike.cto@securecloudsolutions.io

Creating a User

var err error
newUUID := uuid.Must(uuid.NewV4(), err)
if err != nil {
  panic(err)
}
user := User{
  UUID:     newUUID.String(),
  Username: "bsodmike",
  Email:    "bsodmike@gmail.com",
  Password: "password",
  APIToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.cThIIoDvwdueQB468K5xDc5633seEFoqwxjF_xSJyQQ",
}

db.gormDB.NewRecord(user)
db.gormDB.Create(&user)

Docker (Dev)

User password as the password.

docker-compose up
pgcli -h localhost -p 9001 -U dbuser goapi

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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