Documentation
¶
Index ¶
- type Asset
- type Badge
- type BadgeRelation
- type Category
- type CategoryBlock
- type CategoryGroup
- type CategoryGroupBlock
- type CategoryRelation
- type Community
- type DeleteBlock
- type Downvote
- type DownvoteBlock
- type Emoji
- type EmojiBlock
- type EmojiRelation
- type OwnedToken
- type Post
- type PostBlock
- type PostRequest
- type Profile
- type ProfileBlock
- type Role
- type RoleRelation
- type Tag
- type TagBlock
- type TagRelation
- type Topic
- type TopicBlock
- type TradedToken
- type Upvote
- type UpvoteBlock
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct { ID uint `gorm:"primaryKey"` CID string `gorm:"index;not null" json:"cid"` CreatorWallet string Creator *User `gorm:"references:Wallet"` ContentType string `gorm:"not null" json:"contentType"` OwnerID uint OwnerType string CreatedAt time.Time `gorm:"autoCreateTime"` UpdatedAt time.Time `gorm:"autoUpdateTime"` }
func (*Asset) MarshalJSON ¶
type BadgeRelation ¶
type Category ¶
type Category struct { ID uint `gorm:"primaryKey"` CategoryGroupName string `gorm:"not null"` Color string `gorm:"not null"` Name string `gorm:"uniqueIndex;not null"` }
func (*Category) MarshalJSON ¶
type CategoryBlock ¶
type CategoryGroup ¶
type CategoryGroupBlock ¶
type CategoryRelation ¶
type DeleteBlock ¶
type Downvote ¶
type Downvote struct { ID uint `gorm:"primaryKey"` CreatedAt time.Time `gorm:"autoCreateTime"` DeletedAt gorm.DeletedAt `gorm:"index"` CreatorWallet string `gorm:"index:idx_wallet;not null"` Creator *User `gorm:"foreignKey:CreatorWallet;references:Wallet"` OwnerID uint OwnerType string }
func (*Downvote) MarshalJSON ¶
type DownvoteBlock ¶
type EmojiBlock ¶
type EmojiRelation ¶
type EmojiRelation struct { ID uint `gorm:"primaryKey"` EmojiCode string `gorm:"index:,unique;not null"` Emoji *Emoji `gorm:"foreignKey:EmojiCode;references:Code"` OwnerID uint `gorm:"not null"` OwnerType string `gorm:"not null"` CreatedAt time.Time `gorm:"autoCreateTime"` DeletedAt gorm.DeletedAt `gorm:"index"` }
type OwnedToken ¶
type OwnedToken struct { ID uint `gorm:"primaryKey"` OwnerID uint Asset *Asset `gorm:"polymorphic:Owner;"` TagsAssigned []*TagRelation `gorm:"polymorphic:Owner;"` Volume uint }
type Post ¶
type Post struct { ID uint `gorm:"primaryKey"` Hash string `gorm:"uniqueIndex"` CreatorWallet string `gorm:"index;not null"` Creator *User `gorm:"references:Wallet"` Content string `gorm:"not null"` CreatedAt time.Time `gorm:"autoCreateTime;not null"` UpdatedAt time.Time `gorm:"autoUpdateTime;not null"` DeletedAt gorm.DeletedAt ReplyToID *uint ReplyTo *Post BelongToHash string `gorm:"index;not null"` BelongTo *Topic `gorm:"references:Hash;foreignKey:BelongToHash"` Upvotes []*Upvote `gorm:"polymorphic:Owner"` Downvotes []*Downvote `gorm:"polymorphic:Owner"` Closed bool `gorm:"not null"` Assets []*Asset `gorm:"polymorphic:Owner"` }
func (*Post) MarshalJSON ¶
type PostBlock ¶
type PostBlock struct { Hash string `json:"hash"` Creator string `json:"creator"` CID string `json:"cid"` ReplyTo string `json:"replyTo"` BelongTo string `json:"belongTo"` Assets []string `json:"assets,omitempty"` Deleted bool `json:"deleted"` Upvotes []string `json:"upvotes,omitempty"` Downvotes []string `json:"downvotes,omitempty"` Emojis map[string][]string `json:"emojis,omitempty"` }
type PostRequest ¶
type Profile ¶
type Profile struct { ID uint `gorm:"primaryKey"` Signature string Credibility uint Balance int UserWallet *string `gorm:"index:,unique,sort:desc,not null"` User *User `gorm:"references:Wallet"` RoleRelationsAssigned []*RoleRelation `gorm:"polymorphic:Owner"` BadgeRelationsReceived []*BadgeRelation `gorm:"polymorphic:Owner"` }
func (*Profile) MarshalJSON ¶
type ProfileBlock ¶
type ProfileBlock struct { Username string `json:"username"` Wallet string `json:"wallet"` Avatar string `json:"avatar"` Signature string `json:"signature"` Muted bool `json:"muted"` Banned bool `json:"banned"` Balance int `json:"balance"` Credibility uint `json:"credibility"` ActiveRole string `json:"activeRole"` RolesAssigned []string `json:"rolesAssigned"` ActiveBadge string `json:"activeBadge"` BadgesReceived []string `json:"badgesReceived"` }
type RoleRelation ¶
type Tag ¶
type Tag struct { ID uint `gorm:"primaryKey" json:"-"` Name string `gorm:"uniqueIndex;not null" json:"name"` CreatorWallet string `gorm:"not null"` Creator *User `gorm:"foreignKey:CreatorWallet;references:Wallet"` Description string `json:"description"` }
func (*Tag) MarshalJSON ¶
type TagRelation ¶
type Topic ¶
type Topic struct { ID uint `gorm:"primaryKey"` Hash string `gorm:"uniqueIndex;not null"` Title string `gorm:"not null"` CreatorWallet string `gorm:"index;not null"` Creator *User `gorm:"references:Wallet"` Content string `gorm:"not null"` CategoryAssigned *CategoryRelation TagsAssigned []*TagRelation `gorm:"polymorphic:Owner"` Upvotes []*Upvote `gorm:"polymorphic:Owner"` Downvotes []*Downvote `gorm:"polymorphic:Owner"` Assets []*Asset `gorm:"polymorphic:Owner"` Closed bool `gorm:"not null"` CreatedAt time.Time `gorm:"autoCreateTime"` UpdatedAt time.Time `gorm:"autoUpdateTime"` DeletedAt gorm.DeletedAt `gorm:"index"` }
func (*Topic) MarshalJSON ¶
type TopicBlock ¶
type TopicBlock struct { Hash string `json:"hash"` Title string `json:"title"` Creator string `json:"creator"` CID string `json:"cid"` Category string `json:"category"` Tags []string `json:"tags"` Images []string `json:"images"` Deleted bool `json:"deleted"` Upvotes []string `json:"upvotes"` Downvotes []string `json:"downvotes"` Emojis map[string][]string `json:"emojis"` }
type TradedToken ¶
type Upvote ¶
type Upvote struct { ID uint `gorm:"primaryKey"` CreatedAt time.Time `gorm:"autoCreateTime"` DeletedAt gorm.DeletedAt `gorm:"index"` CreatorWallet string `gorm:"index;not null"` Creator *User `gorm:"foreignKey:CreatorWallet;references:Wallet"` OwnerID uint OwnerType string }
func (*Upvote) MarshalJSON ¶
type UpvoteBlock ¶
type User ¶
type User struct { ID uint `gorm:"primaryKey"` Username string `gorm:"not null"` Wallet string `gorm:"index:,unique,sort:desc,not null"` Avatar string Muted bool `gorm:"not null"` Banned bool `gorm:"not null"` CreatedAt time.Time `gorm:"autoCreateTime"` UpdatedAt time.Time `gorm:"autoUpdateTime"` DeletedAt gorm.DeletedAt `gorm:"index"` ActiveBadgeRelation *BadgeRelation `gorm:"polymorphic:Owner"` ActiveRoleRelation *RoleRelation `gorm:"polymorphic:Owner"` }
func (*User) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.