Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 746 Bytes

README.md

File metadata and controls

45 lines (32 loc) · 746 Bytes

siber

Helper tools for go-chi

Features

  • API Errors
  • Logging Middleware
  • Session Store
  • Encryption Helpers
  • JSON request and body parsing
  • Extensions of faker

Install

go get -u github.com/random-guys/go-siber

Example

// embed basic env in your env struct
type AppEnv struct {
    siber.BasicEnv
}

type Book struct {
    Name `json:"book_nme"`
}

func main() {
    // BasicEnv is only compatible with envconfig ATM
    env := loadEnv()
    logs := NewLogger(env.Name)

    router := chi.NewRouter()
    chix.DefaultMiddleware(env, log, router)
    router.Get("/api/v1/books/:id", func(w http.ResponseWriter, r *http.Request) {

    })

}