model

package
v0.0.0-...-880b486 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InviteTypeInvite                InviteType = "invite"
	InviteTypeAccessRequestAccepted InviteType = "access_granted"

	InviteLinkHostname string = "https://m.chatham.ai/join"
)
View Source
const (
	ParticipantPrefix = "participant"
	DiscussionPrefix  = "discussion"

	// DripPostType tells us if the imported content was dripped manually by the mod,
	// automatically via the discussion tags and drip, OR scheduled by the mod.
	ManualDrip    DripPostType = "manual"
	AutoDrip      DripPostType = "auto"
	ScheduledDrip DripPostType = "scheduled"

	AppActionCopyToClipboard AppActionID = "db5fd0da-d645-4aa2-990c-b61d004a45e1"
	AppActionRenameChat      AppActionID = "d81118d6-427a-4267-96be-45cadd94b782"

	MutationUpdateFlairAccessToDiscussion MutationID = "4e960003-da38-4971-a23b-98953cb5ce4b"
	MutationUpdateInvitationApproval      MutationID = "84c0e197-6394-4b9a-87dc-91e75e7faf67"
	MutationUpdateViewerAccessibility     MutationID = "e8c71b3c-b984-4090-b032-7dbfd374e8c9"
	MutationUpdateDiscussionNameAndEmoji  MutationID = "633cb21f-a004-45d4-b4e8-bd6cd0bdaea9"
)
View Source
const (
	ConciergeUser = "88c8c5ae-41e9-49ef-b5ea-db2e08762693"
)

Variables

View Source
var (
	DatabaseModels = []interface{}{
		User{},
		UserProfile{},
		Moderator{},
		Discussion{},
		FlairTemplate{},
		Flair{},
		Participant{},
		PostContent{},
		Post{},
		Viewer{},
	}
)

Functions

func EncodeCursor

func EncodeCursor(i int) string

Types

type AddDiscussionParticipantInput

type AddDiscussionParticipantInput struct {
	GradientColor *GradientColor `json:"gradientColor"`
	FlairID       *string        `json:"flairID"`
	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 AppActionID

type AppActionID string

type ConciergeContent

type ConciergeContent struct {
	AppActionID *string            `json:"appActionID"`
	MutationID  *string            `json:"mutationID"`
	Options     []*ConciergeOption `json:"options"`
}

type ConciergeOption

type ConciergeOption struct {
	Text     string `json:"text"`
	Value    string `json:"value"`
	Selected bool   `json:"selected"`
}

type ContentQueueRecord

type ContentQueueRecord struct {
	DiscussionID      string
	ImportedContentID string
	CreatedAt         time.Time
	UpdatedAt         time.Time
	DeletedAt         *time.Time
	PostedAt          *time.Time
	MatchingTags      []string
}

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;"`
	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;"`
	AutoPost        bool             `json:"auto_post"`
	IdleMinutes     int              `json:"idle_minutes"`
	PublicAccess    bool             `json:"publicAccess"`
	IconURL         *string          `json:"icon_url"`
}

func (Discussion) IsEntity

func (Discussion) IsEntity()

type DiscussionAccessRequest

type DiscussionAccessRequest struct {
	ID           string `json:"id"`
	UserID       string
	DiscussionID string
	CreatedAt    string              `json:"createdAt"`
	UpdatedAt    string              `json:"updatedAt"`
	IsDeleted    bool                `json:"isDeleted"`
	Status       InviteRequestStatus `json:"status"`
}

type DiscussionAutoPost

type DiscussionAutoPost struct {
	ID          string
	IdleMinutes int
}

type DiscussionFlairTemplateAccess

type DiscussionFlairTemplateAccess struct {
	DiscussionID    string
	FlairTemplateID string
	CreatedAt       time.Time
	UpdatedAt       time.Time
	DeletedAt       *time.Time
}

type DiscussionInput

type DiscussionInput struct {
	AnonymityType *AnonymityType `json:"anonymityType"`
	Title         *string        `json:"title"`
	AutoPost      *bool          `json:"autoPost"`
	IdleMinutes   *int           `json:"idleMinutes"`
	PublicAccess  *bool          `json:"publicAccess"`
	IconURL       *string        `json:"iconURL"`
}

type DiscussionInvite

type DiscussionInvite struct {
	ID                    string `json:"id"`
	UserID                string
	DiscussionID          string
	InvitingParticipantID string
	CreatedAt             string              `json:"createdAt"`
	UpdatedAt             string              `json:"updatedAt"`
	IsDeleted             bool                `json:"isDeleted"`
	Status                InviteRequestStatus `json:"status"`
	InviteType            InviteType
}

type DiscussionLinkAccess

type DiscussionLinkAccess struct {
	DiscussionID      string `json:"discussionID"`
	InviteLinkSlug    string `json:"inviteLinkSlug"`
	VipInviteLinkSlug string `json:"vipInviteLinkSlug"`
	CreatedAt         string `json:"createdAt"`
	UpdatedAt         string `json:"updatedAt"`
	IsDeleted         bool   `json:"isDeleted"`
}

type DiscussionNotificationPreferences

type DiscussionNotificationPreferences interface {
	IsDiscussionNotificationPreferences()
}

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 DiscussionPostKey struct {
	DiscussionID  string    `json:"discussionID"`
	PostCreatedAt time.Time `json:"postCreatedAt"`
}

type DiscussionUserAccess

type DiscussionUserAccess struct {
	DiscussionID string
	UserID       string
	CreatedAt    time.Time
	UpdatedAt    time.Time
	DeletedAt    *time.Time
}

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 DripPostType

type DripPostType string

type Entity

type Entity interface {
	IsEntity()
}

type Flair

type Flair struct {
	ID         string         `json:"id" dynamodbav:"ID" gorm:"type:varchar(36);primary_key;"`
	TemplateID string         `json:"templateID" dynamodbav:"TemplateID" gorm:"type:varchar(36);"`
	Template   *FlairTemplate `json:"template" dynamodbav:"-" gorm:"foreignKey:TemplateID;"`
	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"`

	// NOTE: This is not exposed as of 05/01/2020
	UserID string `json:"userID" dynamodbav:"UserID" gorm:"type:varchar(36);"`
	User   *User  `json:"user" dynamodbav:"-" gorm:"foreignKey:UserID;"`
}

type FlairTemplate

type FlairTemplate struct {
	ID          string     `json:"id" dynamodbav:"ID" gorm:"type:varchar(36);primary_key;"`
	DisplayName *string    `json:"displayName" gorm:"type:varchar(64);"`
	ImageURL    *string    `json:"imageURL" gorm:"type:text;"`
	Source      string     `json:"source" gorm:"type:varchar(128);not null;"`
	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"`
}

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 ImportedContent

type ImportedContent struct {
	ID          string
	CreatedAt   time.Time
	ContentName string
	ContentType string
	Link        string
	Overview    string
	Source      string
	Tags        []string
}

type ImportedContentInput

type ImportedContentInput struct {
	ContentName string `json:"content_name"`
	ContentType string `json:"content_type"`
	Link        string `json:"link"`
	Overview    string `json:"overview"`
	Source      string `json:"source"`
	Tags        string `json:"tags"`
}

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 Media

type Media struct {
	ID                string             `json:"id"`
	CreatedAt         string             `json:"createdAt"`
	IsDeleted         bool               `json:"isDeleted"`
	DeletedReasonCode *PostDeletedReason `json:"deletedReasonCode"`
	MediaType         *string            `json:"mediaType"`
	MediaSize         *MediaSize         `json:"mediaSize"`
	AssetLocation     *string            `json:"assetLocation"`
}

type MediaSize

type MediaSize struct {
	Height int     `json:"height"`
	Width  int     `json:"width"`
	SizeKb float64 `json:"sizeKb"`
}

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 MutationID

type MutationID string

type PageInfo

type PageInfo struct {
	StartCursor *string `json:"startCursor"`
	EndCursor   *string `json:"endCursor"`
	HasNextPage bool    `json:"hasNextPage"`
}

type ParsedEntityID

type ParsedEntityID struct {
	ID   string
	Type string
}

type Participant

type Participant struct {
	Entity
	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:"-"`
	FlairID       *string          `json:"flairID" dynamodbav:"FlairID" gorm:"type:varchar(36);"`
	Flair         *Flair           `json:"flair" dynamodbav:"-" gorm:"foreignKey:FlairID;"`
	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"`
}

func (Participant) IsEntity

func (Participant) IsEntity()

type ParticipantNotificationPreferences

type ParticipantNotificationPreferences struct {
	ID string `json:"id"`
}

func (ParticipantNotificationPreferences) IsDiscussionNotificationPreferences

func (ParticipantNotificationPreferences) IsDiscussionNotificationPreferences()

type ParticipantProfile

type ParticipantProfile struct {
	IsAnonymous   *bool          `json:"isAnonymous"`
	Flair         *Flair         `json:"flair"`
	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 Platform

type Platform string
const (
	PlatformUnknown Platform = "UNKNOWN"
	PlatformIos     Platform = "IOS"
	PlatformAndroid Platform = "ANDROID"
	PlatformWeb     Platform = "WEB"
)

func (Platform) IsValid

func (e Platform) IsValid() bool

func (Platform) MarshalGQL

func (e Platform) MarshalGQL(w io.Writer)

func (Platform) String

func (e Platform) String() string

func (*Platform) UnmarshalGQL

func (e *Platform) UnmarshalGQL(v interface{}) error

type PollInput

type PollInput struct {
	PollText string    `json:"pollText"`
	EndTime  time.Time `json:"endTime"`
	Option1  string    `json:"option1"`
	Option2  string    `json:"option2"`
	Option3  *string   `json:"option3"`
	Option4  *string   `json:"option4"`
}

type Post

type Post struct {
	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
	ImportedContentID *string
	ConciergeContent  *ConciergeContent
}

type PostBookmark

type PostBookmark struct {
	ID           string      `json:"id" dynamodbav:"ID"`
	CreatedAt    time.Time   `json:"createdAt"`
	UpdatedAt    time.Time   `json:"updatedAt"`
	DeletedAt    *time.Time  `json:"deletedAt"`
	DiscussionID string      `json:"discussionID"`
	Discussion   *Discussion `json:"discussion" dynamodbav:"-" gorm:"foreignkey:DiscussionID;"`
	PostID       string      `json:"postID"`
	Post         *Post       `json:"post" dynamodbav:"-" gorm:"foreignkey:PostID;"`
}

type PostBookmarksConnection

type PostBookmarksConnection struct {
	// contains filtered or unexported fields
}

func (*PostBookmarksConnection) PageInfo

func (p *PostBookmarksConnection) PageInfo() PageInfo

func (*PostBookmarksConnection) TotalCount

func (p *PostBookmarksConnection) TotalCount() int

type PostBookmarksEdge

type PostBookmarksEdge struct {
	Cursor string        `json:"cursor"`
	Node   *PostBookmark `json:"node"`
}

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 PostContentInput struct {
	PostText          string     `json:"postText"`
	PostType          PostType   `json:"postType"`
	MentionedEntities []string   `json:"mentionedEntities"`
	QuotedPostID      *string    `json:"quotedPostID"`
	MediaID           *string    `json:"mediaID"`
	Poll              *PollInput `json:"poll"`
	ImportedContentID *string    `json:"importedContentID"`
	Preview           *string    `json:"preview"`
}

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 PostType

type PostType string
const (
	PostTypeStandard        PostType = "STANDARD"
	PostTypeImportedContent PostType = "IMPORTED_CONTENT"
	PostTypeAlert           PostType = "ALERT"
	PostTypeConcierge       PostType = "CONCIERGE"
)

func (PostType) IsValid

func (e PostType) IsValid() bool

func (PostType) MarshalGQL

func (e PostType) MarshalGQL(w io.Writer)

func (PostType) String

func (e PostType) String() string

func (*PostType) UnmarshalGQL

func (e *PostType) UnmarshalGQL(v interface{}) error

type PostsConnection

type PostsConnection struct {
	Edges    []*PostsEdge `json:"edges"`
	PageInfo PageInfo     `json:"pageInfo"`
}

type PostsEdge

type PostsEdge struct {
	Cursor string `json:"cursor"`
	Node   *Post  `json:"node"`
}

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 Tag

type Tag struct {
	ID        string
	Tag       string
	CreatedAt time.Time
	DeletedAt *time.Time
}

type URL

type URL struct {
	DisplayText string `json:"displayText"`
	URL         string `json:"url"`
}

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"`
	FlairID         *string        `json:"flairID"`
	IsUnsetFlairID  *bool          `json:"isUnsetFlairID"`
	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;"`
	Flairs       []*Flair       `json:"flairs" dynamodbav:"-" gorm:"foreignKey:FlairID;"`
}

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"`
	//NotificationPreferences ViewerNotificationPreferences `json:"notificationPreferences"`
	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 ViewerNotificationPreferences

type ViewerNotificationPreferences struct {
	ID string `json:"id"`
}

func (ViewerNotificationPreferences) IsDiscussionNotificationPreferences

func (ViewerNotificationPreferences) IsDiscussionNotificationPreferences()

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

type ViewersEdge struct {
	Cursor string  `json:"cursor"`
	Node   *Viewer `json:"node"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL