ginger

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2018 License: MIT Imports: 3 Imported by: 0

README

ginger

Core utilities to create a gin app with config, routing, db(qb) and more

Example

package main

import(
    "github.com/slicebit/ginger"
)

type Config struct {
    Host string
    Port int
    Env string
}

func main() {

    config := &Config{}
    err := ginger.NewConfig("config.json", config)
    if err != nil {
        panic(err)
    }

    app, err := ginger.NewApp(config.Host, config.Port, config.Env)
    if err != nil {
        panic(err)
    }

    // Start the app
    app.Start()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApp

func NewApp(host string, port int, env string) (*app.App, error)

NewApp creates a new gin app given config file

func NewConfig

func NewConfig(cfgFile string, cfg interface{}) error

NewConfig creates a new configuration

func NewDB

func NewDB(driver string, dsn string) (*db.Context, error)

NewDB creates a new db context given driver & dsn

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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