entity

package
v0.0.0-...-6883eea Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID        string `gorm:"primaryKey; type:varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type Group

type Group struct {
	Base

	// Name is the name of the group
	Name string `gorm:"type:varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL;uniqueIndex:room_group_name_uidx"`

	// Flags is a comma-separated list of flags, with both leading and trailing comma. The allowed flags are configuration dependent
	Flags string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"`

	// Comments are optional, not processed in any way
	Comments string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" testdiff:"ignore"`

	// MaximumSize defaults to a value from service configuration, but we store it here so admins can increase it manually for some groups
	MaximumSize uint

	// Owner is the badge number (attendee ID) of the attendee owning the group. Ownership can be passed to another attendee.
	Owner uint
}

Group is a group of attendees that wish to be assigned to a Room together.

type GroupMember

type GroupMember struct {
	Member

	// GroupID references the group to which the member belongs (or has been invited)
	GroupID string `gorm:"type:varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL;index:room_group_member_grpid"`

	// IsInvite is true if the member has been invited, or false if the member has already joined
	IsInvite bool
}

GroupMember associates attendees to a group, either as a member or as an invited member.

type History

type History struct {
	gorm.Model
	Entity    string `gorm:"type:varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL;index:att_histories_entity_idx"`    // the name (type) of the entity
	EntityId  string `gorm:"type:varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL;index:att_histories_entity_idx"`    // the pk of the entity
	Operation string `gorm:"type:varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL"`                                   // update / delete / undelete
	RequestId string `gorm:"type:varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"`                                             // optional request id that triggered the change
	Identity  string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL;index:att_histories_identity_idx"` // the subject that triggered the change
	Diff      string `gorm:"type:text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"`
}

type Member

type Member struct {
	// ID contains the badge number of the attendee (an attendee can only either be in a
	// group or invited, and can only ever be in one room at the same time).
	ID        uint `gorm:"primaryKey"`
	CreatedAt time.Time
	UpdatedAt time.Time

	// Nickname caches the nickname of the attendee
	Nickname string `gorm:"type:varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL"`

	// AvatarURL caches the url to obtain the avatar for this attendee, points to an image such as a png or jpg
	AvatarURL string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"`

	// Flags is a comma-separated list of flags such as "has_key", with a leading and trailing comma
	Flags string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"`
}

type Room

type Room struct {
	Base

	// Name is the name of the room
	Name string `gorm:"type:varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL;uniqueIndex:room_room_name_uidx"`

	// Flags is a comma-separated list of flags, with both leading and trailing comma. The allowed flags are configuration dependent
	Flags string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"`

	// Comments are optional, not processed in any way
	Comments string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" testdiff:"ignore"`

	// Size is the size of the room
	Size uint
}

type RoomMember

type RoomMember struct {
	Member

	// RoomID references the room to which the attendee belongs
	RoomID string `gorm:"type:varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL;index:room_room_member_roomid"`
}

Jump to

Keyboard shortcuts

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