Documentation ¶
Index ¶
- Variables
- type Access
- type AppBadgesConnection
- type AppBadgesEdge
- type Author
- type Badge
- type BadgeInput
- type Base
- type Channel
- type ChannelInput
- type ChannelMessagesConnection
- type ChannelMessagesEdge
- type ChannelReorderInput
- type Instance
- type InstanceAuthorsConnection
- type InstanceAuthorsEdge
- type InstanceChannelsConnection
- type InstanceChannelsEdge
- type InstanceInput
- type InstanceLikesConnection
- type InstanceLikesEdge
- type InstancePinInput
- type InstanceReorderInput
- type InstanceUser
- type Invite
- type InviteInput
- type Message
- type MessageInput
- type Notice
- type NoticeKind
- type Notification
- type NotificationKind
- type PageInfo
- type Role
- type User
- type UserBadge
- type UserBadgesConnection
- type UserBadgesEdge
- type UserInput
- type UserInstancesConnection
- type UserInstancesEdge
- type UserNotificationsConnection
- type UserNotificationsEdge
Constants ¶
This section is empty.
Variables ¶
View Source
var AllAccess = []Access{ AccessPublic, AccessPrivate, }
View Source
var AllNoticeKind = []NoticeKind{ NoticeKindMessageAdded, NoticeKindMessageRemoved, NoticeKindChannelAdded, NoticeKindChannelUpdated, NoticeKindChannelRemoved, NoticeKindAuthorUpdated, NoticeKindUserUpdated, NoticeKindInstanceUpdated, NoticeKindInstanceRemoved, NoticeKindLikeAdded, NoticeKindLikeRemoved, NoticeKindNotificationAdded, NoticeKindBadgeAdded, }
View Source
var AllNotificationKind = []NotificationKind{ NotificationKindLikeAdded, NotificationKindCommentAdded, NotificationKindReplyAdded, NotificationKindBadgeAdded, }
View Source
var AllRole = []Role{ RoleAdmin, RoleModerator, RoleMember, RoleBanned, RoleAllUsers, }
Functions ¶
This section is empty.
Types ¶
type AppBadgesConnection ¶ added in v0.0.4
type AppBadgesConnection struct { PageInfo *PageInfo `json:"pageInfo"` Edges []*AppBadgesEdge `json:"edges"` }
type AppBadgesEdge ¶ added in v0.0.4
type Author ¶
type Author struct { ID uuid.UUID `json:"id"` UserID uuid.UUID `json:"userId"` InstanceID uuid.UUID `json:"instanceId"` Roles []Role `json:"roles"` Name string `json:"name"` Avatar string `json:"avatar"` Bio string `json:"bio"` CreatedAt time.Time `json:"createdAt"` BanReason *string `json:"banReason,omitempty"` }
type BadgeInput ¶ added in v0.0.4
type Channel ¶
type Channel struct { Base AuthorID uuid.UUID `json:"authorId" gorm:"type:uuid"` Author *InstanceUser `` Rank string `json:"rank"` Name string `json:"name"` InstanceID uuid.UUID `json:"instanceId" gorm:"type:uuid" copier:"InstanceId"` Instance *Instance `` Messages []*Message `gorm:"constraint:OnDelete:CASCADE;"` Publishers pq.StringArray `json:"publishers" gorm:"type:text[]"` Readers pq.StringArray `json:"readers" gorm:"type:text[]"` LastMessageAddedAt *time.Time `json:"lastMessagedAddedAt"` MessageCount int `json:"messageCount"` IsCategory bool `json:"isCategory"` IsComments bool `json:"isComments"` }
type ChannelInput ¶
type ChannelMessagesConnection ¶
type ChannelMessagesConnection struct { PageInfo *PageInfo `json:"pageInfo"` Edges []*ChannelMessagesEdge `json:"edges"` }
type ChannelMessagesEdge ¶
type ChannelReorderInput ¶
type Instance ¶
type Instance struct { Base Name string `json:"name"` Description string `json:"description"` AuthorID uuid.UUID `json:"authorId" gorm:"type:uuid" copier:"AuthorID"` Author *InstanceUser `gorm:"constraint:OnDelete:CASCADE;"` ReadAccess string `json:"readAccess"` Icon string `json:"icon"` // IsGroup bool “ ShowAuthor bool `json:"showAuthor"` ShowChat bool `json:"showChat"` ShowComments bool `json:"showComments"` ShowLikes bool `json:"showLikes"` LikesCount int `json:"likesCount"` CommentsCount int `json:"commentsCount"` Channels []*Channel `gorm:"constraint:OnDelete:CASCADE;"` Users []*InstanceUser `gorm:"constraint:OnDelete:CASCADE;"` Invites []*Invite `gorm:"constraint:OnDelete:CASCADE;"` PrimaryChannelID uuid.UUID `gorm:"type:uuid"` PrimaryChannel *Channel `` }
type InstanceAuthorsConnection ¶
type InstanceAuthorsConnection struct { PageInfo *PageInfo `json:"pageInfo"` Edges []*InstanceAuthorsEdge `json:"edges"` }
type InstanceAuthorsEdge ¶
type InstanceChannelsConnection ¶
type InstanceChannelsConnection struct { PageInfo *PageInfo `json:"pageInfo"` Edges []*InstanceChannelsEdge `json:"edges"` }
type InstanceChannelsEdge ¶
type InstanceInput ¶
type InstanceInput struct { ID *uuid.UUID `json:"id,omitempty"` Name string `json:"name"` ReadAccess Access `json:"readAccess"` Icon string `json:"icon"` Description string `json:"description"` ShowAuthor bool `json:"showAuthor"` ShowChat bool `json:"showChat"` ShowComments bool `json:"showComments"` ShowLikes bool `json:"showLikes"` }
type InstanceLikesConnection ¶
type InstanceLikesConnection struct { PageInfo *PageInfo `json:"pageInfo"` Edges []*InstanceLikesEdge `json:"edges"` }
type InstanceLikesEdge ¶
type InstancePinInput ¶
type InstancePinInput struct {
Pinned bool `json:"pinned"`
}
type InstanceReorderInput ¶
type InstanceUser ¶
type InstanceUser struct { Base InstanceID uuid.UUID `json:"instanceId" gorm:"type:uuid" copier:"InstanceId"` Instance *Instance UserID uuid.UUID `json:"userId" gorm:"type:uuid" copier:"UserId"` User *User Name string `json:"name"` Avatar string `json:"avatar"` Bio string `json:"bio"` Roles pq.StringArray `json:"roles" gorm:"type:text[]"` Rank string `json:"rank"` Pinned bool `json:"pinned"` LikedByMe bool `json:"likedByMe"` LikedAt *time.Time `json:"likedAt"` BanReason *string `json:"banReason"` BannedAt *time.Time `json:"bannedAt"` }
type Invite ¶
type Invite struct { Base InstanceID uuid.UUID `json:"instanceId" gorm:"type:uuid" copier:"InstanceId"` Instance *Instance `` AuthorID uuid.UUID `json:"authorId" gorm:"type:uuid" copier:"AuthorId"` Author *InstanceUser `gorm:"foreignKey:AuthorID"` Code string `json:"code"` ExpiresAt *time.Time `json:"expiresAt"` Redemptions *int `json:"redemptions"` }
type InviteInput ¶
type Message ¶
type Message struct { Base Text string `json:"text"` AuthorID uuid.UUID `json:"authorId" gorm:"type:uuid" copier:"AuthorId"` Author *InstanceUser `` ChannelID uuid.UUID `json:"channelId" gorm:"type:uuid" copier:"ChannelId"` Channel *Channel `` RepliedMessageID *uuid.UUID `json:"repliedMessageId" gorm:"type:uuid" copier:"RepliedMessageId"` ImageUrls pq.StringArray `json:"imageUrls" gorm:"type:text[]"` }
type MessageInput ¶
type Notice ¶
type Notice struct { Kind NoticeKind `json:"kind"` ChannelMessagesEdge *ChannelMessagesEdge `json:"channelMessagesEdge,omitempty"` UserInstancesEdge *UserInstancesEdge `json:"userInstancesEdge,omitempty"` InstanceChannelsEdge *InstanceChannelsEdge `json:"instanceChannelsEdge,omitempty"` InstanceLikesEdge *InstanceLikesEdge `json:"instanceLikesEdge,omitempty"` UserNotificationsEdge *UserNotificationsEdge `json:"userNotificationsEdge,omitempty"` Instance *Instance `json:"instance,omitempty"` User *User `json:"user,omitempty"` Author *Author `json:"author,omitempty"` Badge *Badge `json:"badge,omitempty"` }
type NoticeKind ¶
type NoticeKind string
const ( NoticeKindMessageAdded NoticeKind = "MESSAGE_ADDED" NoticeKindMessageRemoved NoticeKind = "MESSAGE_REMOVED" NoticeKindChannelAdded NoticeKind = "CHANNEL_ADDED" NoticeKindChannelUpdated NoticeKind = "CHANNEL_UPDATED" NoticeKindChannelRemoved NoticeKind = "CHANNEL_REMOVED" NoticeKindAuthorUpdated NoticeKind = "AUTHOR_UPDATED" NoticeKindUserUpdated NoticeKind = "USER_UPDATED" NoticeKindInstanceUpdated NoticeKind = "INSTANCE_UPDATED" NoticeKindInstanceRemoved NoticeKind = "INSTANCE_REMOVED" NoticeKindLikeAdded NoticeKind = "LIKE_ADDED" NoticeKindLikeRemoved NoticeKind = "LIKE_REMOVED" NoticeKindNotificationAdded NoticeKind = "NOTIFICATION_ADDED" NoticeKindBadgeAdded NoticeKind = "BADGE_ADDED" )
func (NoticeKind) IsValid ¶
func (e NoticeKind) IsValid() bool
func (NoticeKind) MarshalGQL ¶
func (e NoticeKind) MarshalGQL(w io.Writer)
func (NoticeKind) String ¶
func (e NoticeKind) String() string
func (*NoticeKind) UnmarshalGQL ¶
func (e *NoticeKind) UnmarshalGQL(v interface{}) error
type Notification ¶
type Notification struct { Base Kind string `json:"kind"` UserID uuid.UUID `json:"userId" gorm:"type:uuid" copier:"UserID"` User *User AuthorID *uuid.UUID `json:"authorId" gorm:"type:uuid" copier:"AuthorId"` Author *InstanceUser `` InstanceID *uuid.UUID `json:"instanceId" gorm:"type:uuid" copier:"InstanceID"` Instance *Instance `` MessageID *uuid.UUID `json:"messageId" gorm:"type:uuid" copier:"MessageID"` Message *Message `` ReplyID *uuid.UUID `json:"replyId" gorm:"type:uuid" copier:"ReplyID"` Reply *Message `` BadgeID *uuid.UUID `json:"userBadgeId" gorm:"type:uuid" copier:"UserBadgeID"` Badge *Badge `` }
type NotificationKind ¶
type NotificationKind string
const ( NotificationKindLikeAdded NotificationKind = "LIKE_ADDED" NotificationKindCommentAdded NotificationKind = "COMMENT_ADDED" NotificationKindReplyAdded NotificationKind = "REPLY_ADDED" NotificationKindBadgeAdded NotificationKind = "BADGE_ADDED" )
func (NotificationKind) IsValid ¶
func (e NotificationKind) IsValid() bool
func (NotificationKind) MarshalGQL ¶
func (e NotificationKind) MarshalGQL(w io.Writer)
func (NotificationKind) String ¶
func (e NotificationKind) String() string
func (*NotificationKind) UnmarshalGQL ¶
func (e *NotificationKind) UnmarshalGQL(v interface{}) error
type User ¶
type User struct { Base UID string `json:"uid"` Name string `json:"name"` Avatar string `json:"avatar"` Bio string `json:"bio"` InstanceUsers []*InstanceUser `` Notifications []*Notification `` ReadNotificationsAt *time.Time `` Badges []*Badge `gorm:"many2many:user_badges;"` }
type UserBadge ¶ added in v0.0.4
type UserBadgesConnection ¶ added in v0.0.4
type UserBadgesConnection struct { PageInfo *PageInfo `json:"pageInfo"` Edges []*UserBadgesEdge `json:"edges"` }
type UserBadgesEdge ¶ added in v0.0.4
type UserInstancesConnection ¶
type UserInstancesConnection struct { PageInfo *PageInfo `json:"pageInfo"` Edges []*UserInstancesEdge `json:"edges"` }
type UserInstancesEdge ¶
type UserNotificationsConnection ¶
type UserNotificationsConnection struct { PageInfo *PageInfo `json:"pageInfo"` Edges []*UserNotificationsEdge `json:"edges"` HasUnread bool `json:"hasUnread"` }
type UserNotificationsEdge ¶
type UserNotificationsEdge struct { Cursor string `json:"cursor"` Node *Notification `json:"node"` }
Click to show internal directories.
Click to hide internal directories.