Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountUsers ¶
CountUsers counts specified type of users
Types ¶
type Article ¶
Article represents prose posts
func ReadAllArticles ¶
ReadAllArticles fetches all Articles
type Base ¶
type Base struct { ID uuid.UUID `gorm:"type:uuid;primary_key;"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `sql:"index" json:"deleted_at"` }
Base contains common columns for all tables.
type Flicker ¶
Flicker represents video posts
func ReadAllFlickers ¶
ReadAllFlickers fetches all Flickers
type Gallery ¶
type Gallery struct { PostBase Content pq.StringArray `json:"content" gorm:"type:varchar(255)[]"` Caption pq.StringArray `json:"caption" gorm:"type:varchar(255)[]"` }
Gallery represents image posts
func ReadAllGalleries ¶
ReadAllGalleries fetches all Galleries
type Post ¶
type Post interface { // Read fetches a Post Read() (int, error) // Delete removes a Post Delete() (int, error) // Publish makes a Post public Publish() (int, error) // Retract makes a Post private Retract() (int, error) }
Post represents all post types
type PostBase ¶
type PostBase struct { Base Subject string `json:"subject"` Summary string `json:"summary"` Overlay string `json:"overlay"` Section string `json:"section"` Summons int `json:"summons"` Release bool `json:"release"` Pattern postPattern `json:"pattern"` Creator uuid.UUID `json:"creator" gorm:"type:uuid"` Markers pq.StringArray `json:"markers" gorm:"type:varchar(255)[]"` Reactions []Reaction `json:"reactions,omitempty" sql:"-" gorm:"foreignkey:Post"` }
PostBase is the underlying object for all post types
type Reaction ¶
type Reaction struct { Base Type ReactionType `json:"type"` User uuid.UUID `gorm:"type:uuid" json:"user"` Item uuid.UUID `gorm:"type:uuid" json:"item"` Site string `json:"site"` Text string `json:"text"` }
Reaction represents a User action on a Post
func ReadAllReactions ¶
ReadAllReactions fetches all Reactions
type ReactionType ¶
type ReactionType string
ReactionType represents a user action on a post.
const ( ReactionApprove ReactionType = "approve" ReactionSticker ReactionType = "sticker" ReactionComment ReactionType = "comment" )
ReactionTypes represent available user actions on posts.
type User ¶
type User struct { Base Name string `json:"name"` Mail string `json:"mail"` Pass string `json:"pass"` Auth string `json:"auth"` Life string `json:"life"` Role UserRole `json:"role"` Posts []Post `json:"posts,omitempty" sql:"-" gorm:"foreignkey:Creator"` Reactions []Reaction `json:"reactions,omitempty" sql:"-" gorm:"foreignkey:User"` }
User is a registered user TODO User status
func (*User) ValidateAuth ¶
ValidateAuth checks user details format
Click to show internal directories.
Click to hide internal directories.