Documentation ¶
Index ¶
- Constants
- Variables
- func AtMostComments(n uint64) uint8
- func AtMostPms(n uint64) uint8
- func AtMostPosts(n uint64) uint8
- func Init() error
- type Ban
- type Blacklist
- type Board
- type BoardInfo
- type Bookmark
- type CommentlistOptions
- type ContactInfo
- type Content
- type Conversation
- type DeletedUser
- type ExistingComment
- type ExistingPost
- type Info
- type Interest
- type Lock
- type Lurk
- type Mention
- type Message
- type OAuth2AccessData
- type OAuth2AuthorizeData
- type OAuth2Client
- type OAuth2RefreshToken
- type PM
- func (pm *PM) ClearDefaults()
- func (pm *PM) ID() uint64
- func (pm *PM) IsEditable() bool
- func (pm *PM) Language() string
- func (pm *PM) NumericOwners() []uint64
- func (pm *PM) NumericReference() uint64
- func (pm *PM) NumericSender() uint64
- func (pm *PM) Owners() (ret []*User)
- func (pm *PM) Reference() Reference
- func (pm *PM) Revisions() (modifications []string)
- func (pm *PM) RevisionsNumber() uint8
- func (pm *PM) Sender() *User
- func (pm *PM) SetLanguage(language string) error
- func (pm *PM) SetReference(id uint64)
- func (pm *PM) SetSender(id uint64)
- func (pm *PM) SetText(message string)
- func (PM) TableName() string
- func (pm *PM) Text() string
- func (pm *PM) Votes() (votes *[]Vote)
- func (pm *PM) VotesCount() int
- type PersonalInfo
- type PmsOptions
- type Post
- type PostClassification
- type PostlistOptions
- type Profile
- type Project
- func (prj *Project) Followers() []*User
- func (prj *Project) ID() uint64
- func (prj *Project) Info() *Info
- func (prj *Project) Language() string
- func (prj *Project) Members() []*User
- func (prj *Project) NumericFollowers() (followers []uint64)
- func (prj *Project) NumericMembers() (members []uint64)
- func (prj *Project) NumericOwner() (owner uint64)
- func (prj *Project) Owner() (owner *User)
- func (prj *Project) Postlist(options PostlistOptions) *[]ExistingPost
- func (prj *Project) ProjectInfo() *ProjectInfo
- func (Project) TableName() string
- type ProjectFollower
- type ProjectInfo
- type ProjectMember
- type ProjectNotify
- type ProjectOwner
- type ProjectPost
- func (post *ProjectPost) Bookmarkers() []*User
- func (post *ProjectPost) Bookmarks() *[]Bookmark
- func (post *ProjectPost) BookmarksCount() (count uint8)
- func (post *ProjectPost) ClearDefaults()
- func (post *ProjectPost) Comments(options CommentlistOptions) *[]ExistingComment
- func (post *ProjectPost) CommentsCount() (count uint8)
- func (post *ProjectPost) ID() uint64
- func (post *ProjectPost) IsClosed() bool
- func (post *ProjectPost) IsEditable() bool
- func (post *ProjectPost) Language() string
- func (post *ProjectPost) Locks() *[]Lock
- func (post *ProjectPost) Lurkers() []*User
- func (post *ProjectPost) LurkersCount() (count uint8)
- func (post *ProjectPost) Lurks() *[]Lurk
- func (post *ProjectPost) NumericBookmarkers() (bookmarkers []uint64)
- func (post *ProjectPost) NumericLurkers() (lurkers []uint64)
- func (post *ProjectPost) NumericOwners() (ret []uint64)
- func (post *ProjectPost) NumericReference() uint64
- func (post *ProjectPost) NumericSender() uint64
- func (*ProjectPost) NumericType() uint8
- func (post *ProjectPost) Owners() (ret []*User)
- func (post *ProjectPost) Reference() Reference
- func (post *ProjectPost) Revisions() (modifications []string)
- func (post *ProjectPost) RevisionsNumber() (count uint8)
- func (post *ProjectPost) Sender() *User
- func (post *ProjectPost) SetLanguage(language string) error
- func (post *ProjectPost) SetReference(id uint64)
- func (post *ProjectPost) SetSender(id uint64)
- func (post *ProjectPost) SetText(message string)
- func (ProjectPost) TableName() string
- func (post *ProjectPost) Text() string
- func (*ProjectPost) Type() string
- func (post *ProjectPost) Votes() *[]Vote
- func (post *ProjectPost) VotesCount() (sum int)
- type ProjectPostBookmark
- type ProjectPostComment
- func (comment *ProjectPostComment) ClearDefaults()
- func (comment *ProjectPostComment) ID() uint64
- func (comment *ProjectPostComment) IsEditable() bool
- func (comment *ProjectPostComment) Language() string
- func (comment *ProjectPostComment) NumericOwners() []uint64
- func (comment *ProjectPostComment) NumericReference() uint64
- func (comment *ProjectPostComment) NumericSender() uint64
- func (comment *ProjectPostComment) Owners() []*User
- func (comment *ProjectPostComment) Post() (ExistingPost, error)
- func (comment *ProjectPostComment) Reference() Reference
- func (comment *ProjectPostComment) Revisions() (modifications []string)
- func (comment *ProjectPostComment) RevisionsNumber() (count uint8)
- func (comment *ProjectPostComment) Sender() *User
- func (comment *ProjectPostComment) SetLanguage(language string) error
- func (comment *ProjectPostComment) SetReference(hpid uint64)
- func (comment *ProjectPostComment) SetSender(id uint64)
- func (comment *ProjectPostComment) SetText(message string)
- func (ProjectPostComment) TableName() string
- func (comment *ProjectPostComment) Text() string
- func (comment *ProjectPostComment) Votes() *[]Vote
- func (comment *ProjectPostComment) VotesCount() (sum int)
- type ProjectPostCommentRevision
- type ProjectPostCommentVote
- func (vote *ProjectPostCommentVote) NumericReference() uint64
- func (vote *ProjectPostCommentVote) NumericSender() uint64
- func (vote *ProjectPostCommentVote) Reference() Reference
- func (vote *ProjectPostCommentVote) Sender() (user *User)
- func (ProjectPostCommentVote) TableName() string
- func (vote *ProjectPostCommentVote) Value() int8
- type ProjectPostCommentsNotify
- type ProjectPostLock
- type ProjectPostLurk
- type ProjectPostRevision
- type ProjectPostUserLock
- type ProjectPostVote
- type Reference
- type SpecialProject
- type SpecialUser
- type TextHolder
- type User
- func (user *User) AddInterest(interest *Interest) error
- func (user *User) Blacklist() []*User
- func (user *User) BlacklistUser(other *User, motivation string) error
- func (user *User) Blacklisting() []*User
- func (user *User) BoardInfo() *BoardInfo
- func (user *User) Bookmark(post ExistingPost) (Bookmark, error)
- func (user *User) CanBookmark(message ExistingPost) bool
- func (user *User) CanComment(message ExistingPost) bool
- func (user *User) CanDelete(message Content) bool
- func (user *User) CanEdit(message Content) bool
- func (user *User) CanLurk(message ExistingPost) bool
- func (user *User) CanSee(board Board) bool
- func (user *User) ContactInfo() *ContactInfo
- func (user *User) Conversations() (*[]Conversation, error)
- func (user *User) Delete(message Content) error
- func (user *User) DeleteConversation(other uint64) error
- func (user *User) DeleteInterest(interest *Interest) error
- func (user *User) Edit(message Content) error
- func (user *User) Follow(board Board) error
- func (user *User) Followers() []*User
- func (user *User) Friends() []*User
- func (user *User) Home(options PostlistOptions) *[]Message
- func (user *User) ID() uint64
- func (user *User) Info() *Info
- func (user *User) Interests() (interests []string)
- func (user *User) Language() string
- func (user *User) LockPost(post ExistingPost, users ...*User) (*[]Lock, error)
- func (user *User) Lurk(post ExistingPost) (Lurk, error)
- func (user *User) NumericBlacklist() (blacklist []uint64)
- func (user *User) NumericBlacklisting() (blacklist []uint64)
- func (user *User) NumericFollowers() (followers []uint64)
- func (user *User) NumericFriends() (friends []uint64)
- func (user *User) NumericProjectFollowing() (following []uint64)
- func (user *User) NumericProjects() (projects []uint64)
- func (user *User) NumericUserFollowing() (following []uint64)
- func (user *User) NumericWhitelist() []uint64
- func (user *User) NumericWhitelisting() (whitelisting []uint64)
- func (user *User) PersonalInfo() *PersonalInfo
- func (user *User) Pms(otherUser uint64, options PmsOptions) (*[]PM, error)
- func (user *User) Postlist(options PostlistOptions) *[]ExistingPost
- func (user *User) ProjectFollowing() []*Project
- func (user *User) ProjectHome(options PostlistOptions) *[]ProjectPost
- func (user *User) Projects() []*Project
- func (user *User) Submit(message Content) error
- func (User) TableName() string
- func (user *User) UnblacklistUser(other *User) error
- func (user *User) Unbookmark(post ExistingPost) error
- func (user *User) Unfollow(board Board) error
- func (user *User) Unlock(post ExistingPost, users ...*User) error
- func (user *User) Unlurk(post ExistingPost) error
- func (user *User) UnwhitelistUser(other *User) error
- func (user *User) UserFollowing() []*User
- func (user *User) UserHome(options PostlistOptions) *[]UserPost
- func (user *User) Vote(message Content, vote int8) (Vote, error)
- func (user *User) Whitelist() []*User
- func (user *User) WhitelistUser(other *User) error
- func (user *User) Whitelisting() []*User
- type UserFollower
- type UserPost
- func (post *UserPost) Bookmarkers() []*User
- func (post *UserPost) Bookmarks() *[]Bookmark
- func (post *UserPost) BookmarksCount() (count uint8)
- func (post *UserPost) ClearDefaults()
- func (post *UserPost) Comments(options CommentlistOptions) *[]ExistingComment
- func (post *UserPost) CommentsCount() (count uint8)
- func (post *UserPost) ID() uint64
- func (post *UserPost) IsClosed() bool
- func (post *UserPost) IsEditable() bool
- func (post *UserPost) Language() string
- func (post *UserPost) Locks() *[]Lock
- func (post *UserPost) Lurkers() []*User
- func (post *UserPost) LurkersCount() (count uint8)
- func (post *UserPost) Lurks() *[]Lurk
- func (post *UserPost) NumericBookmarkers() (bookmarkers []uint64)
- func (post *UserPost) NumericLurkers() (lurkers []uint64)
- func (post *UserPost) NumericOwners() []uint64
- func (post *UserPost) NumericReference() uint64
- func (post *UserPost) NumericSender() uint64
- func (*UserPost) NumericType() uint8
- func (post *UserPost) Owners() (ret []*User)
- func (post *UserPost) Reference() Reference
- func (post *UserPost) Revisions() (modifications []string)
- func (post *UserPost) RevisionsNumber() (count uint8)
- func (post *UserPost) Sender() *User
- func (post *UserPost) SetLanguage(language string) error
- func (post *UserPost) SetReference(id uint64)
- func (post *UserPost) SetSender(id uint64)
- func (post *UserPost) SetText(message string)
- func (UserPost) TableName() string
- func (post *UserPost) Text() string
- func (*UserPost) Type() string
- func (post *UserPost) Votes() *[]Vote
- func (post *UserPost) VotesCount() (sum int)
- type UserPostBookmark
- type UserPostComment
- func (comment *UserPostComment) ClearDefaults()
- func (comment *UserPostComment) ID() uint64
- func (comment *UserPostComment) IsEditable() bool
- func (comment *UserPostComment) Language() string
- func (comment *UserPostComment) NumericOwners() []uint64
- func (comment *UserPostComment) NumericReference() uint64
- func (comment *UserPostComment) NumericSender() uint64
- func (comment *UserPostComment) Owners() []*User
- func (comment *UserPostComment) Post() (ExistingPost, error)
- func (comment *UserPostComment) Reference() Reference
- func (comment *UserPostComment) Revisions() (modifications []string)
- func (comment *UserPostComment) RevisionsNumber() (count uint8)
- func (comment *UserPostComment) Sender() *User
- func (comment *UserPostComment) SetLanguage(language string) error
- func (comment *UserPostComment) SetReference(id uint64)
- func (comment *UserPostComment) SetSender(id uint64)
- func (comment *UserPostComment) SetText(message string)
- func (UserPostComment) TableName() string
- func (comment *UserPostComment) Text() string
- func (comment *UserPostComment) Votes() *[]Vote
- func (comment *UserPostComment) VotesCount() (sum int)
- type UserPostCommentRevision
- type UserPostCommentVote
- func (vote *UserPostCommentVote) NumericReference() uint64
- func (vote *UserPostCommentVote) NumericSender() uint64
- func (vote *UserPostCommentVote) Reference() Reference
- func (vote *UserPostCommentVote) Sender() (user *User)
- func (UserPostCommentVote) TableName() string
- func (vote *UserPostCommentVote) Value() int8
- type UserPostCommentsNotify
- type UserPostLock
- type UserPostLurk
- type UserPostRevision
- type UserPostUserLock
- type UserPostVote
- type Vote
- type Whitelist
Constants ¶
const ( // MinPosts represents the minimum posts number that can be required in a postList MinPosts uint64 = 1 // MaxPosts represents the maximum posts number that can be required in a postList MaxPosts uint64 = 20 // MinComments represents the minimum comments number that can be required in a commentList MinComments uint64 = 1 // MaxComments represents the maximum comments number that can be required in a commentList MaxComments uint64 = 20 )
const ( // UserBoardID constant (of type boardType) makes possible to distinguish a User // board from a Project board UserBoardID boardType = "user" // ProjectBoardID constant (of type boardType) makes possible to distinguish a PROJECT // board from a User board ProjectBoardID boardType = "project" )
const ( // MinPms represents the minimum pms number that can be required in a conversation MinPms uint64 = 1 // MaxPms represents the maximum pms number that can be required in a conversation MaxPms uint64 = 20 )
Variables ¶
var ( // Languages contains the languages supported by the current NERDZ implementation. Languages = utils.StringSet{ "de": struct{}{}, "en": struct{}{}, "hr": struct{}{}, "it": struct{}{}, "pt": struct{}{}, "ro": struct{}{}, } )
Functions ¶
func AtMostComments ¶
AtMostComments returns a uint64 that's the number of comments to be retrieved
func AtMostPosts ¶
AtMostPosts returns a uint8 that's the number of posts to be retrieved
Types ¶
type Ban ¶
type Ban struct { User uint64 Motivation string Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
Ban is the model for the relation ban
type Blacklist ¶
type Blacklist struct { From uint64 To uint64 Motivation string Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
Blacklist is the model for the relation blacklist
type Board ¶
type Board interface { Info() *Info // The return value type of Postlist must be changed by type assertion. Postlist(PostlistOptions) *[]ExistingPost }
Board is the interface that wraps the methods common to every board. Every board has its own Informations and Postlist
type BoardInfo ¶
type BoardInfo struct { Language string IsClosed bool Private bool Whitelist []*User UserScript *url.URL }
BoardInfo is that struct that contains all the informations related to the user's board
type Bookmark ¶
type Bookmark interface {
// contains filtered or unexported methods
}
Bookmark is a generic interface to represent a bookmark
type CommentlistOptions ¶
type CommentlistOptions struct { N uint8 // number of comments to return Older uint64 // if specified, tells to the function that is using this struct to return N comments OLDER (created before) than the comment with the spefified "Older" ID Newer uint64 // if specified, tells to the function that is using this struct to return N comments NEWER (created after) than the comment with the spefified "Newer" ID }
CommentlistOptions is used to specify the options for a list of comments
type ContactInfo ¶
type ContactInfo struct { Website *url.URL GitHub *url.URL Skype string Jabber string Yahoo *mail.Address Facebook *url.URL Twitter *url.URL Steam string }
ContactInfo is the struct that contains all the contact info of an user
type Content ¶
type Content interface { igor.DBModel Reference TextHolder SetSender(uint64) SetReference(uint64) SetLanguage(string) error ClearDefaults() Sender() *User NumericSender() uint64 Reference() Reference NumericReference() uint64 IsEditable() bool NumericOwners() []uint64 Owners() []*User Revisions() []string RevisionsNumber() uint8 VotesCount() int Votes() *[]Vote }
Content represents a generic message used by Nerdz. Implementations: (UserPost, ProjectPost, UserPostComment, ProjectPostComment, Pm)
type Conversation ¶
Conversation represents the details about a single private conversation between two users
type DeletedUser ¶
type DeletedUser struct { Counter uint64 `igor:"primary_key"` Username string Time time.Time `sql:"default:(now() at time zone 'utc')"` Motivation string }
DeletedUser is the model for the relation deleted_users
func (DeletedUser) TableName ¶
func (DeletedUser) TableName() string
TableName returns the table name associated with the structure
type ExistingComment ¶
type ExistingComment interface { Content Post() (ExistingPost, error) }
ExistingComment is the interface that wraps the methods common to every existing comment
type ExistingPost ¶
type ExistingPost interface { Content Comments(CommentlistOptions) *[]ExistingComment CommentsCount() uint8 NumericBookmarkers() []uint64 Bookmarkers() []*User BookmarksCount() uint8 Bookmarks() *[]Bookmark NumericLurkers() []uint64 Lurkers() []*User LurkersCount() uint8 Lurks() *[]Lurk IsClosed() bool NumericType() uint8 Type() string }
ExistingPost is the interface that wraps the methods common to every existing post
type Info ¶
type Info struct { ID uint64 Owner *Info Name string Username string Website *url.URL Image *url.URL Closed bool Type boardType }
Info contains the informations common to every board Used in API output to give user/project basic informations
type Interest ¶
type Interest struct { ID uint64 `igor:"primary_key"` From uint64 Value string Time time.Time `sql:"default:(now() at time zone 'utc')"` }
Interest is the model for the relation interests
type Lock ¶
type Lock interface {
// contains filtered or unexported methods
}
Lock is a generic interface to represent the Lock action
type Lurk ¶
type Lurk interface {
// contains filtered or unexported methods
}
Lurk is a generic interface to represent the Lurk action
type Mention ¶
type Mention struct { ID uint64 `igor:"primary_key"` UHpid uint64 GHpid uint64 From uint64 To uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` ToNotify bool }
Mention is the model for the relation mentions
type OAuth2AccessData ¶
type OAuth2AccessData struct { ID uint64 `igor:"primary_key"` // ClientID references the client that created this token ClientID uint64 // CreatedAt is the instant of creation of the OAuth2AccessToken CreatedAt time.Time `sql:"default:(now() at time zone 'utc')"` // ExpiresIn is the seconds from CreatedAt before this token expires ExpiresIn uint64 // RedirectUri is the RedirectUri associated with the token RedirectURI string // AuthorizeDataID references the AuthorizationData that authorizated this token. Can be null AuthorizeDataID sql.NullInt64 `igor:"column:oauth2_authorize_id"` // Annotation required, since the column name does not follow igor conventions // AccessDataID references the Access Data, for refresh token. Can be null AccessDataID sql.NullInt64 `igor:"column:oauth2_access_id"` // Annotation required, since the column name does not follow igor conventions // RefreshTokenID is the value by which this token can be renewed. Can be null RefreshTokenID sql.NullInt64 // AccessToken is the main value of this tructure, represents the access token AccessToken string // Scope is the requested scope Scope string // UserID is references the User that created The access request and thus the AccessData UserID uint64 }
OAuth2AccessData is the OAuth2 access data
func (OAuth2AccessData) TableName ¶
func (OAuth2AccessData) TableName() string
TableName returns the table name associated with the structure
type OAuth2AuthorizeData ¶
type OAuth2AuthorizeData struct { // Surrogated key ID uint64 `igor:"primary_key"` // ClientID references the client that created this token ClientID uint64 // Code is the Authorization code Code string // CreatedAt is the instant of creation of the OAuth2AuthorizeToken CreatedAt time.Time `sql:"default:(now() at time zone 'utc')"` // ExpiresIn is the seconds from CreatedAt before this token expires ExpiresIn uint64 // State data from request //State string, [!] we dont't store state variables // Scope is the requested scope Scope string // RedirectUri is the RedirectUri associated with the token RedirectURI string // UserID is references the User that created the authorization request and thus the AuthorizeData UserID uint64 }
OAuth2AuthorizeData is the model for the relation oauth2_authorize that represents the authorization granted to to the client
func (OAuth2AuthorizeData) TableName ¶
func (OAuth2AuthorizeData) TableName() string
TableName returns the table name associated with the structure
type OAuth2Client ¶
type OAuth2Client struct { // Surrogated key ID uint64 `igor:"primary_key"` // Real Primary Key. Application (client) name Name string `sql:"UNIQUE"` // Secret is the unique secret associated with a client Secret string `sql:"UNIQUE"` // RedirectURI is the valid redirection URI associated with a client RedirectURI string // UserID references User that created this client UserID uint64 }
OAuth2Client implements the osin.Client interface
func (OAuth2Client) TableName ¶
func (OAuth2Client) TableName() string
TableName returns the table name associated with the structure
type OAuth2RefreshToken ¶
OAuth2RefreshToken is the model for the relation oauth2_refresh
func (OAuth2RefreshToken) TableName ¶
func (OAuth2RefreshToken) TableName() string
TableName returns the table name associated with the structure
type PM ¶
type PM struct { Pmid uint64 `igor:"primary_key"` From uint64 To uint64 Message string Lang string ToRead bool Time time.Time `sql:"default:(now() at time zone 'utc')"` }
PM is the model for the relation pms
func NewPmWhere ¶
NewPmWhere returns the *Pm fetching the first one that matches the description
func (*PM) ClearDefaults ¶
func (pm *PM) ClearDefaults()
ClearDefaults set to the go's default values the fields with default sql values
func (*PM) IsEditable ¶
IsEditable returns true if the pm is editable
func (*PM) NumericOwners ¶
NumericOwners returns a slice of ids of the owner of the pms (the ones that can perform actions)
func (*PM) NumericReference ¶
NumericReference returns the id of the recipient user
func (*PM) NumericSender ¶
NumericSender returns the id of the sender user
func (*PM) RevisionsNumber ¶
RevisionsNumber returns the number of the revisions
func (*PM) SetLanguage ¶
SetLanguage set the language of the pm (useless)
func (*PM) SetReference ¶
SetReference sets the destionation of the pm: user ID
type PersonalInfo ¶
type PersonalInfo struct { IsOnline bool Nation string Timezone string Username string Name string Surname string Gender bool Birthday time.Time Gravatar *url.URL Interests []string Quotes []string Biography string }
PersonalInfo is the struct that contains all the personal info of an user
type PmsOptions ¶
type PmsOptions struct { N uint8 // number of pms to return Older uint64 // if specified, tells to the function that is using this struct to return N pms OLDER (created before) than the pms with the specified "Older" ID Newer uint64 // if specified, tells to the function that is using this struct to return N pms NEWER (created after) than the comment with the spefified "Newer" ID }
PmsOptions represent the configuration used to fetch a Pm list
type Post ¶
type Post struct { Hpid uint64 `igor:"primary_key"` From uint64 To uint64 Pid uint64 `sql:"default:0"` Message string Time time.Time `sql:"default:(now() at time zone 'utc')"` Lang string News bool Closed bool }
Post is the type of a generic post
func (*Post) ProjectPost ¶
func (p *Post) ProjectPost() *ProjectPost
ProjectPost converts the Post to ProjectPost
type PostClassification ¶
type PostClassification struct { ID uint64 `igor:"primary_key"` UHpid uint64 GHpid uint64 Tag string }
PostClassification is the model for the relation posts_classifications
func (PostClassification) TableName ¶
func (PostClassification) TableName() string
TableName returns the table name associated with the structure
type PostlistOptions ¶
type PostlistOptions struct { Model igor.DBModel // igor.DBModel used to apply filter (like language) to avoid conflics while doing joins Following bool // true -> show posts only FROM following Followers bool // true -> show posts only FROM followers Language string // if Language is a valid 2 characters identifier, show posts from users (users selected enabling/disabling following & folowers) speaking that Language N uint8 // number of posts to return Older uint64 // if specified, tells to the function using this struct to return N posts OLDER (created before) than the post with the specified "Older" ID OlderModel igor.DBModel // igor.DBModel required when the older identifier is fetched from a view Newer uint64 // if specified, tells to the function using this struct to return N posts NEWER (created after) the post with the specified "Newer" ID NewerModel igor.DBModel // igor.DBModel required when the newer identifier is fetched from a view }
PostlistOptions is used to specify the options for a list of posts. The 4 fields are documented and can be combined.
If Following = Followers = true -> show posts FROM user that I follow that follow me back (friends) If Older != 0 && Newer != 0 -> find posts BETWEEN this 2 posts
For example: - user.UserHome(&PostlistOptions{Followed: true, Language: "en"}) returns at most the last 20 posts from the english speaking users that I follow. - user.UserHome(&PostlistOptions{Followed: true, Following: true, Language: "it", Older: 90, Newer: 50, N: 10}) returns at most 10 posts, from user's friends, speaking italian, between the posts with hpid 90 and 50
type Profile ¶
type Profile struct { Counter uint64 `igor:"primary_key"` Website string Quotes string Biography string Github string Skype string Jabber string Yahoo string Userscript string Template uint8 MobileTemplate uint8 Dateformat string Facebook string Twitter string Steam string Push bool Pushregtime time.Time `sql:"default:(now() at time zone 'utc')"` Closed bool }
Profile is the model for the relation profiles
type Project ¶
type Project struct { Counter uint64 `igor:"primary_key"` Description string Name string Private bool Photo sql.NullString Website sql.NullString Goal string Visible bool Open bool CreationTime time.Time `sql:"default:(now() at time zone 'utc')"` }
Project is the model for the relation groups
func NewProject ¶
NewProject returns the user with the specified id
func NewProjectWhere ¶
NewProjectWhere returns the first user that matches the description
func (*Project) NumericFollowers ¶
NumericFollowers returns a slice containing the IDs of users that followed this project
func (*Project) NumericMembers ¶
NumericMembers returns a slice containing the IDs of users that are member of this project
func (*Project) NumericOwner ¶
NumericOwner returns the Id of the owner of the project
func (*Project) Postlist ¶
func (prj *Project) Postlist(options PostlistOptions) *[]ExistingPost
Postlist returns the specified posts on the project
func (*Project) ProjectInfo ¶
func (prj *Project) ProjectInfo() *ProjectInfo
ProjectInfo returns a ProjectInfo struct
type ProjectFollower ¶
type ProjectFollower struct { From uint64 To uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` ToNotify bool Counter uint64 `igor:"primary_key"` }
ProjectFollower is the model for the relation groups_followers
func (ProjectFollower) TableName ¶
func (ProjectFollower) TableName() string
TableName returns the table name associated with the structure
type ProjectInfo ¶
type ProjectInfo struct { ID uint64 Owner *User Members []*User NumericMembers []uint64 Followers []*User NumericFollowers []uint64 Description string Name string Photo *url.URL Website *url.URL Goal string Visible bool Private bool Open bool }
ProjectInfo is the struct that contains all the project's informations
type ProjectMember ¶
type ProjectMember struct { From uint64 To uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` ToNotify bool Counter uint64 `igor:"primary_key"` }
ProjectMember is the model for the relation groups_members
func (ProjectMember) TableName ¶
func (ProjectMember) TableName() string
TableName returns the table name associated with the structure
type ProjectNotify ¶
type ProjectNotify struct { From uint64 To uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Hpid uint64 Counter uint64 `igor:"primary_key"` }
ProjectNotify is the model for the relation groups_notify
func (ProjectNotify) TableName ¶
func (ProjectNotify) TableName() string
TableName returns the table name associated with the structure
type ProjectOwner ¶
type ProjectOwner struct { From uint64 To uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` ToNotify bool Counter uint64 `igor:"primary_key"` }
ProjectOwner is the model for the relation groups_owners
func (ProjectOwner) TableName ¶
func (ProjectOwner) TableName() string
TableName returns the table name associated with the structure
type ProjectPost ¶
type ProjectPost struct {
Post
}
ProjectPost is the model for the relation groups_posts
func NewProjectPost ¶
func NewProjectPost(hpid uint64) (*ProjectPost, error)
NewProjectPost initializes a ProjectPost struct
func NewProjectPostWhere ¶
func NewProjectPostWhere(description *ProjectPost) (post *ProjectPost, e error)
NewProjectPostWhere returns the *ProjectPost fetching the first one that matches the description
func (*ProjectPost) Bookmarkers ¶
func (post *ProjectPost) Bookmarkers() []*User
Bookmarks returns a slice of users that bookmarked the post
func (*ProjectPost) Bookmarks ¶
func (post *ProjectPost) Bookmarks() *[]Bookmark
Bookmarks returns a pointer to a slice of Bookmark
func (*ProjectPost) BookmarksCount ¶
func (post *ProjectPost) BookmarksCount() (count uint8)
BookmarksCount returns the number of users that bookmarked the post
func (*ProjectPost) ClearDefaults ¶
func (post *ProjectPost) ClearDefaults()
ClearDefaults set to the go's default values the fields with default sql values
func (*ProjectPost) Comments ¶
func (post *ProjectPost) Comments(options CommentlistOptions) *[]ExistingComment
Comments returns the full comments list, or the selected range of comments Comments(options) returns the comment list, using selected options
func (*ProjectPost) CommentsCount ¶
func (post *ProjectPost) CommentsCount() (count uint8)
CommentsCount returns the number of comment's post
func (*ProjectPost) IsClosed ¶
func (post *ProjectPost) IsClosed() bool
IsClosed reuturns ture if the post is closed
func (*ProjectPost) IsEditable ¶
func (post *ProjectPost) IsEditable() bool
IsEditable returns true if the ProjectPost is editable
func (*ProjectPost) Language ¶
func (post *ProjectPost) Language() string
Language returns the message language
func (*ProjectPost) Locks ¶
func (post *ProjectPost) Locks() *[]Lock
Locks returns a pointer to a slice of Lock
func (*ProjectPost) Lurkers ¶
func (post *ProjectPost) Lurkers() []*User
Lurkers returns a slice of users that are lurking the post
func (*ProjectPost) LurkersCount ¶
func (post *ProjectPost) LurkersCount() (count uint8)
LurkersCount returns the number of users that are lurking the post
func (*ProjectPost) Lurks ¶
func (post *ProjectPost) Lurks() *[]Lurk
Lurks returns a pointer to a slice of Lurk
func (*ProjectPost) NumericBookmarkers ¶
func (post *ProjectPost) NumericBookmarkers() (bookmarkers []uint64)
NumericBookmarkers returns a slice of uint64 representing the ids of the users that bookmarked the post
func (*ProjectPost) NumericLurkers ¶
func (post *ProjectPost) NumericLurkers() (lurkers []uint64)
NumericLurkers returns a slice of uint64 representing the ids of the users that lurked the post
func (*ProjectPost) NumericOwners ¶
func (post *ProjectPost) NumericOwners() (ret []uint64)
NumericOwners returns a slice of ids of the owner of the posts (the ones that can perform actions)
func (*ProjectPost) NumericReference ¶
func (post *ProjectPost) NumericReference() uint64
NumericReference returns the id of the recipient project
func (*ProjectPost) NumericSender ¶
func (post *ProjectPost) NumericSender() uint64
NumericSender returns the id of the sender user
func (*ProjectPost) NumericType ¶
func (*ProjectPost) NumericType() uint8
NumericType returns the numeric type of the post
func (*ProjectPost) Owners ¶
func (post *ProjectPost) Owners() (ret []*User)
Owners returns a slice of *User representing the users who own the post
func (*ProjectPost) Reference ¶
func (post *ProjectPost) Reference() Reference
Reference returns the recipient *Project
func (*ProjectPost) Revisions ¶
func (post *ProjectPost) Revisions() (modifications []string)
Revisions returns all the revisions of the message
func (*ProjectPost) RevisionsNumber ¶
func (post *ProjectPost) RevisionsNumber() (count uint8)
RevisionsNumber returns the number of the revisions
func (*ProjectPost) Sender ¶
func (post *ProjectPost) Sender() *User
Sender returns the sender *User
func (*ProjectPost) SetLanguage ¶
func (post *ProjectPost) SetLanguage(language string) error
SetLanguage set the language of the post
func (*ProjectPost) SetReference ¶
func (post *ProjectPost) SetReference(id uint64)
SetReference set the destionation of the post. Project ID
func (*ProjectPost) SetSender ¶
func (post *ProjectPost) SetSender(id uint64)
SetSender set the source of the post (the user ID)
func (*ProjectPost) SetText ¶
func (post *ProjectPost) SetText(message string)
SetText set the text of the message
func (ProjectPost) TableName ¶
func (ProjectPost) TableName() string
TableName returns the table name associated with the structure
func (*ProjectPost) Type ¶
func (*ProjectPost) Type() string
Type returns a string representing the post type
func (*ProjectPost) Votes ¶
func (post *ProjectPost) Votes() *[]Vote
Votes returns a pointer to a slice of Vote
func (*ProjectPost) VotesCount ¶
func (post *ProjectPost) VotesCount() (sum int)
Votes returns the post's votes value
type ProjectPostBookmark ¶
type ProjectPostBookmark struct { Hpid uint64 From uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
ProjectPostBookmark is the model for the relation groups_bookmarks
func (*ProjectPostBookmark) NumericReference ¶
func (bookmark *ProjectPostBookmark) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*ProjectPostBookmark) NumericSender ¶
func (bookmark *ProjectPostBookmark) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*ProjectPostBookmark) Reference ¶
func (bookmark *ProjectPostBookmark) Reference() Reference
Reference returns the reference of the bookmark
func (*ProjectPostBookmark) Sender ¶
func (bookmark *ProjectPostBookmark) Sender() (user *User)
Sender returns the User that casted the bookmark
func (ProjectPostBookmark) TableName ¶
func (ProjectPostBookmark) TableName() string
TableName returns the table name associated with the structure
type ProjectPostComment ¶
type ProjectPostComment struct { Hcid uint64 `igor:"primary_key"` Hpid uint64 From uint64 To uint64 Message string Lang string Time time.Time `sql:"default:(now() at time zone 'utc')"` Editable bool `sql:"default:true"` }
ProjectPostComment is the model for the relation groups_comments
func NewProjectPostComment ¶
func NewProjectPostComment(hcid uint64) (comment *ProjectPostComment, e error)
NewProjectPostComment initializes a ProjectPostComment struct
func NewProjectPostCommentWhere ¶
func NewProjectPostCommentWhere(description *ProjectPostComment) (comment *ProjectPostComment, e error)
NewProjectPostCommentWhere returns the *ProjectPostComment fetching the first one that matches the description
func (*ProjectPostComment) ClearDefaults ¶
func (comment *ProjectPostComment) ClearDefaults()
ClearDefaults set to the go's default values the fields with default sql values
func (*ProjectPostComment) ID ¶
func (comment *ProjectPostComment) ID() uint64
ID returns the comment ID
func (*ProjectPostComment) IsEditable ¶
func (comment *ProjectPostComment) IsEditable() bool
IsEditable returns true if the comment is editable
func (*ProjectPostComment) Language ¶
func (comment *ProjectPostComment) Language() string
Language returns the message language
func (*ProjectPostComment) NumericOwners ¶
func (comment *ProjectPostComment) NumericOwners() []uint64
NumericOwners returns a slice of ids of the owner of the comment (the ones that can perform actions)
func (*ProjectPostComment) NumericReference ¶
func (comment *ProjectPostComment) NumericReference() uint64
NumericReference returns the id of the recipient Post
func (*ProjectPostComment) NumericSender ¶
func (comment *ProjectPostComment) NumericSender() uint64
NumericSender returns the id of the sender user
func (*ProjectPostComment) Owners ¶
func (comment *ProjectPostComment) Owners() []*User
Owners returns a slice of *User representing the users who own the comment
func (*ProjectPostComment) Post ¶
func (comment *ProjectPostComment) Post() (ExistingPost, error)
Post returns the ExistingPost sturct to which the projectComment is related
func (*ProjectPostComment) Reference ¶
func (comment *ProjectPostComment) Reference() Reference
Reference returns the recipient *ProjectPost
func (*ProjectPostComment) Revisions ¶
func (comment *ProjectPostComment) Revisions() (modifications []string)
Revisions returns all the revisions of the message
func (*ProjectPostComment) RevisionsNumber ¶
func (comment *ProjectPostComment) RevisionsNumber() (count uint8)
RevisionsNumber returns the number of the revisions
func (*ProjectPostComment) Sender ¶
func (comment *ProjectPostComment) Sender() *User
Sender returns the sender *User
func (*ProjectPostComment) SetLanguage ¶
func (comment *ProjectPostComment) SetLanguage(language string) error
SetLanguage set the language of the comment
func (*ProjectPostComment) SetReference ¶
func (comment *ProjectPostComment) SetReference(hpid uint64)
SetReference set the destination of the comment
func (*ProjectPostComment) SetSender ¶
func (comment *ProjectPostComment) SetSender(id uint64)
SetSender set the source of the comment (the user ID)
func (*ProjectPostComment) SetText ¶
func (comment *ProjectPostComment) SetText(message string)
SetText set the text of the message
func (ProjectPostComment) TableName ¶
func (ProjectPostComment) TableName() string
TableName returns the table name associated with the structure
func (*ProjectPostComment) Text ¶
func (comment *ProjectPostComment) Text() string
Text returns the post message
func (*ProjectPostComment) Votes ¶
func (comment *ProjectPostComment) Votes() *[]Vote
Votes returns a pointer to a slice of Vote
func (*ProjectPostComment) VotesCount ¶
func (comment *ProjectPostComment) VotesCount() (sum int)
Votes returns the post's votes value
type ProjectPostCommentRevision ¶
type ProjectPostCommentRevision struct { Hcid uint64 Message string Time time.Time `sql:"default:(now() at time zone 'utc')"` RevNo uint16 Counter uint64 `igor:"primary_key"` }
ProjectPostCommentRevision is the model for the relation groups_comments_revisions
func (ProjectPostCommentRevision) TableName ¶
func (ProjectPostCommentRevision) TableName() string
TableName returns the table name associated with the structure
type ProjectPostCommentVote ¶
type ProjectPostCommentVote struct { Hcid uint64 From uint64 To uint64 Vote int8 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
ProjectPostCommentVote is the model for the relation groups_comment_thumbs
func (*ProjectPostCommentVote) NumericReference ¶
func (vote *ProjectPostCommentVote) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*ProjectPostCommentVote) NumericSender ¶
func (vote *ProjectPostCommentVote) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*ProjectPostCommentVote) Reference ¶
func (vote *ProjectPostCommentVote) Reference() Reference
Reference returns the reference of the vote
func (*ProjectPostCommentVote) Sender ¶
func (vote *ProjectPostCommentVote) Sender() (user *User)
Sender returns the User that casted the vote
func (ProjectPostCommentVote) TableName ¶
func (ProjectPostCommentVote) TableName() string
TableName returns the table name associated with the structure
func (*ProjectPostCommentVote) Value ¶
func (vote *ProjectPostCommentVote) Value() int8
Value returns the vote's value
type ProjectPostCommentsNotify ¶
type ProjectPostCommentsNotify struct { From uint64 To uint64 Hpid uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
ProjectPostCommentsNotify is the model for the relation groups_comments_notify
func (ProjectPostCommentsNotify) TableName ¶
func (ProjectPostCommentsNotify) TableName() string
TableName returns the table name associated with the structure
type ProjectPostLock ¶
type ProjectPostLock struct { User uint64 Hpid uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
ProjectPostLock is the model for the relation groups_posts_no_notify
func (*ProjectPostLock) NumericReference ¶
func (lock *ProjectPostLock) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*ProjectPostLock) NumericSender ¶
func (lock *ProjectPostLock) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*ProjectPostLock) Reference ¶
func (lock *ProjectPostLock) Reference() Reference
Reference returns the reference of the lurk
func (*ProjectPostLock) Sender ¶
func (lock *ProjectPostLock) Sender() (user *User)
Sender returns the User that casted the lock
func (ProjectPostLock) TableName ¶
func (ProjectPostLock) TableName() string
TableName returns the table name associated with the structure
type ProjectPostLurk ¶
type ProjectPostLurk struct { Hpid uint64 From uint64 To uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
ProjectPostLurk is the model for the relation groups_lurkers
func (*ProjectPostLurk) NumericReference ¶
func (lurk *ProjectPostLurk) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*ProjectPostLurk) NumericSender ¶
func (lurk *ProjectPostLurk) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*ProjectPostLurk) Reference ¶
func (lurk *ProjectPostLurk) Reference() Reference
Reference returns the reference of the lurk
func (*ProjectPostLurk) Sender ¶
func (lurk *ProjectPostLurk) Sender() (user *User)
Sender returns the User that casted the lurk
func (ProjectPostLurk) TableName ¶
func (ProjectPostLurk) TableName() string
TableName returns the table name associated with the structure
type ProjectPostRevision ¶
type ProjectPostRevision struct { Hpid uint64 Message string Time time.Time `sql:"default:(now() at time zone 'utc')"` RevNo uint16 Counter uint64 `igor:"primary_key"` }
ProjectPostRevision is the model for the relation groups_posts_revisions
func (ProjectPostRevision) TableName ¶
func (ProjectPostRevision) TableName() string
TableName returns the table name associated with the structure
type ProjectPostUserLock ¶
type ProjectPostUserLock struct { From uint64 To uint64 Hpid uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
ProjectPostUserLock is the model for the relation groups_comments_no_notify
func (*ProjectPostUserLock) NumericReference ¶
func (lock *ProjectPostUserLock) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*ProjectPostUserLock) NumericSender ¶
func (lock *ProjectPostUserLock) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*ProjectPostUserLock) Reference ¶
func (lock *ProjectPostUserLock) Reference() Reference
Reference returns the reference of the lurk
func (*ProjectPostUserLock) Sender ¶
func (lock *ProjectPostUserLock) Sender() (user *User)
Sender returns the User that casted the lock
func (ProjectPostUserLock) TableName ¶
func (ProjectPostUserLock) TableName() string
TableName returns the table name associated with the structure
type ProjectPostVote ¶
type ProjectPostVote struct { Hpid uint64 From uint64 To uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Vote int8 Counter uint64 `igor:"primary_key"` }
ProjectPostVote is the model for the relation groups_thumbs
func (*ProjectPostVote) NumericReference ¶
func (vote *ProjectPostVote) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*ProjectPostVote) NumericSender ¶
func (vote *ProjectPostVote) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*ProjectPostVote) Reference ¶
func (vote *ProjectPostVote) Reference() Reference
Reference returns the reference of the vote
func (*ProjectPostVote) Sender ¶
func (vote *ProjectPostVote) Sender() (user *User)
Sender returns the User that casted the vote
func (ProjectPostVote) TableName ¶
func (ProjectPostVote) TableName() string
TableName returns the table name associated with the structure
func (*ProjectPostVote) Value ¶
func (vote *ProjectPostVote) Value() int8
Value returns the vote's value
type Reference ¶
Reference represents a reference. A comment refers to a user/project post A post, refers to a user/project board
type SpecialProject ¶
SpecialProject is the model for the relation special_groups
func (SpecialProject) TableName ¶
func (SpecialProject) TableName() string
TableName returns the table name associated with the structure
type SpecialUser ¶
SpecialUser is the model for the relation special_users
func (SpecialUser) TableName ¶
func (SpecialUser) TableName() string
TableName returns the table name associated with the structure
type TextHolder ¶
TextHolder represents a text-based type
type User ¶
type User struct { Counter uint64 `igor:"primary_key"` Last time.Time `sql:"default:(now() at time zone 'utc')"` NotifyStory igor.JSON `sql:"default:'{}'::jsonb"` Private bool Lang string Username string Password string RemoteAddr string HTTPUserAgent string `igor:"column:http_user_agent"` Email string Name string Surname string Gender bool BirthDate time.Time `sql:"default:(now() at time zone 'utc')"` BoardLang string Timezone string Viewonline bool RegistrationTime time.Time `sql:"default:(now() at time zone 'utc')"` // Relation. Manually fill the field when required Profile Profile `sql:"-"` }
User is the model for the relation users
func Login ¶
Login initializes a User struct if login (id | email | username) and password are correct
func NewUserWhere ¶
NewUserWhere returns the first user that matches the description
func (*User) AddInterest ¶
AddInterest adds the specified interest. An error is returned if the interests already exists or some DBMS contraint is violated
func (*User) Blacklist ¶
Blacklist returns a slice of users that user (*Project) put in his blacklist
func (*User) BlacklistUser ¶
BlacklistUser add other user to the user blacklist
func (*User) Blacklisting ¶
Blacklisting returns a slice of users that puts user (*User) in their blacklist
func (*User) Bookmark ¶
func (user *User) Bookmark(post ExistingPost) (Bookmark, error)
Bookmark bookmarks the specified post by a specific user. An error is returned if the post isn't defined or if there are other errors returned by the DBMS
func (*User) CanBookmark ¶
func (user *User) CanBookmark(message ExistingPost) bool
CanBookmark returns true if user haven't bookamrked to existingPost yet
func (*User) CanComment ¶
func (user *User) CanComment(message ExistingPost) bool
CanComment returns true if the user can comment to the existingPost
func (*User) CanLurk ¶
func (user *User) CanLurk(message ExistingPost) bool
CanLurk returns true if the user haven't lurked the existingPost yet
func (*User) ContactInfo ¶
func (user *User) ContactInfo() *ContactInfo
ContactInfo returns a *ContactInfo struct
func (*User) Conversations ¶
func (user *User) Conversations() (*[]Conversation, error)
Conversations returns all the private conversations done by the user
func (*User) DeleteConversation ¶
DeleteConversation deletes the conversation of user with other user
func (*User) DeleteInterest ¶
DeleteInterest removes the specified interest (by its ID or its Value).
func (*User) Follow ¶
Follow creates a new "follow" relationship between the current user and another NERDZ board. The board could represent a NERDZ's project or another NERDZ's user.
func (*User) Home ¶
func (user *User) Home(options PostlistOptions) *[]Message
Home returns a slice of Post representing the user home. Posts are filtered by specified options.
func (*User) LockPost ¶
func (user *User) LockPost(post ExistingPost, users ...*User) (*[]Lock, error)
LockPost lockes the specified post. If users are present, indiidual notifications are disabled from the user presents in the users list.
func (*User) Lurk ¶
func (user *User) Lurk(post ExistingPost) (Lurk, error)
Lurk lurkes the specified post by a specific user. An error is returned if the post isn't defined or if there are other errors returned by the DBMS
func (*User) NumericBlacklist ¶
NumericBlacklist returns a slice containing the counters (IDs) of blacklisted user
func (*User) NumericBlacklisting ¶
NumericBlacklisting returns a slice containing the IDs of users that puts user (*User) in their blacklist
func (*User) NumericFollowers ¶
NumericFollowers returns a slice containing the IDs of User that are user's followers
func (*User) NumericFriends ¶
NumericFriends returns a slice containing the IDs of Users that are user's friends (follows each other)
func (*User) NumericProjectFollowing ¶
NumericProjectFollowing returns a slice containing the IDs of Project that user (User *) is following
func (*User) NumericProjects ¶
NumericProjects returns a slice containing the IDs of the projects owned by user
func (*User) NumericUserFollowing ¶
NumericUserFollowing returns a slice containing the IDs of User that user (User *) is following
func (*User) NumericWhitelist ¶
NumericWhitelist returns a slice containing the IDs of users that are in user whitelist
func (*User) NumericWhitelisting ¶
NumericWhitelisting returns a slice containing thr IDs of users that whitelisted the user
func (*User) PersonalInfo ¶
func (user *User) PersonalInfo() *PersonalInfo
PersonalInfo returns a *PersonalInfo struct
func (*User) Pms ¶
func (user *User) Pms(otherUser uint64, options PmsOptions) (*[]PM, error)
Pms returns a slice of Pm, representing the list of the last messages exchanged with other users
func (*User) Postlist ¶
func (user *User) Postlist(options PostlistOptions) *[]ExistingPost
Postlist returns the specified slice of post on the user board
func (*User) ProjectFollowing ¶
ProjectFollowing returns a slice of Project that user (User *) is following
func (*User) ProjectHome ¶
func (user *User) ProjectHome(options PostlistOptions) *[]ProjectPost
ProjectHome returns a slice of ProjectPost selected by options
func (*User) UnblacklistUser ¶
UnblacklistUser removes other user to the user blacklist
func (*User) Unbookmark ¶
func (user *User) Unbookmark(post ExistingPost) error
Unbookmark the specified post by a specific user. An error is returned if the post isn't defined or if there are other errors returned by the DBMS
func (*User) Unfollow ¶
Unfollow delete a "follow" relationship between the current user and another NERDZ board. The board could represent a NERDZ's project or another NERDZ's user.
func (*User) Unlock ¶
func (user *User) Unlock(post ExistingPost, users ...*User) error
Unlock the specified post by a specific user. An error is returned if the post isn't defined or if there are other errors returned by the DBMS
func (*User) Unlurk ¶
func (user *User) Unlurk(post ExistingPost) error
Unlurk the specified post by a specific user. An error is returned if the post isn't defined or if there are other errors returned by the DBMS
func (*User) UnwhitelistUser ¶
UnwhitelistUser removes other user to the user whitelist
func (*User) UserFollowing ¶
UserFollowing returns a slice of User that user (User *) is following
func (*User) UserHome ¶
func (user *User) UserHome(options PostlistOptions) *[]UserPost
UserHome returns a slice of UserPost specified by options
func (*User) Vote ¶
Vote express a positive/negative preference for a post or comment. Returns the vote if everything went ok
func (*User) WhitelistUser ¶
WhitelistUser add other user to the user whitelist
func (*User) Whitelisting ¶
Whitelisting returns a slice of users that whitelisted the user
type UserFollower ¶
type UserFollower struct { From uint64 To uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` ToNotify bool Counter uint64 `igor:"primary_key"` }
UserFollower is the model for the relation followers
func (UserFollower) TableName ¶
func (UserFollower) TableName() string
TableName returns the table name associated with the structure
type UserPost ¶
type UserPost struct {
Post
}
UserPost is the model for the relation posts
func NewUserPost ¶
NewUserPost returns the *UserPost with id hpid if exists. Returns error otherwise
func NewUserPostWhere ¶
NewUserPostWhere returns the *UserPost fetching the first one that matches the description
func (*UserPost) Bookmarkers ¶
Bookmarkers returns a slice of users that bookmarked the post
func (*UserPost) BookmarksCount ¶
BookmarksCount returns the number of users that bookmarked the post
func (*UserPost) ClearDefaults ¶
func (post *UserPost) ClearDefaults()
ClearDefaults set to the go's default values the fields with default sql values
func (*UserPost) Comments ¶
func (post *UserPost) Comments(options CommentlistOptions) *[]ExistingComment
Comments returns the full comments list, or the selected range of comments Comments(options) returns the comment list, using selected options
func (*UserPost) CommentsCount ¶
CommentsCount returns the number of comment's post
func (*UserPost) IsEditable ¶
IsEditable returns true if the post is editable
func (*UserPost) LurkersCount ¶
LurkersCount returns the number of users that are lurking the post
func (*UserPost) NumericBookmarkers ¶
NumericBookmarkers returns a slice of uint64 representing the ids of the users that bookmarked the post
func (*UserPost) NumericLurkers ¶
NumericLurkers returns a slice of uint64 representing the ids of the users that lurked the post
func (*UserPost) NumericOwners ¶
NumericOwners returns a slice of ids of the owner of the posts (the ones that can perform actions)
func (*UserPost) NumericReference ¶
NumericReference returns the id of the recipient user
func (*UserPost) NumericSender ¶
NumericSender returns the id of the sender user
func (*UserPost) NumericType ¶
NumericType returns the numeric type of the post
func (*UserPost) RevisionsNumber ¶
RevisionsNumber returns the number of the revisions
func (*UserPost) SetLanguage ¶
SetLanguage set the language of the post
func (*UserPost) SetReference ¶
SetReference sets the destionation of the post: user ID
func (*UserPost) VotesCount ¶
VotesCount returns the post's votes value
type UserPostBookmark ¶
type UserPostBookmark struct { Hpid uint64 From uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
UserPostBookmark is the model for the relation bookmarks
func (*UserPostBookmark) NumericReference ¶
func (bookmark *UserPostBookmark) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*UserPostBookmark) NumericSender ¶
func (bookmark *UserPostBookmark) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*UserPostBookmark) Reference ¶
func (bookmark *UserPostBookmark) Reference() Reference
Reference returns the reference of the bookmark
func (*UserPostBookmark) Sender ¶
func (bookmark *UserPostBookmark) Sender() (user *User)
Sender returns the User that casted the bookmark
func (UserPostBookmark) TableName ¶
func (UserPostBookmark) TableName() string
TableName returns the table name associated with the structure
type UserPostComment ¶
type UserPostComment struct { Hcid uint64 `igor:"primary_key"` Hpid uint64 From uint64 To uint64 Message string Lang string Time time.Time `sql:"default:(now() at time zone 'utc')"` Editable bool `sql:"default:true"` }
UserPostComment is the model for the relation comments
func NewUserPostComment ¶
func NewUserPostComment(hcid uint64) (comment *UserPostComment, e error)
NewUserPostComment initializes a UserPostComment struct
func NewUserPostCommentWhere ¶
func NewUserPostCommentWhere(description *UserPostComment) (comment *UserPostComment, e error)
NewUserPostCommentWhere returns the *UserPostComment fetching the first one that matches the description
func (*UserPostComment) ClearDefaults ¶
func (comment *UserPostComment) ClearDefaults()
ClearDefaults set to the go's default values the fields with default sql values
func (*UserPostComment) ID ¶
func (comment *UserPostComment) ID() uint64
ID returns the UserPostComment ID
func (*UserPostComment) IsEditable ¶
func (comment *UserPostComment) IsEditable() bool
IsEditable returns true if the comment is editable
func (*UserPostComment) Language ¶
func (comment *UserPostComment) Language() string
Language returns the message language
func (*UserPostComment) NumericOwners ¶
func (comment *UserPostComment) NumericOwners() []uint64
NumericOwners returns a slice of ids of the owner of the comment (the ones that can perform actions)
func (*UserPostComment) NumericReference ¶
func (comment *UserPostComment) NumericReference() uint64
NumericReference returns the id of the recipient Post
func (*UserPostComment) NumericSender ¶
func (comment *UserPostComment) NumericSender() uint64
NumericSender returns the id of the sender user
func (*UserPostComment) Owners ¶
func (comment *UserPostComment) Owners() []*User
Owners returns a slice of *User representing the users who own the comment
func (*UserPostComment) Post ¶
func (comment *UserPostComment) Post() (ExistingPost, error)
Post returns the ExistingPost struct to which the comment is related
func (*UserPostComment) Reference ¶
func (comment *UserPostComment) Reference() Reference
Reference returns the recipient *Post
func (*UserPostComment) Revisions ¶
func (comment *UserPostComment) Revisions() (modifications []string)
Revisions returns all the revisions of the message
func (*UserPostComment) RevisionsNumber ¶
func (comment *UserPostComment) RevisionsNumber() (count uint8)
RevisionsNumber returns the number of the revisions
func (*UserPostComment) Sender ¶
func (comment *UserPostComment) Sender() *User
Sender returns the sender *User
func (*UserPostComment) SetLanguage ¶
func (comment *UserPostComment) SetLanguage(language string) error
SetLanguage set the language of the comment
func (*UserPostComment) SetReference ¶
func (comment *UserPostComment) SetReference(id uint64)
SetReference sets the destination of the comment (the post ID)
func (*UserPostComment) SetSender ¶
func (comment *UserPostComment) SetSender(id uint64)
SetSender sets the source of the comment (the user ID)
func (*UserPostComment) SetText ¶
func (comment *UserPostComment) SetText(message string)
SetText set the text of the message
func (UserPostComment) TableName ¶
func (UserPostComment) TableName() string
TableName returns the table name associated with the structure
func (*UserPostComment) Text ¶
func (comment *UserPostComment) Text() string
Text returns the post message
func (*UserPostComment) Votes ¶
func (comment *UserPostComment) Votes() *[]Vote
Votes returns a pointer to a slice of Vote
func (*UserPostComment) VotesCount ¶
func (comment *UserPostComment) VotesCount() (sum int)
Votes returns the post's votes value
type UserPostCommentRevision ¶
type UserPostCommentRevision struct { Hcid uint64 Message string Time time.Time `sql:"default:(now() at time zone 'utc')"` RevNo int8 Counter uint64 `igor:"primary_key"` }
UserPostCommentRevision is the model for the relation comments_revisions
func (UserPostCommentRevision) TableName ¶
func (UserPostCommentRevision) TableName() string
TableName returns the table name associated with the structure
type UserPostCommentVote ¶
type UserPostCommentVote struct { Hcid uint64 From uint64 Vote int8 Counter uint64 `igor:"primary_key"` }
UserPostCommentVote is the model for the relation groups_comment_thumbs
func (*UserPostCommentVote) NumericReference ¶
func (vote *UserPostCommentVote) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*UserPostCommentVote) NumericSender ¶
func (vote *UserPostCommentVote) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*UserPostCommentVote) Reference ¶
func (vote *UserPostCommentVote) Reference() Reference
Reference returns the reference of the vote
func (*UserPostCommentVote) Sender ¶
func (vote *UserPostCommentVote) Sender() (user *User)
Sender returns the User that casted the vote
func (UserPostCommentVote) TableName ¶
func (UserPostCommentVote) TableName() string
TableName returns the table name associated with the structure
func (*UserPostCommentVote) Value ¶
func (vote *UserPostCommentVote) Value() int8
Value returns the vote's value
type UserPostCommentsNotify ¶
type UserPostCommentsNotify struct { From uint64 To uint64 Hpid uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
UserPostCommentsNotify is the model for the relation comments_notify
func (UserPostCommentsNotify) TableName ¶
func (UserPostCommentsNotify) TableName() string
TableName returns the table name associated with the structure
type UserPostLock ¶
type UserPostLock struct { User uint64 Hpid uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
UserPostLock is the model for the relation posts_no_notify
func (*UserPostLock) NumericReference ¶
func (lock *UserPostLock) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*UserPostLock) NumericSender ¶
func (lock *UserPostLock) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*UserPostLock) Reference ¶
func (lock *UserPostLock) Reference() Reference
Reference returns the reference of the lurk
func (*UserPostLock) Sender ¶
func (lock *UserPostLock) Sender() (user *User)
Sender returns the User that casted the lock
func (UserPostLock) TableName ¶
func (UserPostLock) TableName() string
TableName returns the table name associated with the structure
type UserPostLurk ¶
type UserPostLurk struct { Hpid uint64 From uint64 To uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
UserPostLurk is the model for the relation lurkers
func (*UserPostLurk) NumericReference ¶
func (lurk *UserPostLurk) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*UserPostLurk) NumericSender ¶
func (lurk *UserPostLurk) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*UserPostLurk) Reference ¶
func (lurk *UserPostLurk) Reference() Reference
Reference returns the reference of the lurk
func (*UserPostLurk) Sender ¶
func (lurk *UserPostLurk) Sender() (user *User)
Sender returns the User that casted the lurk
func (UserPostLurk) TableName ¶
func (UserPostLurk) TableName() string
TableName returns the table name associated with the structure
type UserPostRevision ¶
type UserPostRevision struct { Hpid uint64 Message string Time time.Time `sql:"default:(now() at time zone 'utc')"` RevNo uint16 Counter uint64 `igor:"primary_key"` }
UserPostRevision is the model for the relation posts_revisions
func (UserPostRevision) TableName ¶
func (UserPostRevision) TableName() string
TableName returns the table name associated with the structure
type UserPostUserLock ¶
type UserPostUserLock struct { From uint64 To uint64 Hpid uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
UserPostUserLock is the model for the relation comments_no_notify
func (*UserPostUserLock) NumericReference ¶
func (lock *UserPostUserLock) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*UserPostUserLock) NumericSender ¶
func (lock *UserPostUserLock) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*UserPostUserLock) Reference ¶
func (lock *UserPostUserLock) Reference() Reference
Reference returns the reference of the lurk
func (*UserPostUserLock) Sender ¶
func (lock *UserPostUserLock) Sender() (user *User)
Sender returns the User that casted the lock
func (UserPostUserLock) TableName ¶
func (UserPostUserLock) TableName() string
TableName returns the table name associated with the structure
type UserPostVote ¶
type UserPostVote struct { Hpid uint64 From uint64 To uint64 Vote int8 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
UserPostVote is the model for the relation votes
func (*UserPostVote) NumericReference ¶
func (vote *UserPostVote) NumericReference() uint64
NumericReference returns the numeric ID of the reference
func (*UserPostVote) NumericSender ¶
func (vote *UserPostVote) NumericSender() uint64
NumericSender returns the ID of the Sender
func (*UserPostVote) Reference ¶
func (vote *UserPostVote) Reference() Reference
Reference returns the reference of the vote
func (*UserPostVote) Sender ¶
func (vote *UserPostVote) Sender() (user *User)
Sender returns the User that casted the vote
func (UserPostVote) TableName ¶
func (UserPostVote) TableName() string
TableName returns the table name associated with the structure
type Vote ¶
type Vote interface { Value() int8 // contains filtered or unexported methods }
Vote is a generic interface to represent a vote
Source Files ¶
- board.go
- config.go
- db.go
- language.go
- messages.go
- models.go
- pm.go
- project.go
- project_post.go
- project_post_comment.go
- project_post_comment_relations.go
- project_post_relations.go
- types.go
- user.go
- user_actions.go
- user_post.go
- user_post_comment.go
- user_post_comment_relations.go
- user_post_relations.go
- utils.go