Documentation
¶
Index ¶
- Constants
- type ChatInterface
- type ChatQueryInterface
- type Message
- func (o *Message) ChatID() string
- func (o *Message) CreatedAt() string
- func (o *Message) CreatedAtCarbon() *carbon.Carbon
- func (o *Message) IsSoftDeleted() bool
- func (o *Message) Memo() string
- func (o *Message) Meta(key string) (string, error)
- func (o *Message) Metas() (map[string]string, error)
- func (o *Message) RecipientID() string
- func (o *Message) SenderID() string
- func (o *Message) SetChatID(id string) MessageInterface
- func (o *Message) SetCreatedAt(createdAt string) MessageInterface
- func (o *Message) SetMemo(memo string) MessageInterface
- func (o *Message) SetMeta(key string, value string) error
- func (o *Message) SetMetas(metas map[string]string) error
- func (o *Message) SetRecipientID(id string) MessageInterface
- func (o *Message) SetSenderID(id string) MessageInterface
- func (o *Message) SetSoftDeletedAt(softDeletedAt string) MessageInterface
- func (o *Message) SetStatus(status string) MessageInterface
- func (o *Message) SetText(text string) MessageInterface
- func (o *Message) SetUpdatedAt(updatedAt string) MessageInterface
- func (o *Message) SoftDeletedAt() string
- func (o *Message) SoftDeletedAtCarbon() *carbon.Carbon
- func (o *Message) Status() string
- func (o *Message) Text() string
- func (o *Message) UpdatedAt() string
- func (o *Message) UpdatedAtCarbon() *carbon.Carbon
- func (o *Message) UpsertMetas(metas map[string]string) error
- type MessageInterface
- type MessageQueryInterface
- type NewStoreOptions
- type StoreInterface
Constants ¶
View Source
const CHAT_MESSAGE_STATUS_ACTIVE = "active"
View Source
const CHAT_MESSAGE_STATUS_DELETED = "deleted"
View Source
const CHAT_MESSAGE_STATUS_INACTIVE = "inactive"
View Source
const CHAT_STATUS_ACTIVE = "active"
View Source
const CHAT_STATUS_DELETED = "deleted"
View Source
const CHAT_STATUS_INACTIVE = "inactive"
View Source
const CHAT_SYSTEM_ID = "00000000000000000000000000000001"
View Source
const COLUMN_CHAT_ID = "chat_id"
View Source
const COLUMN_CREATED_AT = "created_at"
View Source
const COLUMN_ID = "id"
View Source
const COLUMN_MEMO = "memo"
View Source
const COLUMN_METAS = "metas"
View Source
const COLUMN_OWNER_ID = "owner_id"
View Source
const COLUMN_RECIPIENT_ID = "recipient_id"
View Source
const COLUMN_SENDER_ID = "sender_id"
View Source
const COLUMN_SOFT_DELETED_AT = "soft_deleted_at"
View Source
const COLUMN_STATUS = "status"
View Source
const COLUMN_TEXT = "text"
View Source
const COLUMN_TITLE = "title"
View Source
const COLUMN_UPDATED_AT = "updated_at"
View Source
const MESSAGE_STATUS_ACTIVE = "active"
View Source
const MESSAGE_STATUS_DELETED = "deleted"
View Source
const MESSAGE_STATUS_INACTIVE = "inactive"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatInterface ¶
type ChatInterface interface {
Data() map[string]string
DataChanged() map[string]string
MarkAsNotDirty()
IsSoftDeleted() bool
ID() string
SetID(id string) ChatInterface
OwnerID() string
SetOwnerID(id string) ChatInterface
Status() string
SetStatus(status string) ChatInterface
Title() string
SetTitle(title string) ChatInterface
Memo() string
SetMemo(memo string) ChatInterface
Meta(key string) (string, error)
SetMeta(key string, value string) error
Metas() (map[string]string, error)
SetMetas(metas map[string]string) error
UpsertMetas(metas map[string]string) error
CreatedAt() string
CreatedAtCarbon() *carbon.Carbon
SetCreatedAt(createdAt string) ChatInterface
SoftDeletedAt() string
SoftDeletedAtCarbon() *carbon.Carbon
SetSoftDeletedAt(softDeletedAt string) ChatInterface
UpdatedAt() string
UpdatedAtCarbon() *carbon.Carbon
SetUpdatedAt(updatedAt string) ChatInterface
}
func NewChat ¶
func NewChat() ChatInterface
func NewChatFromExistingData ¶
func NewChatFromExistingData(data map[string]string) ChatInterface
type ChatQueryInterface ¶
type ChatQueryInterface interface {
// Validation method
Validate() error
// Count related methods
IsCountOnlySet() bool
GetCountOnly() bool
SetCountOnly(countOnly bool) ChatQueryInterface
// Soft delete related query methods
IsWithSoftDeletedSet() bool
GetWithSoftDeleted() bool
SetWithSoftDeleted(withSoftDeleted bool) ChatQueryInterface
IsOnlySoftDeletedSet() bool
GetOnlySoftDeleted() bool
SetOnlySoftDeleted(onlySoftDeleted bool) ChatQueryInterface
// Dataset conversion methods
ToSelectDataset(store *store) (selectDataset *goqu.SelectDataset, columns []any, err error)
IsOwnerIDSet() bool
GetOwnerID() string
SetOwnerID(ownerID string) ChatQueryInterface
IsCreatedAtGteSet() bool
GetCreatedAtGte() string
SetCreatedAtGte(createdAt string) ChatQueryInterface
IsCreatedAtLteSet() bool
GetCreatedAtLte() string
SetCreatedAtLte(createdAt string) ChatQueryInterface
IsIDSet() bool
GetID() string
SetID(id string) ChatQueryInterface
IsIDInSet() bool
GetIDIn() []string
SetIDIn(ids []string) ChatQueryInterface
IsLimitSet() bool
GetLimit() int
SetLimit(limit int) ChatQueryInterface
IsOffsetSet() bool
GetOffset() int
SetOffset(offset int) ChatQueryInterface
IsOrderBySet() bool
GetOrderBy() string
SetOrderBy(orderBy string) ChatQueryInterface
IsOrderDirectionSet() bool
GetOrderDirection() string
SetOrderDirection(orderDirection string) ChatQueryInterface
IsStatusSet() bool
GetStatus() string
SetStatus(status string) ChatQueryInterface
SetStatusIn(statuses []string) ChatQueryInterface
IsUpdatedAtGteSet() bool
GetUpdatedAtGte() string
SetUpdatedAtGte(updatedAt string) ChatQueryInterface
IsUpdatedAtLteSet() bool
GetUpdatedAtLte() string
SetUpdatedAtLte(updatedAt string) ChatQueryInterface
}
ChatQueryInterface defines the interface for querying chats
type Message ¶
type Message struct {
dataobject.DataObject
}
func (*Message) CreatedAtCarbon ¶
func (*Message) IsSoftDeleted ¶
IsSoftDeleted checks if the message is soft deleted
func (*Message) RecipientID ¶
func (*Message) SetChatID ¶
func (o *Message) SetChatID(id string) MessageInterface
func (*Message) SetCreatedAt ¶
func (o *Message) SetCreatedAt(createdAt string) MessageInterface
func (*Message) SetMemo ¶
func (o *Message) SetMemo(memo string) MessageInterface
func (*Message) SetRecipientID ¶
func (o *Message) SetRecipientID(id string) MessageInterface
func (*Message) SetSenderID ¶
func (o *Message) SetSenderID(id string) MessageInterface
func (*Message) SetSoftDeletedAt ¶
func (o *Message) SetSoftDeletedAt(softDeletedAt string) MessageInterface
func (*Message) SetStatus ¶
func (o *Message) SetStatus(status string) MessageInterface
func (*Message) SetText ¶
func (o *Message) SetText(text string) MessageInterface
func (*Message) SetUpdatedAt ¶
func (o *Message) SetUpdatedAt(updatedAt string) MessageInterface
func (*Message) SoftDeletedAt ¶
func (*Message) SoftDeletedAtCarbon ¶
func (*Message) UpdatedAtCarbon ¶
type MessageInterface ¶
type MessageInterface interface {
dataobject.DataObjectInterface
IsSoftDeleted() bool
ChatID() string
SetChatID(chatID string) MessageInterface
SenderID() string
SetSenderID(id string) MessageInterface
RecipientID() string
SetRecipientID(id string) MessageInterface
Status() string
SetStatus(status string) MessageInterface
Memo() string
SetMemo(memo string) MessageInterface
Meta(key string) (string, error)
SetMeta(key string, value string) error
Metas() (map[string]string, error)
SetMetas(metas map[string]string) error
UpsertMetas(metas map[string]string) error
Text() string
SetText(text string) MessageInterface
CreatedAt() string
CreatedAtCarbon() *carbon.Carbon
SetCreatedAt(createdAt string) MessageInterface
SoftDeletedAt() string
SoftDeletedAtCarbon() *carbon.Carbon
SetSoftDeletedAt(softDeletedAt string) MessageInterface
UpdatedAt() string
UpdatedAtCarbon() *carbon.Carbon
SetUpdatedAt(updatedAt string) MessageInterface
}
func NewMessage ¶
func NewMessage() MessageInterface
func NewMessageFromExistingData ¶
func NewMessageFromExistingData(data map[string]string) MessageInterface
type MessageQueryInterface ¶
type MessageQueryInterface interface {
// Validation method
Validate() error
// Basic query methods
IsCreatedAtGteSet() bool
GetCreatedAtGte() string
SetCreatedAtGte(createdAt string) MessageQueryInterface
IsCreatedAtLteSet() bool
GetCreatedAtLte() string
SetCreatedAtLte(createdAt string) MessageQueryInterface
IsIDSet() bool
GetID() string
SetID(id string) MessageQueryInterface
IsIDInSet() bool
GetIDIn() []string
SetIDIn(ids []string) MessageQueryInterface
IsIDNotInSet() bool
GetIDNotIn() []string
SetIDNotIn(ids []string) MessageQueryInterface
IsLimitSet() bool
GetLimit() int
SetLimit(limit int) MessageQueryInterface
IsChatIDSet() bool
GetChatID() string
SetChatID(chatID string) MessageQueryInterface
IsChatIDInSet() bool
GetChatIDIn() []string
SetChatIDIn(chatIDs []string) MessageQueryInterface
IsOffsetSet() bool
GetOffset() int
SetOffset(offset int) MessageQueryInterface
IsOrderBySet() bool
GetOrderBy() string
SetOrderBy(orderBy string) MessageQueryInterface
IsOrderDirectionSet() bool
GetOrderDirection() string
SetOrderDirection(orderDirection string) MessageQueryInterface
IsRecipientIDSet() bool
GetRecipientID() string
SetRecipientID(recipientID string) MessageQueryInterface
IsSenderIDSet() bool
GetSenderID() string
SetSenderID(senderID string) MessageQueryInterface
IsStatusSet() bool
GetStatus() string
SetStatus(status string) MessageQueryInterface
SetStatusIn(statuses []string) MessageQueryInterface
// Count related methods
IsCountOnlySet() bool
GetCountOnly() bool
SetCountOnly(countOnly bool) MessageQueryInterface
// Soft delete related query methods
IsWithSoftDeletedSet() bool
GetWithSoftDeleted() bool
SetWithSoftDeleted(withSoftDeleted bool) MessageQueryInterface
IsOnlySoftDeletedSet() bool
GetOnlySoftDeleted() bool
SetOnlySoftDeleted(onlySoftDeleted bool) MessageQueryInterface
ToSelectDataset(store *store) (selectDataset *goqu.SelectDataset, columns []any, err error)
}
MessageQueryInterface defines the interface for querying messages
func MessageQuery ¶
func MessageQuery() MessageQueryInterface
MessageQuery creates a new message query
type NewStoreOptions ¶
type NewStoreOptions struct {
TableChatName string
TableMessageName string
DB *sql.DB
DbDriverName string
AutomigrateEnabled bool
DebugEnabled bool
Logger *slog.Logger
}
NewStoreOptions define the options for creating a new block store
type StoreInterface ¶
type StoreInterface interface {
AutoMigrate() error
EnableDebug(enabled bool)
ChatCount(options ChatQueryInterface) (int64, error)
ChatCreate(chat ChatInterface) error
ChatDelete(chat ChatInterface) error
ChatDeleteByID(id string) error
ChatFindByID(id string) (ChatInterface, error)
ChatList(options ChatQueryInterface) ([]ChatInterface, error)
ChatSoftDelete(chat ChatInterface) error
ChatSoftDeleteByID(id string) error
ChatUpdate(chat ChatInterface) error
MessageCount(options MessageQueryInterface) (int64, error)
MessageCreate(message MessageInterface) error
MessageDelete(message MessageInterface) error
MessageDeleteByID(id string) error
MessageFindByID(id string) (MessageInterface, error)
MessageList(options MessageQueryInterface) ([]MessageInterface, error)
MessageSoftDelete(message MessageInterface) error
MessageSoftDeleteByID(id string) error
MessageUpdate(message MessageInterface) error
}
func NewStore ¶
func NewStore(opts NewStoreOptions) (StoreInterface, error)
NewStore creates a new block store
Click to show internal directories.
Click to hide internal directories.