コード例 #1
0
ファイル: data.go プロジェクト: gtalent/LiberatorAdventures
/*
 * Copyright 2011 <*****@*****.**>
 * This file is released under the BSD license, as defined here:
 * 	http://www.opensource.org/licenses/bsd-license.php
 */
package char

import "libadv/util"

var Design_characters util.DesignDoc = util.DesignDoc{ID: "_design/characters", Lang: "javascript",
	Views: util.View("all", "function(doc) { if (doc.Type == 'Character')  emit(doc.Name, doc) }")}

type Character struct {
	ID                                        string "_id"
	Rev                                       string "_rev"
	Type                                      string
	Game, Name, World, Alligiance, Bio, Owner string
}

func NewCharacter() Character {
	var data Character
	data.Type = "Character"
	return data
}
コード例 #2
0
ファイル: data.go プロジェクト: gtalent/LiberatorAdventures
/*
 * Copyright 2011 <*****@*****.**>
 * This file is released under the BSD license, as defined here:
 * 	http://www.opensource.org/licenses/bsd-license.php
 */
package posts

import "libadv/util"

//Database views

var Design_posts util.DesignDoc = util.DesignDoc{ID: "_design/posts", Lang: "javascript",
	Views: util.View("all", "function(doc) { if (doc.Type == 'Post')  emit(doc.Title, doc) }")}

type Post struct {
	ID                                  string "_id"
	Rev                                 string "_rev"
	Type                                string
	Title, Author, Owner, Date, Content string
}

//Returns a new Post object by value.
func NewPost() Post {
	var data Post
	data.Type = "Post"
	return data
}
コード例 #3
0
ファイル: data.go プロジェクト: gtalent/LiberatorAdventures
/*
 * Copyright 2011 <*****@*****.**>
 * This file is released under the BSD license, as defined here:
 * 	http://www.opensource.org/licenses/bsd-license.php
 */
package users

import "libadv/util"

var Design_users util.DesignDoc = util.DesignDoc{ID: "_design/users", Lang: "javascript",
	Views: util.View("all", "function(doc) {if (doc.Type == 'User') emit(doc.Username, doc)}")}

type User struct {
	ID              string "_id"
	Rev             string "_rev"
	Type            string
	Username, Email string
	Password        util.Password
}

//Returns a new User object by value.
func NewUser() User {
	var data User
	data.Type = "User"
	return data
}