graph

package
v0.0.0-...-6443788 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CHATS_COLLECTION       = "CC_Chats"
	MESSAGES_COLLECTION    = "CC_Messages"
	ATTACHMENTS_COLLECTION = "CC_Attachments"
)

Variables

This section is empty.

Functions

func ConnectDb

func ConnectDb(logger *zap.Logger, host, cred, dbName string) driver.Database

func GetEnsureCollection

func GetEnsureCollection(log *zap.Logger, ctx context.Context, db driver.Database, name string) driver.Collection

func GraphGetEdgeEnsure

func GraphGetEdgeEnsure(logger *zap.Logger, ctx context.Context, graph driver.Graph, name, from, to string) driver.Collection

func GraphGetEnsure

func GraphGetEnsure(logger *zap.Logger, ctx context.Context, db driver.Database, name string) driver.Graph

func GraphGetVertexEnsure

func GraphGetVertexEnsure(logger *zap.Logger, ctx context.Context, db driver.Database, graph driver.Graph, name string) (col driver.Collection)

Types

type Attachment

type Attachment struct {
	Uuid     string `json:"uuid"`
	Title    string `json:"title"`
	Chat     string `json:"chat"`
	ObjectId string `json:"object_id"`
	Ext      string `json:"ext"`
}

type AttachmentsController

type AttachmentsController struct {
	// contains filtered or unexported fields
}

func NewAttachmentsController

func NewAttachmentsController(logger *zap.Logger, db driver.Database) *AttachmentsController

func (*AttachmentsController) Delete

func (c *AttachmentsController) Delete(ctx context.Context, uuid string) error

func (*AttachmentsController) Get

func (*AttachmentsController) Upload

type ChatsController

type ChatsController struct {
	// contains filtered or unexported fields
}

func NewChatsController

func NewChatsController(logger *zap.Logger, db driver.Database) *ChatsController

func (*ChatsController) Create

func (c *ChatsController) Create(ctx context.Context, chat *cc.Chat) (*cc.Chat, error)

func (*ChatsController) Delete

func (c *ChatsController) Delete(ctx context.Context, chat *cc.Chat) (*cc.Chat, error)

func (*ChatsController) DeleteGateways

func (c *ChatsController) DeleteGateways(ctx context.Context, fields map[string]*structpb.Value) error

func (*ChatsController) Get

func (c *ChatsController) Get(ctx context.Context, uuid, requestor string) (*cc.Chat, error)

func (*ChatsController) GetByGateway

func (c *ChatsController) GetByGateway(ctx context.Context, gate string, gateId *structpb.Value) (*cc.Chat, error)

func (*ChatsController) GetMessages

func (c *ChatsController) GetMessages(ctx context.Context, chat *cc.Chat, is_admin bool) ([]*cc.Message, error)

func (*ChatsController) List

func (c *ChatsController) List(ctx context.Context, requestor string) ([]*cc.Chat, error)

func (*ChatsController) SetBotState

func (c *ChatsController) SetBotState(ctx context.Context, chat *cc.Chat) (*cc.Chat, error)

func (*ChatsController) Update

func (c *ChatsController) Update(ctx context.Context, chat *cc.Chat) (*cc.Chat, error)

type MessagesController

type MessagesController struct {
	// contains filtered or unexported fields
}

func NewMessagesController

func NewMessagesController(logger *zap.Logger, db driver.Database) *MessagesController

func (*MessagesController) Delete

func (c *MessagesController) Delete(ctx context.Context, msg *cc.Message) (*cc.Message, error)

func (*MessagesController) Get

func (c *MessagesController) Get(ctx context.Context, uuid string) (*cc.Message, error)

func (*MessagesController) Read

func (c *MessagesController) Read(ctx context.Context, msg *cc.Message, reader string) (*cc.Message, error)

func (*MessagesController) Send

func (c *MessagesController) Send(ctx context.Context, msg *cc.Message) (*cc.Message, error)

func (*MessagesController) Update

func (c *MessagesController) Update(ctx context.Context, msg *cc.Message) (*cc.Message, error)

type UsersController

type UsersController struct {
	// contains filtered or unexported fields
}

func NewUsersController

func NewUsersController(logger *zap.Logger, db driver.Database, colname string) *UsersController

func (*UsersController) GetMembers

func (c *UsersController) GetMembers(ctx context.Context) ([]*cc.User, error)

func (*UsersController) Resolve

func (c *UsersController) Resolve(ctx context.Context, uuids []string) ([]*cc.User, error)

func (*UsersController) UpdateCommands

func (c *UsersController) UpdateCommands(ctx context.Context, uuid string, commands map[string]string) error

Jump to

Keyboard shortcuts

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