database

package
v0.0.0-...-639d8a4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Yes    = 1
	No     = 2
	Error  = 3
	NotSet = 4
)

Variables

View Source
var DatabaseConnected bool

Functions

func AccountExists

func AccountExists(username string) int

func Connect

func Connect() bool

func GetEmail

func GetEmail(username string) (int, string)

func HumanDateTime

func HumanDateTime(eventTime time.Time, location *time.Location) (string, string)

func HumanTimeSince

func HumanTimeSince(eventTime time.Time, location *time.Location) string

func RegisterAccount

func RegisterAccount(username string, password string) int

func VerifyLogin

func VerifyLogin(username string, password string) int

Types

type Account

type Account struct {
	Username string
	Email    string
	Hash     string
	Timezone int
}

type Conversation

type Conversation struct {
	Id         bson.ObjectId `bson:"_id,omitempty"`
	Members    []string
	Group      bool
	LastUpdate time.Time
}

type Message

type Message struct {
	ConversationID string
	Time           time.Time
	Username       string
	SystemMessage  bool
	Content        string
}

Jump to

Keyboard shortcuts

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