model

package
v0.0.0-...-601de37 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: AGPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRoleManager

func BuildRoleManager(userRoles []UserRole) *role.Manager

Types

type Discriminator

type Discriminator struct {
	Id      int32
	Name    string
	Value   string
	OwnerId UserId
	Owner   *User `pg:"rel:has-one"`
}

type Room

type Room struct {
	Id      RoomId
	Name    string
	OwnerId UserId
	Owner   *User `pg:"rel:has-one"`
	Private bool  `pg:",use_zero"`
}

type RoomId

type RoomId = int32

type RoomMember

type RoomMember struct {
	User
	Roles []*UserRole `pg:"rel:has-many,join_fk:user_id"`
	// contains filtered or unexported fields
}

type User

type User struct {
	Id             UserId
	Username       string
	Avatar         null.String
	Provider       string
	AccessToken    null.String
	RefreshToken   null.String
	ExternalUserID null.String
	Discriminator  null.String `pg:"-"`
	LastModified   time.Time   `pg:"default:now()"`
}

type UserId

type UserId = int32

type UserRole

type UserRole struct {
	Id     UserRoleId
	UserId UserId
	RoomId RoomId
	RoleId role.Id
}

type UserRoleId

type UserRoleId = int32

Jump to

Keyboard shortcuts

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