model

package
v0.0.0-...-d04cd99 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapMessagesToProto

func MapMessagesToProto(mapper func(*Message) *api.Message, msgs []*Message) []*api.Message

func MessageToProto

func MessageToProto(msg *Message) *api.Message

Types

type DeleteMessageParams

type DeleteMessageParams struct {
	ID     int32
	UserID int32
	FileID int32
}

type DeleteMessageResult

type DeleteMessageResult struct {
}

type DeleteMessageServerResponse

type DeleteMessageServerResponse struct {
	model.ServerResponse
	ID int32 `json:"id"`
}

type Message

type Message struct {
	ID            int32            `json:"id"`
	CreateUTCNano int64            `json:"create_utc_nano,omitempty"`
	UpdateUTCNano int64            `json:"update_utc_nano,omitempty"`
	UserID        int32            `json:"user_id,omitempty"`
	File          *filesmodel.File `json:"file,omitempty"`
	Text          string           `json:"text,omitempty"`
}

func MapMessagesFromProto

func MapMessagesFromProto(mapper func(*api.Message) *Message, msgs []*api.Message) []*Message

func MessageFromProto

func MessageFromProto(proto *api.Message) *Message

type MessagesList

type MessagesList struct {
	Messages   []*Message `json:"messages"`
	IsLastPage bool       `json:"is_last_page"`
}

type MessagesListServerResponse

type MessagesListServerResponse struct {
	model.ServerResponse
	Messages   []*Message `json:"messages"`
	IsLastPage bool       `json:"is_last_page"`
}

type NewMessageServerResponse

type NewMessageServerResponse struct {
	model.ServerResponse
	Message Message `json:"message"`
}

type ReadBatchFilesParams

type ReadBatchFilesParams struct {
	UserID int32
	IDs    []int32
}

type ReadBatchFilesResult

type ReadBatchFilesResult struct {
	Files map[int32](*filesmodel.File)
}

type ReadUserMessagesParams

type ReadUserMessagesParams struct {
	UserID    int32
	Limit     int32
	Offset    int32
	Ascending bool
}

type ReadUserMessagesResult

type ReadUserMessagesResult struct {
	Messages   []*Message
	IsLastPage bool
}

type SaveFileParams

type SaveFileParams struct {
	Name   string
	UserID int32
}

type SaveFileResult

type SaveFileResult struct {
	ID            int32
	CreateUTCNano int64
}

type SaveMessageParams

type SaveMessageParams struct {
	Message *Message
}

type SaveMessageResult

type SaveMessageResult struct {
	ID            int32
	CreateUTCNano int64
	UpdateUTCNano int64
}

type UpdateMessageParams

type UpdateMessageParams struct {
	ID            int32
	UserID        int32
	FileID        int32
	Text          string
	UpdateUTCNano int64
}

type UpdateMessageResult

type UpdateMessageResult struct {
	ID            int32
	UpdateUTCNano int64
}

type UpdateMessageServerResponse

type UpdateMessageServerResponse struct {
	model.ServerResponse
	ID            int32 `json:"id"`
	UpdateUTCNano int64 `json:"update_utc_nano"`
}

Jump to

Keyboard shortcuts

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