Documentation ¶
Index ¶
Constants ¶
View Source
const ( StatusActive = "active" StatusDeleting = "deleting" )
View Source
const ( StatusDefault = "default" StatusRemoved = "removed" StatusAccepted = "accepted" StatusBlocked = "blocked" )
status "default", "removed", , "accepted", "blocked"
View Source
const ( StatusOnline = "online" StatusOffline = "offline" )
View Source
const (
DefaultGroupImage = "" /* 155-byte string literal not displayed */
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct { Base Name string `json:"name"` Description string `json:"description"` ImageURL string `json:"image_url"` Host string `json:"-"` Topic uuid.UUID `json:"-" gorm:"type:uuid;default:uuid_generate_v4()"` OwnerID uint `json:"owner_id"` Owner *User `json:"owner" gorm:"foreignKey:OwnerID"` Memberships []*Membership `json:"memberships"` }
type Membership ¶
type Membership struct { CreatedAt time.Time `json:"created_at"` UserID uint `json:"user_id" gorm:"primaryKey"` GroupID uint `json:"group_id" gorm:"primaryKey"` Status membershipStatus `json:"status" gorm:"type:membership_status"` Notification bool `json:"-"` User *User `json:"user"` Group *Group `json:"group"` }
type Relationship ¶
type Relationship struct { User1ID uint `json:"user1_id" gorm:"primaryKey"` User2ID uint `json:"user2_id" gorm:"primaryKey"` User1 *User `json:"user1" gorm:"foreignKey:User1ID"` User2 *User `json:"user2" gorm:"foreignKey:User2ID"` ForwardStatus string `json:"forward_status"` BackwardStatus string `json:"backward_status"` ForwardNotifications bool `json:"forward_notifications"` BackwardNotifications bool `json:"backward_notifications"` Host string `json:"-"` Topic uuid.UUID `json:"-" gorm:"type:uuid;default:uuid_generate_v4()"` }
type Session ¶
type Session struct { UserID uint `json:"user_id" gorm:"primaryKey"` IP string `json:"ip" gorm:"primaryKey"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"` Ch string `json:"-"` ExpoPushToken string `json:"-"` Status string `json:"status"` }
type User ¶
type User struct { Base Email string `gorm:"unique" json:"email"` Username string `gorm:"unique" json:"username"` Displayname string `json:"displayname"` ImageURL string `json:"image_url"` Pass string `json:"-"` Bio string `json:"bio"` Memberships []*Membership `json:"memberships"` Sessions []*Session `json:"sessions"` ForwardRelationships []*Relationship `json:"forward_relationships" gorm:"foreignKey:User1ID"` BackwardRelationships []*Relationship `json:"backward_relationships" gorm:"foreignKey:User2ID"` }
Click to show internal directories.
Click to hide internal directories.