model

package
v0.0.0-...-748f5db Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2017 License: MIT Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FullTextSearchResponse

type FullTextSearchResponse struct {
	Users  []*PublicUser `json:"users"`
	Tweets []*Tweet      `json:"tweets"`
}

type GoogleLoginForm

type GoogleLoginForm struct {
	State string `json:"state" binding:"required"`
	Code  string `json:"code" binding:"required"`
}

type LoginForm

type LoginForm struct {
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type LoginResponse

type LoginResponse struct {
	AuthToken    string      `json:"auth_token"`
	RefreshToken string      `json:"refresh_token"`
	User         *PublicUser `json:"user"`
}

type NewTweet

type NewTweet struct {
	AuthorID int64  `json:"-"`
	Content  string `json:"content" binding:"required"`
}

type NewTweetContent

type NewTweetContent struct {
	Content string `json:"content" binding:"required"`
}

type NewUserForm

type NewUserForm struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
	Email    string `json:"email" binding:"required"`
	Name     string `json:"name" binding:"required"`
}

type PublicUser

type PublicUser struct {
	ID            int64  `json:"id"`
	Username      string `json:"username"`
	Name          string `json:"name"`
	AvatarUrl     string `json:"avatar_url"`
	FollowerCount int64  `json:"follower_count"`
	FolloweeCount int64  `json:"followee_count"`
	Following     bool   `json:"following"`
}

type RefreshAuthTokenRequest

type RefreshAuthTokenRequest struct {
	RefreshToken string `json:"refresh_token" binding:"required"`
}

type RefreshAuthTokenResponse

type RefreshAuthTokenResponse struct {
	AuthToken string `json:"auth_token"`
}

type Tweet

type Tweet struct {
	ID           int64       `json:"id"`
	Author       *PublicUser `json:"author"`
	LikeCount    int64       `json:"like_count"`
	RetweetCount int64       `json:"retweet_count"`
	CreatedAt    time.Time   `json:"created_at"`
	Content      string      `json:"content"`
	Liked        bool        `json:"liked"`
	Retweeted    bool        `json:"retweeted"`
}

type User

type User struct {
	ID            int64
	TwitterToken  sql.NullString
	FacebookToken sql.NullString
	GoogleToken   sql.NullString
	Username      string
	Password      string
	Email         string
	CreatedAt     *time.Time
	LastLogin     *time.Time
	Active        bool
	Name          string
	AvatarUrl     sql.NullString
	FollowerCount int64
	FolloweeCount int64
	Following     bool
}

type UserGoogle

type UserGoogle struct {
	Sub           string `json:"sub"`
	Name          string `json:"name"`
	GivenName     string `json:"given_name"`
	FamilyName    string `json:"family_name"`
	Picture       string `json:"picture"`
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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