go-api

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 2 Imported by: 0

README

go-api

A easy way to implements RESTful API views using Fiber and GORM

Implementation:

Set the enviroment variable to indicates the database: DB_DNS="postgresql://go_api:go_api@localhost:5432/go_api"

# views.go

import "github.com/ikaromn/go-api"


var myModel MyModel
var myModels []MyModel


var MyView = View{
    model:       myModel,
    models:      myModels,
    lookupField: "id",
}

# routes.go

app.Get("/my-view/:id?", MyView.GetAndListView)
app.Post("/my-view/", MyView.CreateView)
app.Patch("/my-view/", MyView.PartialUpdateView)

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