models

package
v0.0.64 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: GPL-3.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const (
	SectionChildType_Section = cmb.EnumValue(1)
	SectionChildType_Forum   = cmb.EnumValue(2)

	SectionChildTypeMax = SectionChildType_Forum
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddForumParams

type AddForumParams struct {
	cmr.CommonParams

	// Identifier of a section containing this forum.
	SectionId cmb.Id `json:"sectionId"`

	// Name of this forum.
	Name cm.Name `json:"name"`
}

type AddForumResult

type AddForumResult struct {
	cmr.CommonResult

	// ID of the created forum.
	ForumId cmb.Id `json:"forumId"`
}

type AddMessageParams

type AddMessageParams struct {
	cmr.CommonParams

	// ID of a thread containing this message.
	ThreadId cmb.Id `json:"threadId"`

	// Message text.
	Text cmb.Text `json:"text"`
}

type AddMessageResult

type AddMessageResult struct {
	cmr.CommonResult

	// ID of the created message.
	MessageId cmb.Id `json:"messageId"`
}

type AddSectionParams

type AddSectionParams struct {
	cmr.CommonParams

	// Identifier of a parent section containing this section.
	// Null means that this section is a root section.
	// Only a single root section can exist.
	Parent *cmb.Id `json:"parent"`

	// Name of this section.
	Name cm.Name `json:"name"`
}

type AddSectionResult

type AddSectionResult struct {
	cmr.CommonResult

	// ID of the created section.
	SectionId cmb.Id `json:"sectionId"`
}

type AddThreadParams

type AddThreadParams struct {
	cmr.CommonParams

	// ID of a forum containing this thread.
	ForumId cmb.Id `json:"forumId"`

	// Thread name.
	Name cm.Name `json:"name"`
}

type AddThreadResult

type AddThreadResult struct {
	cmr.CommonResult

	// ID of the created forum.
	ThreadId cmb.Id `json:"threadId"`
}

type ChangeForumNameParams

type ChangeForumNameParams struct {
	cmr.CommonParams

	ForumId cmb.Id `json:"forumId"`

	// New name.
	Name cm.Name `json:"name"`
}

type ChangeForumNameResult

type ChangeForumNameResult = cmr.CommonResultWithSuccess

type ChangeForumSectionParams

type ChangeForumSectionParams struct {
	cmr.CommonParams

	// Identifier of this forum.
	ForumId cmb.Id `json:"forumId"`

	// Identifier of a section containing this forum.
	SectionId cmb.Id `json:"sectionId"`
}

type ChangeForumSectionResult

type ChangeForumSectionResult = cmr.CommonResultWithSuccess

type ChangeMessageTextParams

type ChangeMessageTextParams struct {
	cmr.CommonParams

	MessageId cmb.Id `json:"messageId"`

	// New text.
	Text cmb.Text `json:"text"`
}

type ChangeMessageTextResult

type ChangeMessageTextResult = cmr.CommonResultWithSuccess

type ChangeMessageThreadParams

type ChangeMessageThreadParams struct {
	cmr.CommonParams

	MessageId cmb.Id `json:"messageId"`

	// ID of a new parent thread.
	ThreadId cmb.Id `json:"threadId"`
}

type ChangeMessageThreadResult

type ChangeMessageThreadResult = cmr.CommonResultWithSuccess

type ChangeSectionNameParams

type ChangeSectionNameParams struct {
	cmr.CommonParams

	// Identifier of a section.
	SectionId cmb.Id `json:"sectionId"`

	// Name of this section.
	Name cm.Name `json:"name"`
}

type ChangeSectionNameResult

type ChangeSectionNameResult = cmr.CommonResultWithSuccess

type ChangeSectionParentParams

type ChangeSectionParentParams struct {
	cmr.CommonParams

	// Identifier of a section.
	SectionId cmb.Id `json:"sectionId"`

	// Identifier of a parent section containing this section.
	Parent cmb.Id `json:"parent"`
}

type ChangeSectionParentResult

type ChangeSectionParentResult = cmr.CommonResultWithSuccess

type ChangeThreadForumParams

type ChangeThreadForumParams struct {
	cmr.CommonParams

	ThreadId cmb.Id `json:"threadId"`

	// ID of a new parent forum.
	ForumId cmb.Id `json:"forumId"`
}

type ChangeThreadForumResult

type ChangeThreadForumResult = cmr.CommonResultWithSuccess

type ChangeThreadNameParams

type ChangeThreadNameParams struct {
	cmr.CommonParams

	ThreadId cmb.Id `json:"threadId"`

	// New name.
	Name cm.Name `json:"name"`
}

type ChangeThreadNameResult

type ChangeThreadNameResult = cmr.CommonResultWithSuccess

type DeleteForumParams

type DeleteForumParams struct {
	cmr.CommonParams

	ForumId cmb.Id `json:"forumId"`
}

type DeleteForumResult

type DeleteForumResult = cmr.CommonResultWithSuccess

type DeleteMessageParams

type DeleteMessageParams struct {
	cmr.CommonParams

	MessageId cmb.Id `json:"messageId"`
}

type DeleteMessageResult

type DeleteMessageResult = cmr.CommonResultWithSuccess

type DeleteSectionParams

type DeleteSectionParams struct {
	cmr.CommonParams

	SectionId cmb.Id `json:"sectionId"`
}

type DeleteSectionResult

type DeleteSectionResult = cmr.CommonResultWithSuccess

type DeleteThreadParams

type DeleteThreadParams struct {
	cmr.CommonParams

	ThreadId cmb.Id `json:"threadId"`
}

type DeleteThreadResult

type DeleteThreadResult = cmr.CommonResultWithSuccess

type EventData

type EventData struct {
	// Parameters of creation.
	Creator *EventParameters `json:"creator"`

	// Parameters of the last edit.
	Editor *OptionalEventParameters `json:"editor"`
}

type EventParameters

type EventParameters struct {
	// ID of a user who initiated the event.
	UserId cmb.Id `json:"userId"`

	// Time of the event.
	Time time.Time `json:"time"`
}

type Forum

type Forum struct {
	// Identifier of this forum.
	Id cmb.Id `json:"id"`

	// Identifier of a section containing this forum.
	SectionId cmb.Id `json:"sectionId"`

	// Name of this forum.
	Name cm.Name `json:"name"`

	// List of identifiers of threads of this forum.
	Threads *ul.UidList `json:"threads"`

	// Forum meta-data.
	EventData
}

func NewForum

func NewForum() (frm *Forum)

func NewForumArrayFromRows added in v0.0.64

func NewForumArrayFromRows(rows cm.IScannableSequence) (forums []Forum, err error)

func NewForumFromScannableSource

func NewForumFromScannableSource(src cm.IScannable) (forum *Forum, err error)

type ForumAndThreads

type ForumAndThreads struct {
	Forum    *Forum        `json:"forum"`
	Threads  []Thread      `json:"threads"`
	PageData *cmr.PageData `json:"pageData,omitempty"`
}

type GetDKeyParams added in v0.0.45

type GetDKeyParams struct {
	cmr.CommonParams
}

type GetDKeyResult added in v0.0.45

type GetDKeyResult struct {
	cmr.CommonResult

	DKey cmb.Text `json:"dKey"`
}

type GetForumParams

type GetForumParams struct {
	cmr.CommonParams

	ForumId cmb.Id `json:"forumId"`
}

type GetForumResult

type GetForumResult struct {
	cmr.CommonResult

	Forum *Forum `json:"forum"`
}

type GetLatestMessageOfThreadParams added in v0.0.44

type GetLatestMessageOfThreadParams struct {
	cmr.CommonParams

	ThreadId cmb.Id `json:"threadId"`
}

type GetLatestMessageOfThreadResult added in v0.0.44

type GetLatestMessageOfThreadResult struct {
	cmr.CommonResult

	Message *Message `json:"message"`
}

type GetMessageParams

type GetMessageParams struct {
	cmr.CommonParams

	MessageId cmb.Id `json:"messageId"`
}

type GetMessageResult

type GetMessageResult struct {
	cmr.CommonResult

	Message *Message `json:"message"`
}

type GetSectionParams

type GetSectionParams struct {
	cmr.CommonParams

	SectionId cmb.Id `json:"sectionId"`
}

type GetSectionResult

type GetSectionResult struct {
	cmr.CommonResult

	Section *Section `json:"section"`
}

type GetThreadNamesByIdsParams added in v0.0.51

type GetThreadNamesByIdsParams struct {
	cmr.CommonParams

	ThreadIds []cmb.Id `json:"threadIds"`
}

type GetThreadNamesByIdsResult added in v0.0.51

type GetThreadNamesByIdsResult struct {
	cmr.CommonResult

	ThreadIds   []cmb.Id  `json:"threadIds"`
	ThreadNames []cm.Name `json:"threadNames"`
}

type GetThreadParams

type GetThreadParams struct {
	cmr.CommonParams

	ThreadId cmb.Id `json:"threadId"`
}

type GetThreadResult

type GetThreadResult struct {
	cmr.CommonResult

	Thread *Thread `json:"thread"`
}

type ListForumAndThreadsOnPageParams

type ListForumAndThreadsOnPageParams struct {
	cmr.CommonParams

	ForumId cmb.Id    `json:"forumId"`
	Page    cmb.Count `json:"page"`
}

type ListForumAndThreadsOnPageResult

type ListForumAndThreadsOnPageResult struct {
	cmr.CommonResult

	ForumAndThreadsOnPage *ForumAndThreads `json:"fatop"`
}

type ListForumAndThreadsParams

type ListForumAndThreadsParams struct {
	cmr.CommonParams

	ForumId cmb.Id `json:"forumId"`
}

type ListForumAndThreadsResult

type ListForumAndThreadsResult struct {
	cmr.CommonResult

	ForumAndThreads *ForumAndThreads `json:"fat"`
}

type ListSectionsAndForumsParams

type ListSectionsAndForumsParams struct {
	cmr.CommonParams
}

type ListSectionsAndForumsResult

type ListSectionsAndForumsResult struct {
	cmr.CommonResult

	SectionsAndForums *SectionsAndForums `json:"saf"`
}

type ListThreadAndMessagesOnPageParams

type ListThreadAndMessagesOnPageParams struct {
	cmr.CommonParams

	ThreadId cmb.Id    `json:"threadId"`
	Page     cmb.Count `json:"page"`
}

type ListThreadAndMessagesOnPageResult

type ListThreadAndMessagesOnPageResult struct {
	cmr.CommonResult

	ThreadAndMessagesOnPage *ThreadAndMessages `json:"tamop"`
}

type ListThreadAndMessagesParams

type ListThreadAndMessagesParams struct {
	cmr.CommonParams

	ThreadId cmb.Id `json:"threadId"`
}

type ListThreadAndMessagesResult

type ListThreadAndMessagesResult struct {
	cmr.CommonResult

	ThreadAndMessages *ThreadAndMessages `json:"tam"`
}

type Message

type Message struct {
	// Identifier of this message.
	Id cmb.Id `json:"id"`

	// Identifier of a thread containing this message.
	ThreadId cmb.Id `json:"threadId"`

	// Textual information of this message.
	Text cmb.Text `json:"text"`

	// Check sum of the Text field.
	TextChecksum []byte `json:"textChecksum"`

	// Message meta-data.
	EventData
}

func NewMessage

func NewMessage() (msg *Message)

func NewMessageArrayFromRows added in v0.0.64

func NewMessageArrayFromRows(rows cm.IScannableSequence) (msgs []Message, err error)

func NewMessageFromScannableSource

func NewMessageFromScannableSource(src cm.IScannable) (msg *Message, err error)

func (*Message) GetLastTouchTime added in v0.0.44

func (m *Message) GetLastTouchTime() time.Time
type MessageLink struct {
	// Identifier of this message.
	Id cmb.Id `json:"id"`

	// Identifier of a thread containing this message.
	ThreadId cmb.Id `json:"threadId"`
}

MessageLink is a short variant of a message which stores only IDs.

func NewMessageLink() (ml *MessageLink)

func NewMessageLinkArrayFromRows added in v0.0.64

func NewMessageLinkArrayFromRows(rows cm.IScannableSequence) (mls []MessageLink, err error)

func NewMessageLinkFromScannableSource added in v0.0.56

func NewMessageLinkFromScannableSource(src cm.IScannable) (ml *MessageLink, err error)

type MoveForumDownParams added in v0.0.38

type MoveForumDownParams struct {
	cmr.CommonParams

	// Identifier of a forum.
	ForumId cmb.Id `json:"forumId"`
}

type MoveForumDownResult added in v0.0.38

type MoveForumDownResult = cmr.CommonResultWithSuccess

type MoveForumUpParams added in v0.0.38

type MoveForumUpParams struct {
	cmr.CommonParams

	// Identifier of a forum.
	ForumId cmb.Id `json:"forumId"`
}

type MoveForumUpResult added in v0.0.38

type MoveForumUpResult = cmr.CommonResultWithSuccess

type MoveSectionDownParams added in v0.0.38

type MoveSectionDownParams struct {
	cmr.CommonParams

	// Identifier of a section.
	SectionId cmb.Id `json:"sectionId"`
}

type MoveSectionDownResult added in v0.0.38

type MoveSectionDownResult = cmr.CommonResultWithSuccess

type MoveSectionUpParams added in v0.0.38

type MoveSectionUpParams struct {
	cmr.CommonParams

	// Identifier of a section.
	SectionId cmb.Id `json:"sectionId"`
}

type MoveSectionUpResult added in v0.0.38

type MoveSectionUpResult = cmr.CommonResultWithSuccess

type MoveThreadDownParams added in v0.0.38

type MoveThreadDownParams struct {
	cmr.CommonParams

	// Identifier of a thread.
	ThreadId cmb.Id `json:"threadId"`
}

type MoveThreadDownResult added in v0.0.38

type MoveThreadDownResult = cmr.CommonResultWithSuccess

type MoveThreadUpParams added in v0.0.38

type MoveThreadUpParams struct {
	cmr.CommonParams

	// Identifier of a thread.
	ThreadId cmb.Id `json:"threadId"`
}

type MoveThreadUpResult added in v0.0.38

type MoveThreadUpResult = cmr.CommonResultWithSuccess

type OptionalEventParameters

type OptionalEventParameters struct {
	// ID of a user who initiated the event.
	UserId *cmb.Id `json:"userId"`

	// Time of the event.
	Time *time.Time `json:"time"`
}

type PingParams

type PingParams = cmr.PingParams

type PingResult

type PingResult = cmr.PingResult

type Section

type Section struct {
	// Identifier of a section.
	Id cmb.Id `json:"id"`

	// Identifier of a parent section containing this section.
	// Null means that this section is a root section.
	// Only a single root section can exist.
	Parent *cmb.Id `json:"parent"`

	// Type of child elements: either sub-sections or forums.
	ChildType SectionChildType `json:"childType"`

	// List of IDs of child elements (either sub-sections or forums).
	// Null means that this section has no children.
	Children *ul.UidList `json:"children"`

	// Name of this section.
	Name cm.Name `json:"name"`

	// Section meta-data.
	EventData
}

func NewSection

func NewSection() (sec *Section)

func NewSectionArrayFromRows added in v0.0.64

func NewSectionArrayFromRows(rows cm.IScannableSequence) (sections []Section, err error)

func NewSectionFromScannableSource

func NewSectionFromScannableSource(src cm.IScannable) (sec *Section, err error)

type SectionChildType added in v0.0.64

type SectionChildType = cmb.Enum

func NewSectionChildType added in v0.0.64

func NewSectionChildType() *SectionChildType

func NewSectionChildTypeWithValue added in v0.0.64

func NewSectionChildTypeWithValue(value cmb.EnumValue) SectionChildType

type SectionsAndForums

type SectionsAndForums struct {
	Sections []Section `json:"sections"`
	Forums   []Forum   `json:"forums"`
}

type ShowDiagnosticDataParams

type ShowDiagnosticDataParams struct{}

type ShowDiagnosticDataResult

type ShowDiagnosticDataResult struct {
	cmr.CommonResult
	cmr.RequestsCount
}

type TestParams

type TestParams struct {
	N uint `json:"n"`
}

type TestResult

type TestResult struct {
	cmr.CommonResult
}

type Thread

type Thread struct {
	// Identifier of this thread.
	Id cmb.Id `json:"id"`

	// Identifier of a forum containing this thread.
	ForumId cmb.Id `json:"forumId"`

	// Name of this thread.
	Name cm.Name `json:"name"`

	// List of identifiers of messages of this thread.
	Messages *ul.UidList `json:"messages"`

	// Thread meta-data.
	EventData
}

func NewThread

func NewThread() (t *Thread)

func NewThreadArrayFromRows added in v0.0.64

func NewThreadArrayFromRows(rows cm.IScannableSequence) (ts []Thread, err error)

func NewThreadFromScannableSource

func NewThreadFromScannableSource(src cm.IScannable) (t *Thread, err error)

type ThreadAndMessages

type ThreadAndMessages struct {
	Thread   *Thread       `json:"thread"`
	Messages []Message     `json:"messages"`
	PageData *cmr.PageData `json:"pageData"`
}

type ThreadExistsSParams added in v0.0.45

type ThreadExistsSParams struct {
	cmr.CommonParams
	cmr.DKeyParams

	ThreadId cmb.Id `json:"threadId"`
}

type ThreadExistsSResult added in v0.0.45

type ThreadExistsSResult struct {
	cmr.CommonResult

	Exists cmb.Flag `json:"exists"`
}
type ThreadLink struct {
	// Identifier of this thread.
	Id cmb.Id `json:"id"`

	// Identifier of a forum containing this thread.
	ForumId cmb.Id `json:"forumId"`

	// List of identifiers of messages of this thread.
	Messages *ul.UidList `json:"messages"`
}

ThreadLink is a short variant of a thread which stores only IDs.

func NewThreadLink() (tl *ThreadLink)

func NewThreadLinkArrayFromRows added in v0.0.64

func NewThreadLinkArrayFromRows(rows cm.IScannableSequence) (tls []ThreadLink, err error)

func NewThreadLinkFromScannableSource added in v0.0.56

func NewThreadLinkFromScannableSource(src cm.IScannable) (tl *ThreadLink, err error)

Jump to

Keyboard shortcuts

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