Documentation
¶
Overview ¶
Package models provides domain entities.
Package models provides domain entities.
Index ¶
- Constants
- type Audit
- type Clone
- type IncomingMessage
- type Message
- func (m *Message) AppendText(text string)
- func (m *Message) IsPublished() bool
- func (m *Message) SetMessageType(messageType int)
- func (m *Message) SetNotifyAt(notificationTimeout time.Duration) error
- func (m *Message) SetStatus(status MessageStatus)
- func (m *Message) SetText(text string)
- func (m *Message) SetUserID(userID string)
- type MessageStatus
- type UserInfo
Constants ¶
const ( MessageTypeDefault = iota MessageTypeThread MessageTypeEphemeral )
Message types of published messages.
const ( StatusRunning = "running" StatusError = "error" StatusOK = "ok" )
Message status.
const ChatAppendSeparator = "\n\n"
ChatAppendSeparator separates appended part of a message.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audit ¶
type Audit struct { ID string `json:"id"` Name string `json:"name"` RealName string `json:"realName"` Command string `json:"command"` Query string `json:"query"` }
Audit represents audit log actions.
type Clone ¶
type Clone struct { Name string Host string Port string Username string Password string SSLMode string }
Clone contains connection info of a clone.
func (Clone) ConnectionString ¶
type IncomingMessage ¶
type IncomingMessage struct { SubType string Text string SnippetURL string ChannelID string ChannelType string UserID string Timestamp string ThreadID string CommandID string SessionID string Direct bool }
IncomingMessage defines a standard representation of incoming events.
type Message ¶
type Message struct { MessageID string CommandID string SessionID string MessageType int Status MessageStatus ChannelID string ThreadID string UserID string Text string CreatedAt time.Time NotifyAt time.Time }
Message struct defines an output message.
func NewMessage ¶
func NewMessage(incomingMessage IncomingMessage) *Message
NewMessage creates a new message.
func (*Message) AppendText ¶
AppendText appends a new string to the current text throw a chat append separator.
func (*Message) IsPublished ¶
IsPublished checks if the message is already published.
func (*Message) SetMessageType ¶
SetMessageType sets a message type.
func (*Message) SetNotifyAt ¶
SetNotifyAt sets timestamp to notify a user about the finish of a long query.
func (*Message) SetStatus ¶
func (m *Message) SetStatus(status MessageStatus)
SetStatus sets message status.