model

package
v0.0.0-...-ed3c475 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

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 (
	DatabaseModels = []interface{}{
		User{},
		UserProfile{},
		Moderator{},
		Discussion{},
		Participant{},
		PostContent{},
		Post{},
		Viewer{},
	}
)

Functions

func EncodeCursor

func EncodeCursor(i int) string

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 struct {
	DiscussionID string `json:"discussionID"`
	LinkSlug     string `json:"linkSlug"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
	DeletedAt    *time.Time
}

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 DiscussionArchive

type DiscussionArchive struct {
	DiscussionID string         `json:"discussionID"`
	Archive      postgres.Jsonb `json:"archive"`
	CreatedAt    time.Time      `json:"createdAt"`
}

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

type DiscussionShuffleTime

type DiscussionShuffleTime struct {
	DiscussionID string     `json:"discussionID"`
	ShuffleTime  *time.Time `json:"shuffleTime"`
}

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 (DiscussionSubscriptionEventType) MarshalGQL

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

func (DiscussionSubscriptionEventType) String

func (*DiscussionSubscriptionEventType) UnmarshalGQL

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

type DiscussionUserAccess

type DiscussionUserAccess struct {
	DiscussionID string
	UserID       string
	State        DiscussionUserAccessState
	NotifSetting DiscussionUserNotificationSetting
	CreatedAt    time.Time
	UpdatedAt    time.Time
	DeletedAt    *time.Time
	RequestID    *string
}

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 (DiscussionUserNotificationSetting) MarshalGQL

func (DiscussionUserNotificationSetting) 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 Entity

type Entity interface {
	IsEntity()
}

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 HistoricalString struct {
	Value     string    `json:"value"`
	CreatedAt time.Time `json:"createdAt"`
}

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 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
	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 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 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 PostContentInput struct {
	PostText          string   `json:"postText"`
	PostType          PostType `json:"postType"`
	MentionedEntities []string `json:"mentionedEntities"`
	QuotedPostID      *string  `json:"quotedPostID"`
	MediaID           *string  `json:"mediaID"`
	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 TwitterUserInfo

type TwitterUserInfo struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	DisplayName     string `json:"displayName"`
	ProfileImageURL string `json:"profileImageURL"`
	Verified        bool   `json:"verified"`
	Invited         bool   `json:"invited"`
}

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"`
	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

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