domain

package
v0.0.0-...-90507f3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2014 License: GPL-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserDomain    = &userDomain{db.C("users")}
	ChannelDomain = &channelDomain{db.C("channels")}
	MessageDomain = &messageDomain{db.C("messages")}
)

Functions

func AuthenticationMiddleware

func AuthenticationMiddleware(req *http.Request, context martini.Context, r render.Render)

Check Authorization token

Types

type AuthenticationRequest

type AuthenticationRequest struct {
	Username string `binding:"required"`
	Password string `binding:"required"`
}

type Channel

type Channel struct {
	Uid         string    `json:"uid"`
	Name        string    `json:"name",binding:"required"`
	Description string    `json:"description",binding:"required"`
	Private     bool      `json:"isPrivate",binding:"required"`
	CreatedBy   UserUid   `json:"createdBy"` // the user UID of the admin
	Members     []UserUid `json:"members"`
}

type Message

type Message struct {
	Uid        string    `json:"uid"`
	ChannelId  string    `json:"channelId",binding:"required"`
	UserId     UserUid   `json:"userId"`
	Text       string    `json:"text",binding:"required"`
	HasImage   bool      `json:"hasImage",omitempty`
	Attachment string    `json:"attachment",omitempty`
	Timestamp  time.Time `json:"timestamp"` // Unix time, in seconds
	IsAdminMsg bool      `json:"isAdminMsg",omitempty`
	IsHtml     bool      `json:"isHtml",omitempty`
}

type NewUser

type NewUser struct {
	Email    string `binding:"required"`
	Username string `binding:"required"`
	Password string `binding:"required"`
}

type User

type User struct {
	Uid          UserUid `json:"uid"`
	Email        string  `json:"email"`
	Username     string  `json:"username"`
	PasswordHash string  `json:"passwordHash,omitempty"`
	GravatarHash string  `json:"gravatarHash"`
}

type UserUid

type UserUid string

Jump to

Keyboard shortcuts

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