Documentation ¶
Index ¶
- type Db
- func (db *Db) AddCommand(botId int64, m *model.Command) (int64, error)
- func (db *Db) AddCommandTx(ctx context.Context, tx pgx.Tx, botId int64, m *model.Command) (int64, error)
- func (db *Db) AddComponent(botId int64, groupId int64, m *model.Component) (int64, error)
- func (db *Db) AddConnection(botId int64, groupId int64, m *model.Connection) error
- func (db *Db) AddUser(botId int64, m *model.User) (int64, error)
- func (db *Db) BeginTx(ctx context.Context) (pgx.Tx, error)
- func (db *Db) CheckBotExist(userId int64, botId int64) (bool, error)
- func (db *Db) CheckBotTokenExist(token *string) (bool, error)
- func (db *Db) CheckCommandExist(botId int64, compId int64, commandId int64) (bool, error)
- func (db *Db) CheckComponentExist(botId int64, groupId int64, compId int64) (bool, error)
- func (db *Db) CheckGroupExist(botId int64, groupId int64) (bool, error)
- func (db *Db) CheckUserExistByTgId(botId int64, tgId int64) (bool, error)
- func (db *Db) CloseConnection()
- func (db *Db) CreateBot(m *model.Bot, mc *model.Component) (botId int64, componentId int64, err error)
- func (db *Db) DelAllCommands(botId int64) error
- func (db *Db) DelCommand(botId int64, commandId int64) error
- func (db *Db) DelCommandsByCompIdTx(ctx context.Context, tx pgx.Tx, botId int64, compId int64) error
- func (db *Db) DelNextStepCommand(botId int64, commandId int64) error
- func (db *Db) DeleteBot(userId int64, botId int64) error
- func (db *Db) DeleteComponent(botId int64, groupId int64, componentId int64) error
- func (db *Db) DeleteConnection(botId int64, groupId int64, m *model.SourceConnectionPoint, ...) error
- func (db *Db) GetBotStatus(botId int64, userId int64) (model.BotStatus, error)
- func (db *Db) GetBotToken(userId int64, botId int64) (*string, error)
- func (db *Db) GetComponentType(botId int64, groupId int64, componentId int64) (string, error)
- func (db *Db) GetComponents(botId int64, groupId int64) ([]*model.Component, error)
- func (db *Db) GetCountCommandsInComponent(botId int64, compId int64) (int64, error)
- func (db *Db) GetTargetComponentId(botId int64, groupId int64, m *model.SourceConnectionPoint) (*int64, error)
- func (db *Db) SetBotStatus(botId int64, userId int64, status model.BotStatus) error
- func (db *Db) SetBotToken(userId int64, botId int64, token *string) error
- func (db *Db) SetComponentPosition(botId int64, groupId int64, componentId int64, position *model.Point) error
- func (db *Db) SetNextStepCommand(botId int64, commandId int64, nextStepId int64) error
- func (db *Db) SetUserStepByTgId(botId int64, userId int64, stepID int64) error
- func (db *Db) UpdCommand(botId int64, commandId int64, t *string, data *string) error
- func (db *Db) UpdateComponentData(botId int64, groupId int64, componentId int64, data map[string]any) error
- func (db *Db) UpdateComponentPath(botId int64, groupId int64, componentId int64, path string) error
- func (db *Db) UserBots(userId int64) (*[]*model.Bot, error)
- func (db *Db) UserStepByTgId(botId int64, userId int64) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Db ¶
func OpenConnection ¶
func (*Db) AddCommandTx ¶
func (*Db) AddComponent ¶
id bigserial NOT NULL, type VARCHAR(20), component_id BIGINT NOT NULL UNIQUE, next_id BIGINT, path text NOT NULL DEFAULT '''', position POINT, group_id BIGINT, PRIMARY KEY (id), FOREIGN KEY(group_id)
func (*Db) AddConnection ¶
func (*Db) CheckCommandExist ¶
func (*Db) CheckComponentExist ¶
func (*Db) CheckGroupExist ¶
func (*Db) CheckUserExistByTgId ¶
func (*Db) CloseConnection ¶
func (db *Db) CloseConnection()
func (*Db) DelAllCommands ¶
func (*Db) DelCommandsByCompIdTx ¶
func (*Db) DelNextStepCommand ¶
func (*Db) DeleteComponent ¶
func (*Db) DeleteConnection ¶
func (*Db) GetBotStatus ¶
func (*Db) GetComponentType ¶
func (*Db) GetComponents ¶
func (*Db) GetCountCommandsInComponent ¶
func (*Db) GetTargetComponentId ¶
func (*Db) SetBotStatus ¶
func (*Db) SetComponentPosition ¶
func (*Db) SetNextStepCommand ¶
func (*Db) SetUserStepByTgId ¶
func (*Db) UpdCommand ¶
func (*Db) UpdateComponentData ¶
func (*Db) UpdateComponentPath ¶
Click to show internal directories.
Click to hide internal directories.