예제 #1
0
package main

import (
	"fmt"
	"math/rand"
	"testing"

	"github.com/cagnosolutions/dbdb"
)

var ds *dbdb.DataStore = dbdb.NewDataStore()

var stores = []string{
	"items",
	"clients",
	"quotes",
	"orders",
	"invoices",
}

type Item struct {
	Sku        int64
	Name, Desc string
	Price      float32
	Count      int64
	Restock    bool
}

type Client struct {
	Name                 []string
	Email, Phone, Gender string
예제 #2
0
func main() {
	ds := dbdb.NewDataStore()
	dbdb.Serve(ds, "0.0.0.0:31337", auth)
}
예제 #3
0
파일: main.go 프로젝트: gregpechiro/lhb-go
	"sort"
	"strconv"
	"strings"

	"github.com/cagnosolutions/dbdb"
	"github.com/cagnosolutions/web"
)

const (
	USERNAME = "******"
	PASSWORD = "******"
)

var mux = web.NewMux()
var tmpl *web.TmplCache
var db = dbdb.NewDataStore()

func init() {
	web.Funcs["split"] = func(s, sep string, i int) string {
		return strings.Split(s, sep)[i]
	}
	web.Funcs["title"] = strings.Title
	tmpl = web.NewTmplCache()
	db.AddStore("image")
	db.AddStore("listing")
}

func main() {

	mux.AddRoutes(home, gallery, about, contact, services, listings, floorPlans, login, logout)