mutations

package
v0.0.0-...-367ce81 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const EMOTE_CLAIMANTS_MOST = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateBanOptions

type CreateBanOptions struct {
	Actor          *structures.User
	AnonymousActor bool
	Victim         *structures.User
}

type EditBanOptions

type EditBanOptions struct {
	Actor *structures.User
}

type EmoteEditOptions

type EmoteEditOptions struct {
	Actor          *structures.User
	SkipValidation bool
}

type EmoteSetMutationOptions

type EmoteSetMutationOptions struct {
	Actor          *structures.User
	SkipValidation bool
}

type EmoteSetMutationSetEmoteItem

type EmoteSetMutationSetEmoteItem struct {
	Action structures.ListItemAction
	ID     primitive.ObjectID
	Name   string
	Flags  structures.ActiveEmoteFlag
	// contains filtered or unexported fields
}

type EmoteSetMutationSetEmoteOptions

type EmoteSetMutationSetEmoteOptions struct {
	Actor    *structures.User
	Emotes   []EmoteSetMutationSetEmoteItem
	Channels []primitive.ObjectID
}

type MessageReadStateOptions

type MessageReadStateOptions struct {
	Actor               *structures.User
	Filter              bson.M
	SkipPermissionCheck bool
}

type MessageReadStateResponse

type MessageReadStateResponse struct {
	Updated int64   `json:"changed"`
	Errors  []error `json:"errors"`
}

type Mutate

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

func New

func New(mongoInst mongo.Instance, redisInst redis.Instance) *Mutate

func (*Mutate) CreateBan

func (m *Mutate) CreateBan(ctx context.Context, bb *structures.BanBuilder, opt CreateBanOptions) error

func (*Mutate) CreateEmoteSet

func (m *Mutate) CreateEmoteSet(ctx context.Context, esb *structures.EmoteSetBuilder, opt EmoteSetMutationOptions) error

Create: create the new emote set

func (*Mutate) CreateRole

func (m *Mutate) CreateRole(ctx context.Context, rb *structures.RoleBuilder, opt RoleMutationOptions) error

Create: create the new role

func (*Mutate) DeleteRole

func (m *Mutate) DeleteRole(ctx context.Context, rb *structures.RoleBuilder, opt RoleMutationOptions) error

Delete: delete the role

func (*Mutate) EditBan

func (m *Mutate) EditBan(ctx context.Context, bb *structures.BanBuilder, opt EditBanOptions) error

func (*Mutate) EditEmote

func (m *Mutate) EditEmote(ctx context.Context, eb *structures.EmoteBuilder, opt EmoteEditOptions) error

Edit: edit the emote. Modify the EmoteBuilder beforehand!

To account for editor permissions, the "editor_of" relation should be included in the actor's data

func (*Mutate) EditEmoteSet

func (m *Mutate) EditEmoteSet(ctx context.Context, esb *structures.EmoteSetBuilder, opt EmoteSetMutationOptions) error

Edit: change the emote set

func (*Mutate) EditEmotesInSet

func (m *Mutate) EditEmotesInSet(ctx context.Context, esb *structures.EmoteSetBuilder, opt EmoteSetMutationSetEmoteOptions) error

SetEmote: enable, edit or disable active emotes in the set

func (*Mutate) EditRole

func (m *Mutate) EditRole(ctx context.Context, rb *structures.RoleBuilder, opt RoleEditOptions) error

Edit: edit the role. Modify the RoleBuilder beforehand!

func (*Mutate) ModifyUserEditors

func (m *Mutate) ModifyUserEditors(ctx context.Context, ub *structures.UserBuilder, opt UserEditorsOptions) error

func (*Mutate) SendInboxMessage

func (m *Mutate) SendInboxMessage(ctx context.Context, mb *structures.MessageBuilder[structures.MessageDataInbox], opt SendInboxMessageOptions) error

func (*Mutate) SendModRequestMessage

func (m *Mutate) SendModRequestMessage(ctx context.Context, mb *structures.MessageBuilder[structures.MessageDataModRequest]) error

func (*Mutate) SetMessageReadStates

func (m *Mutate) SetMessageReadStates(ctx context.Context, mb *structures.MessageBuilder[bson.Raw], read bool, opt MessageReadStateOptions) (*MessageReadStateResponse, error)

func (*Mutate) SetRole

func (m *Mutate) SetRole(ctx context.Context, ub *structures.UserBuilder, opt SetUserRoleOptions) error

SetRole: add or remove a role for the user

func (*Mutate) SetUserConnectionActiveEmoteSet

func (m *Mutate) SetUserConnectionActiveEmoteSet(ctx context.Context, ub *structures.UserBuilder, opt SetUserActiveEmoteSet) error

type RoleEditOptions

type RoleEditOptions struct {
	Actor            *structures.User
	OriginalPosition int32
}

type RoleMutationOptions

type RoleMutationOptions struct {
	Actor *structures.User
}

type SendInboxMessageOptions

type SendInboxMessageOptions struct {
	Actor                *structures.User
	Recipients           []primitive.ObjectID
	ConsiderBlockedUsers bool
}

type SetUserActiveEmoteSet

type SetUserActiveEmoteSet struct {
	EmoteSetID   primitive.ObjectID
	Platform     structures.UserConnectionPlatform
	Actor        *structures.User
	ConnectionID string
}

type SetUserRoleOptions

type SetUserRoleOptions struct {
	Role   *structures.Role
	Actor  *structures.User
	Action structures.ListItemAction
}

type UserEditorsOptions

type UserEditorsOptions struct {
	Actor             *structures.User
	Editor            *structures.User
	EditorPermissions structures.UserEditorPermission
	EditorVisible     bool
	Action            structures.ListItemAction
}

Jump to

Keyboard shortcuts

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