Documentation ¶
Index ¶
- Variables
- type EntitlementBuilder
- func (b EntitlementBuilder) GetUser() (*UserBuilder, error)
- func (b EntitlementBuilder) Log(str string)
- func (b EntitlementBuilder) LogError(str string)
- func (b EntitlementBuilder) ReadBadgeData() datastructure.EntitledBadge
- func (b EntitlementBuilder) ReadEmoteSetData() datastructure.EntitledEmoteSet
- func (b EntitlementBuilder) ReadPaintData() datastructure.EntitledPaint
- func (b EntitlementBuilder) ReadRoleData() datastructure.EntitledRole
- func (b EntitlementBuilder) ReadSubscriptionData() datastructure.EntitledSubscription
- func (b EntitlementBuilder) SetBadgeData(data datastructure.EntitledBadge) EntitlementBuilder
- func (b EntitlementBuilder) SetEmoteSetData(data datastructure.EntitledEmoteSet) EntitlementBuilder
- func (b EntitlementBuilder) SetKind(kind datastructure.EntitlementKind) EntitlementBuilder
- func (b EntitlementBuilder) SetPaintData(data datastructure.EntitledPaint) EntitlementBuilder
- func (b EntitlementBuilder) SetRoleData(data datastructure.EntitledRole) EntitlementBuilder
- func (b EntitlementBuilder) SetSubscriptionData(data datastructure.EntitledSubscription) EntitlementBuilder
- func (b EntitlementBuilder) SetUserID(id primitive.ObjectID) EntitlementBuilder
- func (b EntitlementBuilder) Write() (EntitlementBuilder, error)
- type MergeEmoteOptions
- type NotificationBuilder
- func (b NotificationBuilder) AddEmoteMentionPart(emote primitive.ObjectID) NotificationBuilder
- func (b NotificationBuilder) AddRoleMentionPart(role primitive.ObjectID) NotificationBuilder
- func (b NotificationBuilder) AddTargetUsers(userIDs ...primitive.ObjectID) NotificationBuilder
- func (b NotificationBuilder) AddTextMessagePart(text string) NotificationBuilder
- func (b NotificationBuilder) AddUserMentionPart(user primitive.ObjectID) NotificationBuilder
- func (b NotificationBuilder) GetMentionedEmotes(ctx context.Context) (NotificationBuilder, map[primitive.ObjectID]bool)
- func (b NotificationBuilder) GetMentionedUsers(ctx context.Context) (NotificationBuilder, map[primitive.ObjectID]bool)
- func (b NotificationBuilder) MarkAsAnnouncement() NotificationBuilder
- func (b NotificationBuilder) SetTitle(title string) NotificationBuilder
- func (b NotificationBuilder) Write(ctx context.Context) error
- type UserBuilder
Constants ¶
This section is empty.
Variables ¶
var Bans *bans = &bans{ BannedUsers: map[primitive.ObjectID]*datastructure.Ban{}, Mtx: &sync.Mutex{}, }
var Emotes emotes = emotes{}
var Entitlements = entitlements{}
var Notifications notifications = notifications{}
var Users users = users{}
Functions ¶
This section is empty.
Types ¶
type EntitlementBuilder ¶
type EntitlementBuilder struct { Entitlement datastructure.Entitlement User *datastructure.User // contains filtered or unexported fields }
func (EntitlementBuilder) GetUser ¶
func (b EntitlementBuilder) GetUser() (*UserBuilder, error)
GetUser: Fetch the user data from the user ID assigned to the entitlement
func (EntitlementBuilder) Log ¶
func (b EntitlementBuilder) Log(str string)
func (EntitlementBuilder) LogError ¶
func (b EntitlementBuilder) LogError(str string)
func (EntitlementBuilder) ReadBadgeData ¶
func (b EntitlementBuilder) ReadBadgeData() datastructure.EntitledBadge
ReadBadgeData: Read the data as an Entitled Badge
func (EntitlementBuilder) ReadEmoteSetData ¶
func (b EntitlementBuilder) ReadEmoteSetData() datastructure.EntitledEmoteSet
ReadEmoteSetData: Read the data as an Entitled Emote Set
func (EntitlementBuilder) ReadPaintData ¶
func (b EntitlementBuilder) ReadPaintData() datastructure.EntitledPaint
ReadPaintData: Read the data as an Entitled Paint
func (EntitlementBuilder) ReadRoleData ¶
func (b EntitlementBuilder) ReadRoleData() datastructure.EntitledRole
ReadRoleData: Read the data as an Entitled Role
func (EntitlementBuilder) ReadSubscriptionData ¶
func (b EntitlementBuilder) ReadSubscriptionData() datastructure.EntitledSubscription
ReadSubscriptionData: Read the data as an Entitled Subscription
func (EntitlementBuilder) SetBadgeData ¶
func (b EntitlementBuilder) SetBadgeData(data datastructure.EntitledBadge) EntitlementBuilder
SetBadgeData: Add a badge reference to the entitlement
func (EntitlementBuilder) SetEmoteSetData ¶
func (b EntitlementBuilder) SetEmoteSetData(data datastructure.EntitledEmoteSet) EntitlementBuilder
SetEmoteSetData: Add an emote set reference to the entitlement
func (EntitlementBuilder) SetKind ¶
func (b EntitlementBuilder) SetKind(kind datastructure.EntitlementKind) EntitlementBuilder
SetKind: Change the entitlement's kind
func (EntitlementBuilder) SetPaintData ¶
func (b EntitlementBuilder) SetPaintData(data datastructure.EntitledPaint) EntitlementBuilder
SetPainteData: Add a paint reference to the entitlement
func (EntitlementBuilder) SetRoleData ¶
func (b EntitlementBuilder) SetRoleData(data datastructure.EntitledRole) EntitlementBuilder
SetRoleData: Add a role reference to the entitlement
func (EntitlementBuilder) SetSubscriptionData ¶
func (b EntitlementBuilder) SetSubscriptionData(data datastructure.EntitledSubscription) EntitlementBuilder
SetSubscriptionData: Add a subscription reference to the entitlement
func (EntitlementBuilder) SetUserID ¶
func (b EntitlementBuilder) SetUserID(id primitive.ObjectID) EntitlementBuilder
SetUserID: Change the entitlement's assigned user
func (EntitlementBuilder) Write ¶
func (b EntitlementBuilder) Write() (EntitlementBuilder, error)
Write: Save this Entitlement to persistence
type MergeEmoteOptions ¶
type NotificationBuilder ¶
type NotificationBuilder struct { Notification datastructure.Notification MentionedUsers []primitive.ObjectID MentionedEmotes []primitive.ObjectID MentionedRoles []primitive.ObjectID TargetUsers []primitive.ObjectID }
func (NotificationBuilder) AddEmoteMentionPart ¶
func (b NotificationBuilder) AddEmoteMentionPart(emote primitive.ObjectID) NotificationBuilder
AddEmoteMentionPart: Append a Emote Mention to the notification
func (NotificationBuilder) AddRoleMentionPart ¶
func (b NotificationBuilder) AddRoleMentionPart(role primitive.ObjectID) NotificationBuilder
AddRoleMentionPart: Append a Role Mention to the notification
func (NotificationBuilder) AddTargetUsers ¶
func (b NotificationBuilder) AddTargetUsers(userIDs ...primitive.ObjectID) NotificationBuilder
AddTargetUsers(u): Add one or more users who may read this notification
func (NotificationBuilder) AddTextMessagePart ¶
func (b NotificationBuilder) AddTextMessagePart(text string) NotificationBuilder
AddTextMessagePart: Append a Text part to the notification
func (NotificationBuilder) AddUserMentionPart ¶
func (b NotificationBuilder) AddUserMentionPart(user primitive.ObjectID) NotificationBuilder
AddUserMentionPart: Append a User Mention to the notification
func (NotificationBuilder) GetMentionedEmotes ¶
func (b NotificationBuilder) GetMentionedEmotes(ctx context.Context) (NotificationBuilder, map[primitive.ObjectID]bool)
GetMentionedEmotes: Get the data of mentioned emotes in the notification's message parts
func (NotificationBuilder) GetMentionedUsers ¶
func (b NotificationBuilder) GetMentionedUsers(ctx context.Context) (NotificationBuilder, map[primitive.ObjectID]bool)
GetMentionedUsers: Get the data of mentioned users in the notification's message parts
func (NotificationBuilder) MarkAsAnnouncement ¶
func (b NotificationBuilder) MarkAsAnnouncement() NotificationBuilder
MarkAsAnnouncement: Mark this notification as an announcement, meaning all users will be able to read it regardless of the selected targets
func (NotificationBuilder) SetTitle ¶
func (b NotificationBuilder) SetTitle(title string) NotificationBuilder
SetTitle: Set the Notification's Title
type UserBuilder ¶
type UserBuilder struct { User datastructure.User Entitlements []EntitlementBuilder // contains filtered or unexported fields }
func (UserBuilder) FetchEntitlements ¶
func (b UserBuilder) FetchEntitlements(kind *datastructure.EntitlementKind) ([]EntitlementBuilder, error)
AssignEntitlements: adds entitlements to the user object
func (UserBuilder) GetRole ¶
func (b UserBuilder) GetRole() datastructure.Role
GetRole: Returns the user's current role
func (UserBuilder) IsBanned ¶
func (b UserBuilder) IsBanned() bool