models

package
v0.0.66 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: GPL-3.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

View Source
const (
	IdForVirtualUserSubscriptionsRecord = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Subscription

type Subscription struct {
	// ID of a thread to which a user is subscribed.
	ThreadId cmb.Id `json:"threadId"`

	// ID of a subscribed user.
	UserId cmb.Id `json:"userId"`
}

type ThreadSubscriptionsRecord added in v0.0.54

type ThreadSubscriptionsRecord struct {
	Id       cmb.Id      `json:"id"`
	ThreadId cmb.Id      `json:"threadId"`
	Users    *ul.UidList `json:"userIds"`
}

func NewThreadSubscriptionsRecord added in v0.0.55

func NewThreadSubscriptionsRecord() (tsr *ThreadSubscriptionsRecord)

func NewThreadSubscriptionsRecordArrayFromRows added in v0.0.64

func NewThreadSubscriptionsRecordArrayFromRows(rows base.IScannableSequence) (tsrs []ThreadSubscriptionsRecord, err error)

func NewThreadSubscriptionsRecordFromScannableSource added in v0.0.55

func NewThreadSubscriptionsRecordFromScannableSource(src base.IScannable) (tsr *ThreadSubscriptionsRecord, err error)

type UserSubscriptions

type UserSubscriptions struct {

	// Subscriber is an ID of a user. This is equivalent to UserId.
	Subscriber base2.Id `json:"subscriber"`

	// Subscriptions is an array of IDs of threads to which a user is
	// subscribed. This is equivalent to ThreadIds.
	Subscriptions []base2.Id `json:"subscriptions"`

	PageData *cmr.PageData `json:"pageData,omitempty"`
}

func NewUserSubscriptions

func NewUserSubscriptions(userId base2.Id, allThreadIds *ul.UidList, pageNumber base2.Count, pageSize base2.Count) (us *UserSubscriptions)

NewUserSubscriptions is a constructor of UserSubscriptions. When pagination is not needed, pag number must be zero. When page number is positive, pagination is enabled.

type UserSubscriptionsRecord added in v0.0.54

type UserSubscriptionsRecord struct {
	Id      cmb.Id      `json:"id"`
	UserId  cmb.Id      `json:"userId"`
	Threads *ul.UidList `json:"threadIds"`
}

func NewUserSubscriptionsRecord added in v0.0.54

func NewUserSubscriptionsRecord() (usr *UserSubscriptionsRecord)

func NewUserSubscriptionsRecordArrayFromRows added in v0.0.64

func NewUserSubscriptionsRecordArrayFromRows(rows base.IScannableSequence) (usrs []UserSubscriptionsRecord, err error)

func NewUserSubscriptionsRecordFromScannableSource added in v0.0.54

func NewUserSubscriptionsRecordFromScannableSource(src base.IScannable) (usr *UserSubscriptionsRecord, err error)

Jump to

Keyboard shortcuts

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