Documentation ¶
Index ¶
- Constants
- Variables
- func FormatContentMentions(content []byte) []byte
- func ValidatePostTitle(v *revel.Validation, title string) *revel.ValidationResult
- func ValidateProfileDescription(v *revel.Validation, description string) *revel.ValidationResult
- func ValidateProfileName(v *revel.Validation, name string) *revel.ValidationResult
- func ValidateProfilePhotoUrl(v *revel.Validation, photoUrl string) *revel.ValidationResult
- func ValidateProfileSummary(v *revel.Validation, summary string) *revel.ValidationResult
- func ValidateProfileUserName(v *revel.Validation, username string) *revel.ValidationResult
- func ValidateUserEmail(v *revel.Validation, email string) *revel.ValidationResult
- func ValidateUserPassword(v *revel.Validation, password string) *revel.ValidationResult
- type Follower
- type Like
- type Post
- type Profile
- type SimpleJSONResponse
- type Token
- type User
Constants ¶
View Source
const ( DATE_FORMAT = "Jan _2, 2006" SQL_DATE_FORMAT = "2006-01-02" )
Variables ¶
View Source
var EmailRegex = regexp.MustCompile("^[a-z0-9!#$\\%&'*+\\/=?^_`{|}~.-]+@[a-z0-9-]+(\\.[a-z0-9-]+)*$")
View Source
var MentionRegex = regexp.MustCompile(`([\#\@])([A-Za-z0-9]+)`)
View Source
var NameRegex = regexp.MustCompile("^[^#@]+$")
View Source
var UserNameBlacklistRegex = regexp.MustCompile("^(account|contact|about|find|search|public|to(desktop|mobile)|log(in|out)|sign(in|up|out)|register|home|index|default|post(s)?|user(name)?(s)?|i)$")
View Source
var UserNameRegex = regexp.MustCompile("^[a-zA-Z0-9]+$")
Functions ¶
func FormatContentMentions ¶
func ValidatePostTitle ¶
func ValidatePostTitle(v *revel.Validation, title string) *revel.ValidationResult
func ValidateProfileDescription ¶
func ValidateProfileDescription(v *revel.Validation, description string) *revel.ValidationResult
func ValidateProfileName ¶
func ValidateProfileName(v *revel.Validation, name string) *revel.ValidationResult
func ValidateProfilePhotoUrl ¶
func ValidateProfilePhotoUrl(v *revel.Validation, photoUrl string) *revel.ValidationResult
func ValidateProfileSummary ¶
func ValidateProfileSummary(v *revel.Validation, summary string) *revel.ValidationResult
func ValidateProfileUserName ¶
func ValidateProfileUserName(v *revel.Validation, username string) *revel.ValidationResult
func ValidateUserEmail ¶
func ValidateUserEmail(v *revel.Validation, email string) *revel.ValidationResult
func ValidateUserPassword ¶
func ValidateUserPassword(v *revel.Validation, password string) *revel.ValidationResult
Types ¶
type Post ¶
type Post struct { PostId int ProfileId int Title string Content []byte // mediumblob Status string Date string AggregateLikes int // to keep things quick in our app // Transient ContentStr string DateObj time.Time }
func (*Post) Validate ¶
func (post *Post) Validate(v *revel.Validation)
type Profile ¶
type Profile struct { ProfileId int UserId int UserName string Name string Summary string Description string PhotoUrl string AggregateFollowers int AggregateFollowing int // Transient User *User }
func (*Profile) Validate ¶
func (profile *Profile) Validate(v *revel.Validation)
type SimpleJSONResponse ¶
Click to show internal directories.
Click to hide internal directories.