Documentation ¶
Index ¶
- Constants
- func AtMostComments(n uint64) uint8
- func AtMostPms(n uint64) uint8
- func AtMostPosts(n uint64) uint8
- func Db() *igor.Database
- type Ban
- type BanTO
- type Blacklist
- type BlacklistTO
- type Board
- type BoardInfo
- type Bookmark
- type CommentlistOptions
- type Config
- type ContactInfo
- type ContactInfoTO
- type Conversation
- type ConversationTO
- type DeletedUser
- type DeletedUserTO
- type ExistingComment
- type ExistingPost
- type Info
- type InfoTO
- type Interest
- type Lock
- type Lurk
- type Mention
- type MentionTO
- type Message
- type OAuth2AccessData
- type OAuth2AuthorizeData
- type OAuth2Client
- type OAuth2RefreshToken
- type OAuth2Storage
- func (s *OAuth2Storage) Clone() osin.Storage
- func (s *OAuth2Storage) Close()
- func (s *OAuth2Storage) CreateClient(c osin.Client, name string) (*OAuth2Client, error)
- func (s *OAuth2Storage) GetClient(id string) (osin.Client, error)
- func (s *OAuth2Storage) LoadAccess(token string) (*osin.AccessData, error)
- func (s *OAuth2Storage) LoadAuthorize(code string) (*osin.AuthorizeData, error)
- func (s *OAuth2Storage) LoadRefresh(token string) (*osin.AccessData, error)
- func (s *OAuth2Storage) RemoveAccess(token string) error
- func (s *OAuth2Storage) RemoveAuthorize(code string) error
- func (s *OAuth2Storage) RemoveClient(id uint64) error
- func (s *OAuth2Storage) RemoveRefresh(token string) error
- func (s *OAuth2Storage) SaveAccess(accessData *osin.AccessData) error
- func (s *OAuth2Storage) SaveAuthorize(data *osin.AuthorizeData) error
- func (s *OAuth2Storage) UpdateClient(c osin.Client) (*OAuth2Client, error)
- type PersonalInfo
- type PersonalInfoTO
- type Pm
- func (pm *Pm) ClearDefaults()
- func (p *Pm) GetTO(users ...*User) *PmTO
- 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 PmTO
- type PmsOptions
- type Post
- type PostClassification
- type PostClassificationTO
- type PostTO
- type PostlistOptions
- type Profile
- type ProfileTO
- type Project
- func (prj *Project) Followers() []*User
- func (p *Project) GetTO(users ...*User) *ProjectTO
- 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 ProjectFollowerTO
- type ProjectInfo
- type ProjectMember
- type ProjectMemberTO
- type ProjectNotify
- type ProjectNotifyTO
- type ProjectOwner
- type ProjectOwnerTO
- 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 (p *ProjectPost) GetTO(users ...*User) *PostTO
- 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) URL() *url.URL
- func (post *ProjectPost) Votes() *[]Vote
- func (post *ProjectPost) VotesCount() (sum int)
- type ProjectPostBookmark
- func (b *ProjectPostBookmark) GetTO(users ...*User) *ProjectPostBookmarkTO
- func (bookmark *ProjectPostBookmark) NumericReference() uint64
- func (bookmark *ProjectPostBookmark) NumericSender() uint64
- func (bookmark *ProjectPostBookmark) Reference() Reference
- func (bookmark *ProjectPostBookmark) Sender() (user *User)
- func (ProjectPostBookmark) TableName() string
- type ProjectPostBookmarkTO
- type ProjectPostComment
- func (comment *ProjectPostComment) ClearDefaults()
- func (c *ProjectPostComment) GetTO(users ...*User) *ProjectPostCommentTO
- 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 ProjectPostCommentRevisionTO
- type ProjectPostCommentTO
- type ProjectPostCommentVote
- func (t *ProjectPostCommentVote) GetTO(users ...*User) *ProjectPostCommentVoteTO
- 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 ProjectPostCommentVoteTO
- type ProjectPostCommentsNotify
- type ProjectPostCommentsNotifyTO
- type ProjectPostLock
- func (p *ProjectPostLock) GetTO(users ...*User) *ProjectPostLockTO
- func (lock *ProjectPostLock) NumericReference() uint64
- func (lock *ProjectPostLock) NumericSender() uint64
- func (lock *ProjectPostLock) Reference() Reference
- func (lock *ProjectPostLock) Sender() (user *User)
- func (ProjectPostLock) TableName() string
- type ProjectPostLockTO
- type ProjectPostLurk
- func (l *ProjectPostLurk) GetTO(users ...*User) *ProjectPostLurkTO
- func (lurk *ProjectPostLurk) NumericReference() uint64
- func (lurk *ProjectPostLurk) NumericSender() uint64
- func (lurk *ProjectPostLurk) Reference() Reference
- func (lurk *ProjectPostLurk) Sender() (user *User)
- func (ProjectPostLurk) TableName() string
- type ProjectPostLurkTO
- type ProjectPostRevision
- type ProjectPostRevisionTO
- type ProjectPostUserLock
- func (p *ProjectPostUserLock) GetTO(users ...*User) *ProjectPostUserLockTO
- func (lock *ProjectPostUserLock) NumericReference() uint64
- func (lock *ProjectPostUserLock) NumericSender() uint64
- func (lock *ProjectPostUserLock) Reference() Reference
- func (lock *ProjectPostUserLock) Sender() (user *User)
- func (ProjectPostUserLock) TableName() string
- type ProjectPostUserLockTO
- type ProjectPostVote
- func (t *ProjectPostVote) GetTO(users ...*User) *ProjectPostVoteTO
- func (vote *ProjectPostVote) NumericReference() uint64
- func (vote *ProjectPostVote) NumericSender() uint64
- func (vote *ProjectPostVote) Reference() Reference
- func (vote *ProjectPostVote) Sender() (user *User)
- func (ProjectPostVote) TableName() string
- func (vote *ProjectPostVote) Value() int8
- type ProjectPostVoteTO
- type ProjectTO
- type Reference
- type SpecialProject
- type SpecialProjectTO
- type SpecialUser
- type SpecialUserTO
- type Template
- type Transferable
- type User
- func (user *User) Add(message newMessage) error
- 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 existingMessage) bool
- func (user *User) CanEdit(message editingMessage) 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 existingMessage) error
- func (user *User) DeleteConversation(other uint64) error
- func (user *User) DeleteInterest(interest *Interest) error
- func (user *User) Edit(message editingMessage) error
- func (user *User) Follow(board Board) error
- func (user *User) Followers() []*User
- func (user *User) Friends() []*User
- func (u *User) GetTO(users ...*User) *UserTO
- 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) Lock(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) 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 existingMessage, vote int8) (Vote, error)
- func (user *User) Whitelist() []*User
- func (user *User) WhitelistUser(other *User) error
- func (user *User) Whitelisting() []*User
- type UserFollower
- type UserFollowerTO
- 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 (p *UserPost) GetTO(users ...*User) *PostTO
- 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) URL() *url.URL
- func (post *UserPost) Votes() *[]Vote
- func (post *UserPost) VotesCount() (sum int)
- type UserPostBookmark
- func (b *UserPostBookmark) GetTO(users ...*User) *UserPostBookmarkTO
- func (bookmark *UserPostBookmark) NumericReference() uint64
- func (bookmark *UserPostBookmark) NumericSender() uint64
- func (bookmark *UserPostBookmark) Reference() Reference
- func (bookmark *UserPostBookmark) Sender() (user *User)
- func (UserPostBookmark) TableName() string
- type UserPostBookmarkTO
- type UserPostComment
- func (comment *UserPostComment) ClearDefaults()
- func (c *UserPostComment) GetTO(users ...*User) *UserPostCommentTO
- 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 UserPostCommentRevisionTO
- type UserPostCommentTO
- type UserPostCommentVote
- func (t *UserPostCommentVote) GetTO(users ...*User) *UserPostCommentVoteTO
- 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 UserPostCommentVoteTO
- type UserPostCommentsNotify
- type UserPostCommentsNotifyTO
- type UserPostLock
- type UserPostLockTO
- type UserPostLurk
- type UserPostLurkTO
- type UserPostRevision
- type UserPostRevisionTO
- type UserPostUserLock
- func (u *UserPostUserLock) GetTO(users ...*User) *UserPostUserLockTO
- func (lock *UserPostUserLock) NumericReference() uint64
- func (lock *UserPostUserLock) NumericSender() uint64
- func (lock *UserPostUserLock) Reference() Reference
- func (lock *UserPostUserLock) Sender() (user *User)
- func (UserPostUserLock) TableName() string
- type UserPostUserLockTO
- type UserPostVote
- func (t *UserPostVote) GetTO(users ...*User) *UserPostVoteTO
- func (vote *UserPostVote) NumericReference() uint64
- func (vote *UserPostVote) NumericSender() uint64
- func (vote *UserPostVote) Reference() Reference
- func (vote *UserPostVote) Sender() (user *User)
- func (UserPostVote) TableName() string
- func (vote *UserPostVote) Value() int8
- type UserPostVoteTO
- type UserTO
- type Vote
- type Whitelist
- type WhitelistTO
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 )
const ( // UserPostID constaint is the numeric identifier of a user post // when considered as a generic message UserPostID = 1 // ProjectPostID constaint is the numeric identifier of a project post // when considered as a generic message ProjectPostID = 0 )
Variables ¶
This section is empty.
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 BanTO ¶
type BanTO struct { User *InfoTO `json:"user"` Motivation string `json:"motivation"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
BanTO represents the TO of Ban
swagger:model
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
func (*Blacklist) GetTO ¶
func (b *Blacklist) GetTO(users ...*User) *BlacklistTO
GetTO returns its Transfer Object
type BlacklistTO ¶
type BlacklistTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Motivation string `json:"motivation"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
BlacklistTO represens the TO of Blacklist
swagger:model
func (*BlacklistTO) Original ¶
func (to *BlacklistTO) Original() *Blacklist
Original returns the original object of the TO
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 information and Postlist
type BoardInfo ¶
type BoardInfo struct { Language string Template *Template MobileTemplate *Template Dateformat string IsClosed bool Private bool Whitelist []*User UserScript *url.URL }
BoardInfo is that struct that contains all the information 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 Config ¶
type Config struct { DbUsername string DbPassword string // optional -> default: DbName string DbHost string // optional -> default: localhost DbPort int16 // optional -> default: 5432 DbSSLMode string // optional -> default: disable NERDZPath string NERDZHost string Languages []string Scopes []string Templates map[uint8]string EnableLog bool //optional: default: false Port int16 // API port, optional -> default: 7536 Host string Scheme string }
Config represents the configuration file structure
var Configuration *Config
Configuration represent the parsed configuration file
func (*Config) ConnectionString ¶
ConnectionString returns a valid connection string on success, Error otherwise
type ContactInfo ¶
type ContactInfo struct { Website *url.URL GitHub *url.URL Skype string Jabber string Telegram *url.URL Facebook *url.URL Twitter *url.URL Steam string }
ContactInfo is the struct that contains all the contact info of an user
func (*ContactInfo) GetTO ¶
func (c *ContactInfo) GetTO() *ContactInfoTO
GetTO returns its Transfer Object
type ContactInfoTO ¶
type ContactInfoTO struct { Website string `json:"website"` GitHub string `json:"github"` Skype string `json:"skype"` Jabber string `json:"jabber"` Telegram string `json:"telegram"` Facebook string `json:"facebook"` Twitter string `json:"twitter"` Steam string `json:"steam"` // contains filtered or unexported fields }
ContactInfoTO represents the TO of ContactInfo
swagger:model
func (*ContactInfoTO) Original ¶
func (to *ContactInfoTO) Original() *ContactInfo
Original returns the original object of the TO
type Conversation ¶
Conversation represents the details about a single private conversation between two users
func (*Conversation) GetTO ¶
func (c *Conversation) GetTO(users ...*User) *ConversationTO
GetTO returns is Transfer Object
type ConversationTO ¶
type ConversationTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` LastMessage string `json:"lastMessage"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` ToRead bool `json:"toRead"` // contains filtered or unexported fields }
ConversationTO represents the TO of Conversation
swagger:model
func (*ConversationTO) Original ¶
func (to *ConversationTO) Original() *Conversation
Original returns the original object of the TO
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) GetTO ¶
func (u *DeletedUser) GetTO(users ...*User) *DeletedUserTO
GetTO returns its Transfer Object
func (DeletedUser) TableName ¶
func (DeletedUser) TableName() string
TableName returns the table name associated with the structure
type DeletedUserTO ¶
type DeletedUserTO struct { Counter uint64 `json:"counter"` Username string `json:"username"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Motivation string `json:"motivation"` // contains filtered or unexported fields }
DeletedUserTO represents the TO of DeletedUserTO
swagger:model
func (*DeletedUserTO) Original ¶
func (to *DeletedUserTO) Original() *DeletedUser
Original returns the original object of the TO
type ExistingComment ¶
type ExistingComment interface { Post() (ExistingPost, error) // contains filtered or unexported methods }
ExistingComment is the interface that wraps the methods common to every existing comment
type ExistingPost ¶
type ExistingPost interface { Comments(CommentlistOptions) *[]ExistingComment CommentsCount() uint8 NumericBookmarkers() []uint64 Bookmarkers() []*User BookmarksCount() uint8 Bookmarks() *[]Bookmark NumericLurkers() []uint64 Lurkers() []*User LurkersCount() uint8 Lurks() *[]Lurk URL() *url.URL IsClosed() bool NumericType() uint8 Type() string // contains filtered or unexported methods }
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 BoardString string }
Info contains the information common to every board Used in API output to give user/project basic information
type InfoTO ¶
type InfoTO struct { ID uint64 `json:"id"` Owner *InfoTO `json:"owner"` Name string `json:"name"` Username string `json:"username"` Website string `json:"website"` Image string `json:"image"` Closed bool `json:"closed"` Type boardType `json:"type"` BoardString string `json:"board"` // contains filtered or unexported fields }
InfoTO represents the TO of Info
swagger:model
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 MentionTO ¶
type MentionTO struct { ID uint64 `json:"id"` UHpid uint64 `json:"uHpid"` GHpid uint64 `json:"gHpid"` FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` ToNotify bool `json:"toNotify"` // contains filtered or unexported fields }
MentionTO represents the TO of Mention
swagger:model
type Message ¶
Message is the model for the view message
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 // Description is the description of the registered client Description string // Scope is the requested scope. Actually a white space separated // list of scopes required to the user that uses this client. Scope string }
OAuth2Client implements the osin.Client interface
func (*OAuth2Client) GetRedirectUri ¶
func (d *OAuth2Client) GetRedirectUri() string
GetRedirectUri returns the client redirect URI
func (*OAuth2Client) GetSecret ¶
func (d *OAuth2Client) GetSecret() string
GetSecret returns the client secret
func (*OAuth2Client) GetUserData ¶
func (d *OAuth2Client) GetUserData() interface{}
GetUserData returns client UserData
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 OAuth2Storage ¶
type OAuth2Storage struct { }
OAuth2Storage implements osin.Storage interface
func (*OAuth2Storage) Clone ¶
func (s *OAuth2Storage) Clone() osin.Storage
Clone the storage if needed. For example, using mgo, you can clone the session with session.Clone to avoid concurrent access problems. This is to avoid cloning the connection at each method access. Can return itself if not a problem.
func (*OAuth2Storage) Close ¶
func (s *OAuth2Storage) Close()
Close the resources the Storage potentially holds (using Clone for example)
func (*OAuth2Storage) CreateClient ¶
func (s *OAuth2Storage) CreateClient(c osin.Client, name string) (*OAuth2Client, error)
CreateClient creates a new OAuth2 Client
func (*OAuth2Storage) GetClient ¶
func (s *OAuth2Storage) GetClient(id string) (osin.Client, error)
GetClient loads the client by id (client_id)
func (*OAuth2Storage) LoadAccess ¶
func (s *OAuth2Storage) LoadAccess(token string) (*osin.AccessData, error)
LoadAccess retrieves access data by token. osin.Client information MUST be loaded together. osin.AuthorizeData and osin.AccessData DON'T NEED to be loaded if not easily available. Optionally can return error if expired.
func (*OAuth2Storage) LoadAuthorize ¶
func (s *OAuth2Storage) LoadAuthorize(code string) (*osin.AuthorizeData, error)
LoadAuthorize looks up osin.AuthorizeData by a code. osin.Client information MUST be loaded together. Optionally can return error if expired.
func (*OAuth2Storage) LoadRefresh ¶
func (s *OAuth2Storage) LoadRefresh(token string) (*osin.AccessData, error)
LoadRefresh retrieves refresh osin.AccessData. osin.Client information MUST be loaded together. osin.AuthorizeData and osin.AccessData DON'T NEED to be loaded if not easily available. Optionally can return error if expired.
func (*OAuth2Storage) RemoveAccess ¶
func (s *OAuth2Storage) RemoveAccess(token string) error
RemoveAccess revokes or deletes an osin.AccessData.
func (*OAuth2Storage) RemoveAuthorize ¶
func (s *OAuth2Storage) RemoveAuthorize(code string) error
RemoveAuthorize revokes or deletes the authorization code.
func (*OAuth2Storage) RemoveClient ¶
func (s *OAuth2Storage) RemoveClient(id uint64) error
RemoveClient removes the client by id (primary key)
func (*OAuth2Storage) RemoveRefresh ¶
func (s *OAuth2Storage) RemoveRefresh(token string) error
RemoveRefresh revokes or deletes refresh osin.AccessData.
func (*OAuth2Storage) SaveAccess ¶
func (s *OAuth2Storage) SaveAccess(accessData *osin.AccessData) error
SaveAccess writes osin.AccessData. If RefreshToken is not blank, it must save in a way that can be loaded using LoadRefresh.
func (*OAuth2Storage) SaveAuthorize ¶
func (s *OAuth2Storage) SaveAuthorize(data *osin.AuthorizeData) error
SaveAuthorize saves authorize data.
func (*OAuth2Storage) UpdateClient ¶
func (s *OAuth2Storage) UpdateClient(c osin.Client) (*OAuth2Client, error)
UpdateClient update client with id c.GetId()
type PersonalInfo ¶
type PersonalInfo struct { IsOnline bool Nation string Timezone string Username string Name string Surname string 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
func (*PersonalInfo) GetTO ¶
func (p *PersonalInfo) GetTO() *PersonalInfoTO
GetTO returns its Transfer Object
type PersonalInfoTO ¶
type PersonalInfoTO struct { ID uint64 `json:"id"` IsOnline bool `json:"online"` Nation string `json:"nation"` Timezone string `json:"timezone"` Username string `json:"username"` Name string `json:"name"` Surname string `json:"surname"` Birthday time.Time `json:"birthday"` Gravatar string `json:"gravatar"` Interests []string `json:"interests"` Quotes []string `json:"quotes"` Biography string `json:"biography"` // contains filtered or unexported fields }
PersonalInfoTO represents the TO of PersonalInfo
swagger:model
func (*PersonalInfoTO) Original ¶
func (to *PersonalInfoTO) Original() *PersonalInfo
Original returns the original object of the TO
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 PmTO ¶
type PmTO struct { Pmid uint64 `json:"pmid"` FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Message string `json:"message"` Lang string `json:"lang"` ToRead bool `json:"toRead"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` CanEdit bool `json:"canEdit"` CanDelete bool `json:"canDelete"` // contains filtered or unexported fields }
PmTO represents the TO of Pm
swagger:model
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) GetTO ¶
func (p *PostClassification) GetTO(users ...*User) *PostClassificationTO
GetTO returns its Transfer Object
func (PostClassification) TableName ¶
func (PostClassification) TableName() string
TableName returns the table name associated with the structure
type PostClassificationTO ¶
type PostClassificationTO struct { ID uint64 `json:"id"` UHpid uint64 `json:"uHpid"` GHpid uint64 `json:"gHpid"` Tag string `json:"tag"` // contains filtered or unexported fields }
PostClassificationTO represents the TO of PostClassification
swagger:model
func (*PostClassificationTO) Original ¶
func (to *PostClassificationTO) Original() *PostClassification
Original returns the original object of the TO
type PostTO ¶
type PostTO struct { Hpid uint64 `json:"hpid"` Pid uint64 `json:"pid"` Message string `json:"message"` Time time.Time `json:"time"` Lang string `json:"lang"` News bool `json:"news"` Closed bool `json:"closed"` FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Rate int `json:"rate"` RevisionsCount uint8 `json:"revisions"` CommentsCount uint8 `json:"comments"` BookmarksCount uint8 `json:"bookmarkers"` LurkersCount uint8 `json:"lurkers"` URL string `json:"url"` Timestamp int64 `json:"timestamp"` Type boardType `json:"type"` CanComment bool `json:"canComment"` CanBookmark bool `json:"canBookmark"` CanLurk bool `json:"canLurk"` CanEdit bool `json:"canEdit"` CanDelete bool `json:"canDelete"` // contains filtered or unexported fields }
PostTO is the Transfor Object of Post. It represents the common fields presents in a Post
swagger:model
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 Telegram 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 ProfileTO ¶
type ProfileTO struct { Counter uint64 `json:"counter"` Website string `json:"website"` Quotes []string `json:"quotes"` Biography string `json:"biography"` Interests []string `json:"interests"` Github string `json:"github"` Skype string `json:"skype"` Jabber string `json:"jabber"` Telegram string `json:"telegram"` Userscript string `json:"userscript"` // ?API? Template uint8 `json:"template"` // ?API? MobileTemplate uint8 `json:"mobileTemplate"` // ?API? Dateformat string `json:"dateformat"` // ?API? Facebook string `json:"facebook"` Twitter string `json:"twitter"` Steam string `json:"steam"` Push bool `json:"push"` // ?API? Pushregtime time.Time `json:"pushregtime"` // ?API? Closed bool `json:"closed"` // contains filtered or unexported fields }
ProfileTO represents the TO of Profile
swagger:model
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) GetTO ¶
func (p *ProjectFollower) GetTO(users ...*User) *ProjectFollowerTO
GetTO returns its Transfer Object
func (ProjectFollower) TableName ¶
func (ProjectFollower) TableName() string
TableName returns the table name associated with the structure
type ProjectFollowerTO ¶
type ProjectFollowerTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` ToNotify bool `json:"toNotify"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectFollowerTO represents the TO of ProjectFollower
swagger:model
func (*ProjectFollowerTO) Original ¶
func (to *ProjectFollowerTO) Original() *ProjectFollower
Original returns the original object of the TO
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 information
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) GetTO ¶
func (m *ProjectMember) GetTO(users ...*User) *ProjectMemberTO
GetTO returns its Transfer Object
func (ProjectMember) TableName ¶
func (ProjectMember) TableName() string
TableName returns the table name associated with the structure
type ProjectMemberTO ¶
type ProjectMemberTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` ToNotify bool `json:"toNotify"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectMemberTO represents the TO of ProjectMember
swagger:model
func (*ProjectMemberTO) Original ¶
func (to *ProjectMemberTO) Original() *ProjectMember
Original returns the original object of the TO
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) GetTO ¶
func (p *ProjectNotify) GetTO(users ...*User) *ProjectNotifyTO
GetTO returns its Transfer Object
func (ProjectNotify) TableName ¶
func (ProjectNotify) TableName() string
TableName returns the table name associated with the structure
type ProjectNotifyTO ¶
type ProjectNotifyTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Hpid uint64 `json:"hpid"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectNotifyTO represents the TO of ProjectNotify
swagger:model
func (*ProjectNotifyTO) Original ¶
func (to *ProjectNotifyTO) Original() *ProjectNotify
Original returns the original object of the TO
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) GetTO ¶
func (o *ProjectOwner) GetTO(users ...*User) *ProjectOwnerTO
GetTO returns its Transfer Object
func (ProjectOwner) TableName ¶
func (ProjectOwner) TableName() string
TableName returns the table name associated with the structure
type ProjectOwnerTO ¶
type ProjectOwnerTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` ToNotify bool `json:"toNotify"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectOwnerTO represents the TO of ProjectOwner
swagger:model
func (*ProjectOwnerTO) Original ¶
func (to *ProjectOwnerTO) Original() *ProjectOwner
Original returns the original object of the TO
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) GetTO ¶
func (p *ProjectPost) GetTO(users ...*User) *PostTO
GetTO returns its Transfer Object
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) GetTO ¶
func (b *ProjectPostBookmark) GetTO(users ...*User) *ProjectPostBookmarkTO
GetTO returns its Transfer Object
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 ProjectPostBookmarkTO ¶
type ProjectPostBookmarkTO struct { Hpid uint64 `json:"hpid"` FromInfo *InfoTO `json:"from"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectPostBookmarkTO represents the TO of ProjectPostBookmark
swagger:model
func (*ProjectPostBookmarkTO) Original ¶
func (to *ProjectPostBookmarkTO) Original() *ProjectPostBookmark
Original returns the original object of the TO
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) GetTO ¶
func (c *ProjectPostComment) GetTO(users ...*User) *ProjectPostCommentTO
GetTO returns its Transfer Object
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) GetTO ¶
func (r *ProjectPostCommentRevision) GetTO(users ...*User) *ProjectPostCommentRevisionTO
GetTO returns its Transfer Object
func (ProjectPostCommentRevision) TableName ¶
func (ProjectPostCommentRevision) TableName() string
TableName returns the table name associated with the structure
type ProjectPostCommentRevisionTO ¶
type ProjectPostCommentRevisionTO struct { Hcid uint64 `json:"hcid"` Message string `json:"message"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` RevNo uint16 `json:"revNo"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectPostCommentRevisionTO represents the TO of ProjectPostCommentRevision
swagger:model
func (*ProjectPostCommentRevisionTO) Original ¶
func (to *ProjectPostCommentRevisionTO) Original() *ProjectPostCommentRevision
Original returns the original object of the TO
type ProjectPostCommentTO ¶
type ProjectPostCommentTO struct { Hcid uint64 `json:"hcid"` Hpid uint64 `json:"hpid"` FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Message string `json:"message"` Lang string `json:"lang"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` CanEdit bool `json:"canEdit"` CanDelete bool `json:"canDelete"` // contains filtered or unexported fields }
ProjectPostCommentTO represents the TO of ProjectPostComment
swagger:model
func (*ProjectPostCommentTO) Original ¶
func (to *ProjectPostCommentTO) Original() *ProjectPostComment
Original returns the original object of the TO
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) GetTO ¶
func (t *ProjectPostCommentVote) GetTO(users ...*User) *ProjectPostCommentVoteTO
GetTO returns its Transfer Object
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 ProjectPostCommentVoteTO ¶
type ProjectPostCommentVoteTO struct { Hcid uint64 `json:"hcid"` FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Vote int8 `json:"vote"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectPostCommentVoteTO represents the TO of ProjectPostCommentVote
swagger:model
func (*ProjectPostCommentVoteTO) Original ¶
func (to *ProjectPostCommentVoteTO) Original() *ProjectPostCommentVote
Original returns the original object of the TO
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) GetTO ¶
func (p *ProjectPostCommentsNotify) GetTO(users ...*User) *ProjectPostCommentsNotifyTO
GetTO returns its Transfer Object
func (ProjectPostCommentsNotify) TableName ¶
func (ProjectPostCommentsNotify) TableName() string
TableName returns the table name associated with the structure
type ProjectPostCommentsNotifyTO ¶
type ProjectPostCommentsNotifyTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Hpid uint64 `json:"hpid"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectPostCommentsNotifyTO represents the TO of ProjectPostCommentsNotify
swagger:model
func (*ProjectPostCommentsNotifyTO) Original ¶
func (to *ProjectPostCommentsNotifyTO) Original() *ProjectPostCommentsNotify
Original returns the original object of the TO
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) GetTO ¶
func (p *ProjectPostLock) GetTO(users ...*User) *ProjectPostLockTO
GetTO returns its Transfer Object
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 ProjectPostLockTO ¶
type ProjectPostLockTO struct { User *InfoTO `json:"user"` Hpid uint64 `json:"hpid"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectPostLockTO represents the TO of ProjectPostLock
swagger:model
func (*ProjectPostLockTO) Original ¶
func (to *ProjectPostLockTO) Original() *ProjectPostLock
Original returns the original object of the TO
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) GetTO ¶
func (l *ProjectPostLurk) GetTO(users ...*User) *ProjectPostLurkTO
GetTO returns its Transfer Object
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 ProjectPostLurkTO ¶
type ProjectPostLurkTO struct { Hpid uint64 `json:"hpid"` FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectPostLurkTO represents the TO of ProjectPostLurk
swagger:model
func (*ProjectPostLurkTO) Original ¶
func (to *ProjectPostLurkTO) Original() *ProjectPostLurk
Original returns the original object of the TO
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) GetTO ¶
func (p *ProjectPostRevision) GetTO(users ...*User) *ProjectPostRevisionTO
GetTO returns its Transfer Object
func (ProjectPostRevision) TableName ¶
func (ProjectPostRevision) TableName() string
TableName returns the table name associated with the structure
type ProjectPostRevisionTO ¶
type ProjectPostRevisionTO struct { Hpid uint64 `json:"hpid"` Message string `json:"message"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` RevNo uint16 `json:"revNo"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectPostRevisionTO represents the TO of ProjectPostRevision
swagger:model
func (*ProjectPostRevisionTO) Original ¶
func (to *ProjectPostRevisionTO) Original() *ProjectPostRevision
Original returns the original object of the TO
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) GetTO ¶
func (p *ProjectPostUserLock) GetTO(users ...*User) *ProjectPostUserLockTO
GetTO returns its Transfer Object
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 ProjectPostUserLockTO ¶
type ProjectPostUserLockTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Hpid uint64 `json:"hpid"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectPostUserLockTO represents the TO of ProjectPostUserLock
swagger:model
func (*ProjectPostUserLockTO) Original ¶
func (to *ProjectPostUserLockTO) Original() *ProjectPostUserLock
Original returns the original object of the TO
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) GetTO ¶
func (t *ProjectPostVote) GetTO(users ...*User) *ProjectPostVoteTO
GetTO returns its Transfer Object
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 ProjectPostVoteTO ¶
type ProjectPostVoteTO struct { Hpid uint64 `json:"hpid"` FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Vote int8 `json:"vote"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
ProjectPostVoteTO represents the TO of ProjectPostVote
swagger:model
func (*ProjectPostVoteTO) Original ¶
func (to *ProjectPostVoteTO) Original() *ProjectPostVote
Original returns the original object of the TO
type ProjectTO ¶
type ProjectTO struct { Counter uint64 `json:"counter"` Description string `json:"description"` Name string `json:"name"` Private bool `json:"private"` Photo sql.NullString `json:"photo"` Website sql.NullString `json:"website"` Goal string `json:"goal"` Visible bool `json:"visible"` Open bool `json:"open"` CreationTime time.Time `json:"creationTime"` // contains filtered or unexported fields }
ProjectTO represents the TO of Project
swagger:model
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) GetTO ¶
func (p *SpecialProject) GetTO(users ...*User) *SpecialProjectTO
GetTO returns its Transfer Object
func (SpecialProject) TableName ¶
func (SpecialProject) TableName() string
TableName returns the table name associated with the structure
type SpecialProjectTO ¶
type SpecialProjectTO struct { Role string `json:"role"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
SpecialProjectTO represents the TO of SpecialProject
swagger:model
func (*SpecialProjectTO) Original ¶
func (to *SpecialProjectTO) Original() *SpecialProject
Original returns the original object of the TO
type SpecialUser ¶
SpecialUser is the model for the relation special_users
func (*SpecialUser) GetTO ¶
func (u *SpecialUser) GetTO(users ...*User) *SpecialUserTO
GetTO returns its Transfer Object
func (SpecialUser) TableName ¶
func (SpecialUser) TableName() string
TableName returns the table name associated with the structure
type SpecialUserTO ¶
type SpecialUserTO struct { Role string `json:"role"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
SpecialUserTO represents the TO of SpecialUser
swagger:model
func (*SpecialUserTO) Original ¶
func (to *SpecialUserTO) Original() *SpecialUser
Original returns the original object of the TO
type Transferable ¶
type Transferable interface { // GetTO returns a proper data structure for the API // users (max len 1) is the current user viewing the API (the one who grants // the proprer access to the client application) // Is optional because not all the TO are different (ore have different content) // if the user is a specific user GetTO(users ...*User) interface{} }
Transferable represents a common interface for all the types defined by the backend that are able to generate a data structure that can be returned by the API
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 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 constraint 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) Lock ¶
func (user *User) Lock(post ExistingPost, users ...*User) (*[]Lock, error)
Lock 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) GetTO ¶
func (u *UserFollower) GetTO(users ...*User) *UserFollowerTO
GetTO returns its Transfer Object
func (UserFollower) TableName ¶
func (UserFollower) TableName() string
TableName returns the table name associated with the structure
type UserFollowerTO ¶
type UserFollowerTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` ToNotify bool `json:"toNotify"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
UserFollowerTO represents the TO of UserFollower
swagger:model
func (*UserFollowerTO) Original ¶
func (to *UserFollowerTO) Original() *UserFollower
Original returns the original object of the TO
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 ¶
Bookmarks 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 ¶
Votes 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) GetTO ¶
func (b *UserPostBookmark) GetTO(users ...*User) *UserPostBookmarkTO
GetTO returns its Transfer Object
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 UserPostBookmarkTO ¶
type UserPostBookmarkTO struct { Hpid uint64 `json:"hpid"` FromInfo *InfoTO `json:"from"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
UserPostBookmarkTO represents the TO of UserPostBookmark
swagger:model
func (*UserPostBookmarkTO) Original ¶
func (to *UserPostBookmarkTO) Original() *UserPostBookmark
Original returns the original object of the TO
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) GetTO ¶
func (c *UserPostComment) GetTO(users ...*User) *UserPostCommentTO
GetTO returns its Transfer Object
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) GetTO ¶
func (c *UserPostCommentRevision) GetTO(users ...*User) *UserPostCommentRevisionTO
GetTO returns its Transfer Object
func (UserPostCommentRevision) TableName ¶
func (UserPostCommentRevision) TableName() string
TableName returns the table name associated with the structure
type UserPostCommentRevisionTO ¶
type UserPostCommentRevisionTO struct { Hcid uint64 `json:"hcid"` Message string `json:"message"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` RevNo int8 `json:"revNo"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
UserPostCommentRevisionTO represents the TO of UserPostCommentRevision
swagger:model
func (*UserPostCommentRevisionTO) Original ¶
func (to *UserPostCommentRevisionTO) Original() *UserPostCommentRevision
Original returns the original object of the TO
type UserPostCommentTO ¶
type UserPostCommentTO struct { Hcid uint64 `json:"hcid"` Hpid uint64 `json:"hpid"` FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Message string `json:"message"` Lang string `json:"lang"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` CanEdit bool `json:"canEdit"` CanDelete bool `json:"canDelete"` // contains filtered or unexported fields }
UserPostCommentTO represents the TO of UserPostComment
swagger:model
func (*UserPostCommentTO) Original ¶
func (to *UserPostCommentTO) Original() *UserPostComment
Original returns the original object of the TO
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) GetTO ¶
func (t *UserPostCommentVote) GetTO(users ...*User) *UserPostCommentVoteTO
GetTO returns its Transfer Object
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 UserPostCommentVoteTO ¶
type UserPostCommentVoteTO struct { Hcid uint64 `json:"hcid"` User *InfoTO `json:"user"` Vote int8 `json:"vote"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
UserPostCommentVoteTO represents the TO of UserPostCommentVote
swagger:model
func (*UserPostCommentVoteTO) Original ¶
func (to *UserPostCommentVoteTO) Original() *UserPostCommentVote
Original returns the original object of the TO
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) GetTO ¶
func (u *UserPostCommentsNotify) GetTO(users ...*User) *UserPostCommentsNotifyTO
GetTO returns its Transfer Object
func (UserPostCommentsNotify) TableName ¶
func (UserPostCommentsNotify) TableName() string
TableName returns the table name associated with the structure
type UserPostCommentsNotifyTO ¶
type UserPostCommentsNotifyTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Hpid uint64 `json:"hpid"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
UserPostCommentsNotifyTO represents the TO of UserPostCommentsNotify
swagger:model
func (*UserPostCommentsNotifyTO) Original ¶
func (to *UserPostCommentsNotifyTO) Original() *UserPostCommentsNotify
Original returns the original object of the TO
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) GetTO ¶
func (u *UserPostLock) GetTO(users ...*User) *UserPostLockTO
GetTO returns its Transfer Object
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 UserPostLockTO ¶
type UserPostLockTO struct { User *InfoTO `json:"user"` Hpid uint64 `json:"hpid"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
UserPostLockTO represents the TO of UserPostLock
swagger:model
func (*UserPostLockTO) Original ¶
func (to *UserPostLockTO) Original() *UserPostLock
Original returns the original object of the TO
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) GetTO ¶
func (l *UserPostLurk) GetTO(users ...*User) *UserPostLurkTO
GetTO returns its Transfer Object
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 UserPostLurkTO ¶
type UserPostLurkTO struct { Hpid uint64 `json:"hpid"` FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
UserPostLurkTO represents the TO of UserPostLurk
swagger:model
func (*UserPostLurkTO) Original ¶
func (to *UserPostLurkTO) Original() *UserPostLurk
Original returns the original object of the TO
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) GetTO ¶
func (p *UserPostRevision) GetTO(users ...*User) *UserPostRevisionTO
GetTO returns its Transfer Object
func (UserPostRevision) TableName ¶
func (UserPostRevision) TableName() string
TableName returns the table name associated with the structure
type UserPostRevisionTO ¶
type UserPostRevisionTO struct { Hpid uint64 `json:"hpid"` Message string `json:"message"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` RevNo uint16 `json:"revNo"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
UserPostRevisionTO represents the TO of UserPostRevision
swagger:model
func (*UserPostRevisionTO) Original ¶
func (to *UserPostRevisionTO) Original() *UserPostRevision
Original returns the original object of the TO
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) GetTO ¶
func (u *UserPostUserLock) GetTO(users ...*User) *UserPostUserLockTO
GetTO returns its Transfer Object
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 UserPostUserLockTO ¶
type UserPostUserLockTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Hpid uint64 `json:"hpid"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
UserPostUserLockTO represents the TO of UserPostUserLock
swagger:model
func (*UserPostUserLockTO) Original ¶
func (to *UserPostUserLockTO) Original() *UserPostUserLock
Original returns the original object of the TO
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) GetTO ¶
func (t *UserPostVote) GetTO(users ...*User) *UserPostVoteTO
GetTO returns its Transfer Object
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 UserPostVoteTO ¶
type UserPostVoteTO struct { Hpid uint64 `json:"hpid"` FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Vote int8 `json:"vote"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
UserPostVoteTO represents the TO of UserPostVote
swagger:model
func (*UserPostVoteTO) Original ¶
func (to *UserPostVoteTO) Original() *UserPostVote
Original returns the original object of the TO
type UserTO ¶
type UserTO struct { Counter uint64 `json:"counter"` Last time.Time `json:"last"` NotifyStory igor.JSON `json:"notifyStory"` Private bool `json:"private"` Lang string `json:"lang"` Username string `json:"username"` Name string `json:"name"` Surname string `json:"surname"` BirthDate time.Time `json:"birthDate"` BoardLang string `json:"boardLang"` Timezone string `json:"timezone"` Viewonline bool `json:"viewonline"` RegistrationTime time.Time `json:"registrationTime"` Profile ProfileTO // contains filtered or unexported fields }
UserTO represents the TO of User
swagger:model
type Vote ¶
type Vote interface { Value() int8 // contains filtered or unexported methods }
Vote is a generic interface to represent a vote
type Whitelist ¶
type Whitelist struct { From uint64 To uint64 Time time.Time `sql:"default:(now() at time zone 'utc')"` Counter uint64 `igor:"primary_key"` }
Whitelist is the model for the relation whitelist
func (*Whitelist) GetTO ¶
func (w *Whitelist) GetTO(users ...*User) *WhitelistTO
GetTO returns its Transfer Object
type WhitelistTO ¶
type WhitelistTO struct { FromInfo *InfoTO `json:"from"` ToInfo *InfoTO `json:"to"` Time time.Time `json:"time"` Timestamp int64 `json:"timestamp"` Counter uint64 `json:"counter"` // contains filtered or unexported fields }
WhitelistTO represents the TO of Whitelist
swagger:model
func (*WhitelistTO) Original ¶
func (to *WhitelistTO) Original() *Whitelist
Original returns the original object of the TO
Source Files ¶
- board.go
- config.go
- init.go
- messages.go
- models.go
- oauth2.go
- pm.go
- project.go
- project_post.go
- project_post_comment.go
- project_post_comment_relations.go
- project_post_relations.go
- transfer_objects.go
- types.go
- user.go
- user_post.go
- user_post_comment.go
- user_post_comment_relations.go
- user_post_relations.go
- utils.go