Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeCursor(i int) string
- type AddDiscussionParticipantInput
- type AnonymityType
- type ArchivedPost
- type CanJoinDiscussionResponse
- type Discussion
- func (d *Discussion) AddDescriptionToHistory(description string) error
- func (d *Discussion) AddTitleToHistory(title string) error
- func (d *Discussion) DescriptionHistoryAsObject() ([]*HistoricalString, error)
- func (Discussion) IsEntity()
- func (d *Discussion) TitleHistoryAsObject() ([]*HistoricalString, error)
- type DiscussionAccessLink
- type DiscussionAccessRequest
- type DiscussionArchive
- type DiscussionCreationSettings
- type DiscussionInput
- type DiscussionJoinabilityResponse
- type DiscussionJoinabilitySetting
- type DiscussionParticipantKey
- type DiscussionParticipantKeys
- type DiscussionPostKey
- type DiscussionShuffleTime
- type DiscussionSubscriptionEntity
- type DiscussionSubscriptionEvent
- type DiscussionSubscriptionEventType
- type DiscussionUserAccess
- type DiscussionUserAccessState
- type DiscussionUserNotificationSetting
- type DiscussionUserSettings
- type DiscussionViewerKey
- type DiscussionViewerKeys
- type DiscussionsConnection
- type DiscussionsEdge
- type Entity
- type GradientColor
- type HistoricalString
- type InviteRequestStatus
- type InviteType
- type Media
- type MediaSize
- type Moderator
- type PageInfo
- type ParsedEntityID
- type Participant
- type ParticipantProfile
- type ParticipantsConnection
- type ParticipantsEdge
- type Platform
- type Post
- type PostContent
- type PostContentInput
- type PostDeletedReason
- type PostType
- type PostsConnection
- type PostsEdge
- type SocialInfo
- type TwitterUserInfo
- type URL
- type UnknownEntity
- type UpdateParticipantInput
- type User
- type UserDevice
- type UserProfile
- type Viewer
- type ViewersConnection
- type ViewersEdge
Constants ¶
View Source
const ( InviteTypeInvite InviteType = "invite" InviteTypeAccessRequestAccepted InviteType = "access_granted" AccessSlugLength = 12 InviteLinkHostname string = "https://m.chatham.ai/d" )
View Source
const ( ParticipantPrefix = "participant" DiscussionPrefix = "discussion" )
View Source
const (
ConciergeUser = "88c8c5ae-41e9-49ef-b5ea-db2e08762693"
)
Variables ¶
View Source
var AllAnonymityType = []AnonymityType{ AnonymityTypeUnknown, AnonymityTypeWeak, AnonymityTypeStrong, }
View Source
var AllDiscussionJoinabilityResponse = []DiscussionJoinabilityResponse{ DiscussionJoinabilityResponseAlreadyJoined, DiscussionJoinabilityResponseApprovedNotJoined, DiscussionJoinabilityResponseAwaitingApproval, DiscussionJoinabilityResponseApprovalRequired, DiscussionJoinabilityResponseDenied, }
View Source
var AllDiscussionJoinabilitySetting = []DiscussionJoinabilitySetting{ DiscussionJoinabilitySettingAllowTwitterFriends, DiscussionJoinabilitySettingAllRequireApproval, }
View Source
var AllDiscussionSubscriptionEventType = []DiscussionSubscriptionEventType{ DiscussionSubscriptionEventTypePostAdded, DiscussionSubscriptionEventTypePostDeleted, DiscussionSubscriptionEventTypeParticipantBanned, }
View Source
var AllDiscussionUserAccessState = []DiscussionUserAccessState{ DiscussionUserAccessStateActive, DiscussionUserAccessStateArchived, DiscussionUserAccessStateDeleted, DiscussionUserAccessStateBanned, }
View Source
var AllDiscussionUserNotificationSetting = []DiscussionUserNotificationSetting{ DiscussionUserNotificationSettingNone, DiscussionUserNotificationSettingMentions, DiscussionUserNotificationSettingEverything, }
View Source
var AllGradientColor = []GradientColor{ GradientColorUnknown, GradientColorMauve, GradientColorFuschia, GradientColorCinnabar, GradientColorVermillion, GradientColorCerulean, GradientColorTurquoise, GradientColorCeladon, GradientColorTaupe, GradientColorSaffron, GradientColorViridian, GradientColorChartruese, GradientColorLavender, GradientColorGoldenrod, GradientColorSeafoam, GradientColorAzalea, GradientColorViolet, GradientColorMahogany, }
View Source
var AllInviteRequestStatus = []InviteRequestStatus{ InviteRequestStatusAccepted, InviteRequestStatusRejected, InviteRequestStatusPending, InviteRequestStatusCancelled, }
View Source
var AllPlatform = []Platform{ PlatformUnknown, PlatformIos, PlatformAndroid, PlatformWeb, }
View Source
var AllPostDeletedReason = []PostDeletedReason{ PostDeletedReasonUnknown, PostDeletedReasonModeratorRemoved, PostDeletedReasonParticipantRemoved, }
View Source
var AllPostType = []PostType{ PostTypeStandard, PostTypeImportedContent, PostTypeAlert, PostTypeConcierge, }
View Source
var ( DatabaseModels = []interface{}{ User{}, UserProfile{}, Moderator{}, Discussion{}, Participant{}, PostContent{}, Post{}, Viewer{}, } )
Functions ¶
func EncodeCursor ¶
Types ¶
type AddDiscussionParticipantInput ¶
type AddDiscussionParticipantInput struct { GradientColor *GradientColor `json:"gradientColor"` HasJoined *bool `json:"hasJoined"` IsAnonymous bool `json:"isAnonymous"` }
type AnonymityType ¶
type AnonymityType string
const ( AnonymityTypeUnknown AnonymityType = "UNKNOWN" AnonymityTypeWeak AnonymityType = "WEAK" AnonymityTypeStrong AnonymityType = "STRONG" )
func (AnonymityType) IsValid ¶
func (e AnonymityType) IsValid() bool
func (AnonymityType) MarshalGQL ¶
func (e AnonymityType) MarshalGQL(w io.Writer)
func (AnonymityType) String ¶
func (e AnonymityType) String() string
func (*AnonymityType) UnmarshalGQL ¶
func (e *AnonymityType) UnmarshalGQL(v interface{}) error
type ArchivedPost ¶
type ArchivedPost struct { PostType PostType `json:"postType"` CreatedAt time.Time `json:"createdAt" gorm:"not null;default:CURRENT_TIMESTAMP;"` ParticipantName string `json:"participantName"` Content string `json:"content"` MentionedEntities []string `json:"mentioned_entities"` MediaID *string `json:"mediaID"` }
type CanJoinDiscussionResponse ¶
type CanJoinDiscussionResponse struct { Response DiscussionJoinabilityResponse `json:"response"` Reason *string `json:"reason"` ReasonCode *int `json:"reasonCode"` }
type Discussion ¶
type Discussion struct { Entity ID string `json:"id" dynamodbav:"ID" gorm:"type:varchar(36);"` CreatedAt time.Time `json:"createdAt" gorm:"not null;default:CURRENT_TIMESTAMP;"` UpdatedAt time.Time `json:"updatedAt" gorm:"not null;default:CURRENT_TIMESTAMP ONUPDATE CURRENT_TIMESTAMP;"` DeletedAt *time.Time `json:"deletedAt"` Title string `json:"title" gorm:"not null;"` Description string `json:"description"` TitleHistory postgres.Jsonb `json:"titleHistory" gorm:"type:jsonb"` DescriptionHistory postgres.Jsonb `json:"descriptionHistory" gorm:"type:jsonb"` AnonymityType AnonymityType `json:"anonymityType" gorm:"type:varchar(36);not null;"` ModeratorID *string `json:"moderatorID" gorm:"type:varchar(36);"` Moderator *Moderator `json:"moderator" gorm:"foreignKey:ModeratorID;"` Posts []*Post `gorm:"foreignKey:DiscussionID;"` PostConnections *PostsConnection `json:"posts" dynamodbav:"-" gorm:"-"` Participants []*Participant `json:"participants" dynamodbav:"-" gorm:"foreignKey:DiscussionID;"` IconURL *string `json:"icon_url"` DiscussionJoinability DiscussionJoinabilitySetting `json:"discussion_joinability"` LastPostID *string `json:"last_post_id"` LastPostCreatedAt *time.Time `json:"last_post_created_at"` ShuffleCount int `json:"shuffle_count"` LockStatus bool `json:"lock_status"` }
func (*Discussion) AddDescriptionToHistory ¶
func (d *Discussion) AddDescriptionToHistory(description string) error
func (*Discussion) AddTitleToHistory ¶
func (d *Discussion) AddTitleToHistory(title string) error
func (*Discussion) DescriptionHistoryAsObject ¶
func (d *Discussion) DescriptionHistoryAsObject() ([]*HistoricalString, error)
func (Discussion) IsEntity ¶
func (Discussion) IsEntity()
func (*Discussion) TitleHistoryAsObject ¶
func (d *Discussion) TitleHistoryAsObject() ([]*HistoricalString, error)
type DiscussionAccessLink ¶
type DiscussionAccessRequest ¶
type DiscussionArchive ¶
type DiscussionCreationSettings ¶
type DiscussionCreationSettings struct {
DiscussionJoinability DiscussionJoinabilitySetting `json:"discussionJoinability"`
}
type DiscussionInput ¶
type DiscussionInput struct { AnonymityType *AnonymityType `json:"anonymityType"` Title *string `json:"title"` Description *string `json:"description"` PublicAccess *bool `json:"publicAccess"` IconURL *string `json:"iconURL"` DiscussionJoinability *DiscussionJoinabilitySetting `json:"discussionJoinability"` LastPostID *string `json:"lastPostID"` LastPostCreatedAt *time.Time `json:"lastPostCreatedAt"` LockStatus *bool `json:"lockStatus"` }
type DiscussionJoinabilityResponse ¶
type DiscussionJoinabilityResponse string
const ( DiscussionJoinabilityResponseAlreadyJoined DiscussionJoinabilityResponse = "ALREADY_JOINED" DiscussionJoinabilityResponseApprovedNotJoined DiscussionJoinabilityResponse = "APPROVED_NOT_JOINED" DiscussionJoinabilityResponseAwaitingApproval DiscussionJoinabilityResponse = "AWAITING_APPROVAL" DiscussionJoinabilityResponseApprovalRequired DiscussionJoinabilityResponse = "APPROVAL_REQUIRED" DiscussionJoinabilityResponseDenied DiscussionJoinabilityResponse = "DENIED" )
func (DiscussionJoinabilityResponse) IsValid ¶
func (e DiscussionJoinabilityResponse) IsValid() bool
func (DiscussionJoinabilityResponse) MarshalGQL ¶
func (e DiscussionJoinabilityResponse) MarshalGQL(w io.Writer)
func (DiscussionJoinabilityResponse) String ¶
func (e DiscussionJoinabilityResponse) String() string
func (*DiscussionJoinabilityResponse) UnmarshalGQL ¶
func (e *DiscussionJoinabilityResponse) UnmarshalGQL(v interface{}) error
type DiscussionJoinabilitySetting ¶
type DiscussionJoinabilitySetting string
const ( DiscussionJoinabilitySettingAllowTwitterFriends DiscussionJoinabilitySetting = "ALLOW_TWITTER_FRIENDS" DiscussionJoinabilitySettingAllRequireApproval DiscussionJoinabilitySetting = "ALL_REQUIRE_APPROVAL" )
func (DiscussionJoinabilitySetting) IsValid ¶
func (e DiscussionJoinabilitySetting) IsValid() bool
func (DiscussionJoinabilitySetting) MarshalGQL ¶
func (e DiscussionJoinabilitySetting) MarshalGQL(w io.Writer)
func (DiscussionJoinabilitySetting) String ¶
func (e DiscussionJoinabilitySetting) String() string
func (*DiscussionJoinabilitySetting) UnmarshalGQL ¶
func (e *DiscussionJoinabilitySetting) UnmarshalGQL(v interface{}) error
type DiscussionParticipantKey ¶
type DiscussionParticipantKey struct { DiscussionID string `json:"discussionID"` ParticipantID int `json:"participantID"` }
func (DiscussionParticipantKey) MarshalDynamoDBAttributeValue ¶
func (d DiscussionParticipantKey) MarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error
func (DiscussionParticipantKey) String ¶
func (d DiscussionParticipantKey) String() string
type DiscussionParticipantKeys ¶
type DiscussionParticipantKeys struct {
Keys []DiscussionParticipantKey `json:"keys" dynamodbav:",omitempty"`
}
func (DiscussionParticipantKeys) MarshalDynamoDBAttributeValue ¶
func (d DiscussionParticipantKeys) MarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error
func (*DiscussionParticipantKeys) UnmarshalDynamoDBAttributeValue ¶
func (d *DiscussionParticipantKeys) UnmarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error
type DiscussionPostKey ¶
type DiscussionShuffleTime ¶
type DiscussionSubscriptionEntity ¶
type DiscussionSubscriptionEntity interface {
IsDiscussionSubscriptionEntity()
}
type DiscussionSubscriptionEvent ¶
type DiscussionSubscriptionEvent struct { EventType DiscussionSubscriptionEventType `json:"eventType"` Entity DiscussionSubscriptionEntity `json:"entity"` }
type DiscussionSubscriptionEventType ¶
type DiscussionSubscriptionEventType string
const ( DiscussionSubscriptionEventTypePostAdded DiscussionSubscriptionEventType = "POST_ADDED" DiscussionSubscriptionEventTypePostDeleted DiscussionSubscriptionEventType = "POST_DELETED" DiscussionSubscriptionEventTypeParticipantBanned DiscussionSubscriptionEventType = "PARTICIPANT_BANNED" )
func (DiscussionSubscriptionEventType) IsValid ¶
func (e DiscussionSubscriptionEventType) IsValid() bool
func (DiscussionSubscriptionEventType) MarshalGQL ¶
func (e DiscussionSubscriptionEventType) MarshalGQL(w io.Writer)
func (DiscussionSubscriptionEventType) String ¶
func (e DiscussionSubscriptionEventType) String() string
func (*DiscussionSubscriptionEventType) UnmarshalGQL ¶
func (e *DiscussionSubscriptionEventType) UnmarshalGQL(v interface{}) error
type DiscussionUserAccess ¶
type DiscussionUserAccessState ¶
type DiscussionUserAccessState string
const ( DiscussionUserAccessStateActive DiscussionUserAccessState = "ACTIVE" DiscussionUserAccessStateArchived DiscussionUserAccessState = "ARCHIVED" DiscussionUserAccessStateDeleted DiscussionUserAccessState = "DELETED" DiscussionUserAccessStateBanned DiscussionUserAccessState = "BANNED" )
func (DiscussionUserAccessState) IsValid ¶
func (e DiscussionUserAccessState) IsValid() bool
func (DiscussionUserAccessState) MarshalGQL ¶
func (e DiscussionUserAccessState) MarshalGQL(w io.Writer)
func (DiscussionUserAccessState) String ¶
func (e DiscussionUserAccessState) String() string
func (*DiscussionUserAccessState) UnmarshalGQL ¶
func (e *DiscussionUserAccessState) UnmarshalGQL(v interface{}) error
type DiscussionUserNotificationSetting ¶
type DiscussionUserNotificationSetting string
const ( DiscussionUserNotificationSettingNone DiscussionUserNotificationSetting = "NONE" DiscussionUserNotificationSettingMentions DiscussionUserNotificationSetting = "MENTIONS" DiscussionUserNotificationSettingEverything DiscussionUserNotificationSetting = "EVERYTHING" )
func (DiscussionUserNotificationSetting) IsValid ¶
func (e DiscussionUserNotificationSetting) IsValid() bool
func (DiscussionUserNotificationSetting) MarshalGQL ¶
func (e DiscussionUserNotificationSetting) MarshalGQL(w io.Writer)
func (DiscussionUserNotificationSetting) String ¶
func (e DiscussionUserNotificationSetting) String() string
func (*DiscussionUserNotificationSetting) UnmarshalGQL ¶
func (e *DiscussionUserNotificationSetting) UnmarshalGQL(v interface{}) error
type DiscussionUserSettings ¶
type DiscussionUserSettings struct { State *DiscussionUserAccessState `json:"state"` NotifSetting *DiscussionUserNotificationSetting `json:"notifSetting"` }
type DiscussionViewerKey ¶
type DiscussionViewerKey struct { DiscussionID string `json:"discussionID"` ViewerID string `json:"participantID"` }
func (DiscussionViewerKey) MarshalDynamoDBAttributeValue ¶
func (d DiscussionViewerKey) MarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error
func (DiscussionViewerKey) String ¶
func (d DiscussionViewerKey) String() string
type DiscussionViewerKeys ¶
type DiscussionViewerKeys struct {
Keys []DiscussionViewerKey `json:"keys" dynamodbav:",omitempty"`
}
func (DiscussionViewerKeys) MarshalDynamoDBAttributeValue ¶
func (d DiscussionViewerKeys) MarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error
func (*DiscussionViewerKeys) UnmarshalDynamoDBAttributeValue ¶
func (d *DiscussionViewerKeys) UnmarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error
type DiscussionsConnection ¶
type DiscussionsConnection struct { IDs []string From int To int Edges []*DiscussionsEdge }
func (*DiscussionsConnection) PageInfo ¶
func (d *DiscussionsConnection) PageInfo() PageInfo
func (*DiscussionsConnection) TotalCount ¶
func (d *DiscussionsConnection) TotalCount() int
type DiscussionsEdge ¶
type DiscussionsEdge struct { Cursor string `json:"cursor"` Node *Discussion `json:"node"` }
type GradientColor ¶
type GradientColor string
const ( GradientColorUnknown GradientColor = "UNKNOWN" GradientColorMauve GradientColor = "MAUVE" GradientColorFuschia GradientColor = "FUSCHIA" GradientColorCinnabar GradientColor = "CINNABAR" GradientColorVermillion GradientColor = "VERMILLION" GradientColorCerulean GradientColor = "CERULEAN" GradientColorTurquoise GradientColor = "TURQUOISE" GradientColorCeladon GradientColor = "CELADON" GradientColorTaupe GradientColor = "TAUPE" GradientColorSaffron GradientColor = "SAFFRON" GradientColorViridian GradientColor = "VIRIDIAN" GradientColorChartruese GradientColor = "CHARTRUESE" GradientColorLavender GradientColor = "LAVENDER" GradientColorGoldenrod GradientColor = "GOLDENROD" GradientColorSeafoam GradientColor = "SEAFOAM" GradientColorAzalea GradientColor = "AZALEA" GradientColorViolet GradientColor = "VIOLET" GradientColorMahogany GradientColor = "MAHOGANY" )
func (GradientColor) IsValid ¶
func (e GradientColor) IsValid() bool
func (GradientColor) MarshalGQL ¶
func (e GradientColor) MarshalGQL(w io.Writer)
func (GradientColor) String ¶
func (e GradientColor) String() string
func (*GradientColor) UnmarshalGQL ¶
func (e *GradientColor) UnmarshalGQL(v interface{}) error
type HistoricalString ¶
type InviteRequestStatus ¶
type InviteRequestStatus string
const ( InviteRequestStatusAccepted InviteRequestStatus = "ACCEPTED" InviteRequestStatusRejected InviteRequestStatus = "REJECTED" InviteRequestStatusPending InviteRequestStatus = "PENDING" InviteRequestStatusCancelled InviteRequestStatus = "CANCELLED" )
func (InviteRequestStatus) IsValid ¶
func (e InviteRequestStatus) IsValid() bool
func (InviteRequestStatus) MarshalGQL ¶
func (e InviteRequestStatus) MarshalGQL(w io.Writer)
func (InviteRequestStatus) String ¶
func (e InviteRequestStatus) String() string
func (*InviteRequestStatus) UnmarshalGQL ¶
func (e *InviteRequestStatus) UnmarshalGQL(v interface{}) error
type InviteType ¶
type InviteType string
type Moderator ¶
type Moderator struct { ID string `json:"id" gorm:"type:varchar(36);"` CreatedAt time.Time `json:"createdAt" gorm:"not null;default:CURRENT_TIMESTAMP;"` UpdatedAt time.Time `json:"updatedAt" gorm:"not null;default:CURRENT_TIMESTAMP ONUPDATE CURRENT_TIMESTAMP;"` DeletedAt *time.Time `json:"deletedAt"` UserProfileID *string `json:"userProfileID" gorm:"type:varchar(36);"` UserProfile *UserProfile `json:"userProfile" dynamodbav:"-" gorm:"foreignKey:UserProfileID;"` Discussion *Discussion `gorm:"-" dynamodbav:"-"` }
type ParsedEntityID ¶
type Participant ¶
type Participant struct { Entity DiscussionSubscriptionEntity ID string `json:"id" gorm:"type:varchar(36);"` ParticipantID int `json:"participantID" dynamodbav:"ParticipantID"` CreatedAt time.Time `json:"createdAt" gorm:"not null;default:CURRENT_TIMESTAMP;"` UpdatedAt time.Time `json:"updatedAt" gorm:"not null;default:CURRENT_TIMESTAMP ONUPDATE CURRENT_TIMESTAMP;"` DeletedAt *time.Time `json:"deletedAt"` DiscussionID *string `json:"discussionID" dynamodbav:"DiscussionID" gorm:"type:varchar(36);"` Discussion *Discussion `json:"discussion" dynamodbav:"-" gorm:"foreignKey:DiscussionID;"` ViewerID *string `json:"viewerID" gorm:"type:varchar(36);"` Viewer *Viewer `json:"viewer" dynamodbav:"-" gorm:"foreignKey:ViewerID;"` Posts *PostsConnection `json:"posts" dynamodbav:"-"` GradientColor *GradientColor `json:"gradientColor" gorm:"type:varchar(36);not null;"` UserID *string `json:"userID" gorm:"type:varchar(36);"` User *User `json:"user" dynamodbav:"-" gorm:"foreignKey:UserID;"` InviterID *string `json:"inviterID" gorm:"type:varchar(36);"` IsBanned bool `json:"isBanned" gorm:"type:boolean;"` HasJoined bool `json:"hasJoined" gorm:"type:boolean;"` IsAnonymous bool `json:"isAnonymous"` MutedUntil *time.Time `json:"mutedUntil"` }
func (Participant) IsEntity ¶
func (Participant) IsEntity()
type ParticipantProfile ¶
type ParticipantProfile struct { IsAnonymous *bool `json:"isAnonymous"` GradientColor *GradientColor `json:"gradientColor"` }
type ParticipantsConnection ¶
type ParticipantsConnection struct {
// contains filtered or unexported fields
}
func (*ParticipantsConnection) PageInfo ¶
func (p *ParticipantsConnection) PageInfo() PageInfo
func (*ParticipantsConnection) TotalCount ¶
func (p *ParticipantsConnection) TotalCount() int
type ParticipantsEdge ¶
type ParticipantsEdge struct { Cursor string `json:"cursor"` Node *Participant `json:"node"` }
type Post ¶
type Post struct { DiscussionSubscriptionEntity ID string `json:"id" dynamodbav:"ID" gorm:"type:varchar(36);"` PostType PostType `json:"postType"` CreatedAt time.Time `json:"createdAt" gorm:"not null;default:CURRENT_TIMESTAMP;"` UpdatedAt time.Time `json:"updatedAt" gorm:"not null;default:CURRENT_TIMESTAMP ONUPDATE CURRENT_TIMESTAMP;"` DeletedAt *time.Time `json:"deletedAt"` DeletedReasonCode *PostDeletedReason `json:"deletedReasonCode" gorm:"type:varchar(36);"` Discussion *Discussion `json:"discussion" dynamodbav:"-" gorm:"foreignkey:DiscussionID;"` DiscussionID *string `json:"discussionID" dynamodbav:"DiscussionID" gorm:"type:varchar(36);"` Participant *Participant `json:"participant" dynamodbav:"-" gorm:"foreignkey:ParticipantID;"` ParticipantID *string `json:"participantID" gorm:"varchar(36);"` PostContentID *string `json:"postContentID" gorm:"type:varchar(36);"` PostContent *PostContent `json:"postContent" gorm:"foreignkey:PostContentID;"` // TODO: Do we want to also log the post_content ID so that quoted text doesn't change? QuotedPostID *string `json:"quotedPostID" gorm:"type:varchar(36);"` QuotedPost *Post MediaID *string }
type PostContent ¶
type PostContent struct { ID string `json:"id" gorm:"type:varchar(36);"` Content string `json:"content" gorm:"type:text;"` MentionedEntities []string `json:"mentionedEntities" gorm:"type:varchar(50)[];"` CreatedAt time.Time `json:"createdAt" gorm:"not null;default:CURRENT_TIMESTAMP;"` UpdatedAt time.Time `json:"updatedAt" gorm:"not null;default:CURRENT_TIMESTAMP ONUPDATE CURRENT_TIMESTAMP;"` }
This is really a placeholder rn. We will want the following: * Edit history and active version * Markup (e.g. when people are tagged having that be an ID or a token) * URL Wrapping * Ability to contain different types of posts (e.g. images, twitter cards)
type PostContentInput ¶
type PostDeletedReason ¶
type PostDeletedReason string
const ( PostDeletedReasonUnknown PostDeletedReason = "UNKNOWN" PostDeletedReasonModeratorRemoved PostDeletedReason = "MODERATOR_REMOVED" PostDeletedReasonParticipantRemoved PostDeletedReason = "PARTICIPANT_REMOVED" )
func (PostDeletedReason) IsValid ¶
func (e PostDeletedReason) IsValid() bool
func (PostDeletedReason) MarshalGQL ¶
func (e PostDeletedReason) MarshalGQL(w io.Writer)
func (PostDeletedReason) String ¶
func (e PostDeletedReason) String() string
func (*PostDeletedReason) UnmarshalGQL ¶
func (e *PostDeletedReason) UnmarshalGQL(v interface{}) error
type PostsConnection ¶
type SocialInfo ¶
type SocialInfo struct { CreatedAt time.Time `json:"createdAt" gorm:"not null;default:CURRENT_TIMESTAMP;"` UpdatedAt time.Time `json:"updatedAt" gorm:"not null;default:CURRENT_TIMESTAMP ONUPDATE CURRENT_TIMESTAMP;"` DeletedAt *time.Time `json:"deletedAt"` AccessToken string `json:"accessToken"` AccessTokenSecret string `json:"accessTokenSecret"` // NOTE: This is the social network UserID (not Chatham) UserID string `json:"userID"` ProfileImageURL string `json:"profileImageURL"` ScreenName string `json:"screenName"` IsVerified bool `json:"isVerified"` Network string `json:"network" gorm:"type:varchar(16);primary_key;auto_increment:false;"` UserProfileID string `json:"user_profile_id" gorm:"type:varchar(32);primary_key;auto_increment:false;"` }
type TwitterUserInfo ¶
type UnknownEntity ¶
type UnknownEntity struct {
ID string `json:"id"`
}
func (UnknownEntity) IsEntity ¶
func (UnknownEntity) IsEntity()
type UpdateParticipantInput ¶
type UpdateParticipantInput struct { GradientColor *GradientColor `json:"gradientColor"` IsUnsetGradient *bool `json:"isUnsetGradient"` IsAnonymous *bool `json:"isAnonymous"` HasJoined *bool `json:"hasJoined"` }
type User ¶
type User struct { ID string `json:"id" dynamodbav:"ID" gorm:"type:varchar(36);"` CreatedAt time.Time `json:"createdAt" gorm:"not null;default:CURRENT_TIMESTAMP;"` UpdatedAt time.Time `json:"updatedAt" gorm:"not null;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;"` DeletedAt *time.Time `json:"deletedAt"` UserProfile *UserProfile `json:"userProfile" dynamodbav:"-" gorm:"foreignkey:UserID;"` // Going through a `through` table so we can encrypt this in the future. Participants []*Participant `json:"participants" dynamodbav:"-" gorm:"foreignKey:UserID;"` Viewers []*Viewer `json:"viewers" dynamodbav:"-" gorm:"foreignKey:UserID;"` }
type UserDevice ¶
type UserDevice struct { ID string `json:"id" gorm:"type:varchar(36);"` CreatedAt time.Time `json:"createdAt" gorm:"not null;default:CURRENT_TIMESTAMP;"` DeletedAt *time.Time `json:"deletedAt"` Platform string `json:"platform" gorm:"not null;"` LastSeen time.Time `json:"lastSeen" gorm:"not null;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;"` Token *string `json:"token" gorm:"type:varchar(128);"` UserID *string `json:"userID" gorm:"type:varchar(36);"` User *User `json:"user" gorm:"foreignKey:UserID;"` }
type UserProfile ¶
type UserProfile struct { ID string `json:"id" gorm:"type:varchar(32);"` CreatedAt time.Time `json:"createdAt" gorm:"not null;default:CURRENT_TIMESTAMP;"` UpdatedAt time.Time `json:"updatedAt" gorm:"not null;default:CURRENT_TIMESTAMP ONUPDATE CURRENT_TIMESTAMP;"` DeletedAt *time.Time `json:"deletedAt"` DisplayName string `json:"displayName" gorm:"type:varchar(256);"` UserID *string `json:"userID" dynamodbav:",omitempty" gorm:"type:varchar(32);"` // Handle without the `@` sign. TwitterHandle string `json:"twitterHandle"` SocialInfos []SocialInfo `json:"socialInfos" gorm:"foreignKey:UserProfileID;PRELOAD:true;"` }
func (*UserProfile) TwitterURL ¶
func (u *UserProfile) TwitterURL() URL
type Viewer ¶
type Viewer struct { ID string `json:"id" dynamodbav:"ViewerID" gorm:"type:varchar(36);"` CreatedAt time.Time `json:"createdAt" gorm:"not null;default:CURRENT_TIMESTAMP;"` UpdatedAt time.Time `json:"updatedAt" gorm:"not null;default:CURRENT_TIMESTAMP ONUPDATE CURRENT_TIMESTAMP;"` DeletedAt *time.Time `json:"deletedAt"` DiscussionID *string `json:"discussionID" dynamodbav:"DiscussionID" gorm:"type:varchar(36);"` Discussion *Discussion `json:"discussion" dynamodbav:"-" gorm:"-"` //gorm:"foreignkey:discussion_id;association_foreignkey:id;"` LastViewed *time.Time `json:"lastViewed"` LastViewedPostID *string `json:"lastViewedPostID" gorm:"type:varchar(36);"` LastViewedPost *Post `json:"lastViewedPost" dynamodbav:"-" gorm:"foreignKey:LastViewedPostID;"` //gorm:"foreignkey:last_post_viewed_id;association_foreignkey:id;"` // NOTE: This is not exposed currently but keeping it here for // testing purposes. We will try out exposing user information one of the tests. UserID *string `json:"userID" gorm:"type:varchar(36);"` User *User `json:"user" dynamodbav:"-" gorm:"-"` }
type ViewersConnection ¶
type ViewersConnection struct {
// contains filtered or unexported fields
}
func (*ViewersConnection) PageInfo ¶
func (v *ViewersConnection) PageInfo() PageInfo
func (*ViewersConnection) TotalCount ¶
func (v *ViewersConnection) TotalCount() int
type ViewersEdge ¶
Source Files ¶
- discussion.go
- discussion_archive.go
- discussion_participant_key.go
- discussion_post_key.go
- discussion_shuffle_time.go
- discussion_viewer_key.go
- discussions_connection.go
- discussions_edge.go
- mention.go
- models.go
- models_gen.go
- moderator.go
- page_info.go
- participant.go
- post.go
- post_content.go
- twitter_user_info.go
- user.go
- user_device.go
- user_profile.go
- viewer.go
Click to show internal directories.
Click to hide internal directories.