model

package
v0.0.0-...-fd49861 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Message

type Message struct {
	Id       string
	UserId   string
	Title    string
	PostedAt string
	UserName string
	Members  []MessageMember
}

type MessageMember

type MessageMember struct {
	UserId    string
	UserName  string
	MessageId string
	PostedAt  string
}

type MessagePost

type MessagePost struct {
	Id        string
	MessageId string
	UserId    string
	Body      string
	PostedAt  string
	UserName  string
}

type NewMessage

type NewMessage struct {
	T Message         `json:"Message"`
	M []MessageMember `json:"MessageMember"`
	P MessagePost     `json:"MessagePost"`
}

type NewThread

type NewThread struct {
	T Thread `json:"Thread"`
	P Post   `json:"Post"`
}

type Post

type Post struct {
	Id       string
	ThreadId string
	UserId   string
	Body     string
	PostedAt string
	UserName string
}

type Registration

type Registration struct {
	Username     string
	EmailAddress string
	Password     string
}

type Thread

type Thread struct {
	Id           string
	UserId       string
	Title        string
	PostedAt     string
	UserName     string
	LastPostedAt string
}

type User

type User struct {
	ID              string
	Username        string
	EmailAddress    string
	Password        []byte
	UserRole        int
	UserPasswordMd5 sql.NullString
	ConfirmCode     string
	Active          bool
}

func (*User) HashPassword

func (u *User) HashPassword(password string) (err error)

HashPassword with return a bcrypt hash of a string.

func (*User) HashPasswordMd5

func (u *User) HashPasswordMd5(password string) (hash [16]byte)

HashPasswordMd5 with return an MD5 hash of a string.

type UserInfo

type UserInfo struct {
	Username     string `json:"username"`
	TotalPosts   string `json:"totalPosts"`
	TotalThreads string `json:"totalThreads"`
	DateJoined   string `json:"dateJoined"`
	LastPosted   string `json:"lastPosted"`
}

UserInfo is for holding information about the user.

Jump to

Keyboard shortcuts

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