model

package
v0.0.0-...-e0d5016 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Unlicense Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists = errors.New("record already exists")
	ErrNotFound      = errors.New("record not found")
	ErrQueryNotFound = errors.New("query not found")
)
View Source
var ErrAddressNotFound = errors.New("address not found")
View Source
var ErrHomeAddressNotSet = errors.New("home address not set")

Functions

This section is empty.

Types

type AFKData

type AFKData struct {
	Since     time.Time      `db:"afk_since"`
	Reason    sql.NullString `db:"afk_reason"`
	FirstName string         `db:"first_name"`
}

func (*AFKData) Duration

func (a *AFKData) Duration() time.Duration

type AllowService

type AllowService interface {
	AllowChat(chat *gotgbot.Chat) error
	AllowUser(user *gotgbot.User) error
	DenyChat(chat *gotgbot.Chat) error
	DenyUser(user *gotgbot.User) error
	IsChatAllowed(chat *gotgbot.Chat) bool
	IsUserAllowed(user *gotgbot.User) bool
}

type ChatService

type ChatService interface {
	Allow(chat *gotgbot.Chat) error
	Create(chat *gotgbot.Chat) error
	CreateTx(tx *sqlx.Tx, chat *gotgbot.Chat) error
	Deny(chat *gotgbot.Chat) error
	GetAllAllowed() ([]int64, error)
}

type ChatsPluginsService

type ChatsPluginsService interface {
	Disable(chat *gotgbot.Chat, pluginName string) error
	Enable(chat *gotgbot.Chat, pluginName string) error
	GetAllDisabled() (map[int64][]string, error)
}

type ChatsUsersService

type ChatsUsersService interface {
	Create(chat *gotgbot.Chat, user *gotgbot.User) error
	CreateBatch(chat *gotgbot.Chat, users *[]gotgbot.User) error
	GetAllUsersWithMsgCount(chat *gotgbot.Chat) ([]User, error)
	IsAllowed(chat *gotgbot.Chat, user *gotgbot.User) bool
	Leave(chat *gotgbot.Chat, user *gotgbot.User) error
}

type Credential

type Credential struct {
	Name  string `db:"name"`
	Value string `db:"value"`
}

type CredentialService

type CredentialService interface {
	GetAllCredentials() map[string]string
	GetKey(name string) string
	SetKey(name, value string) error
	DeleteKey(name string) error
}

type GPTData

type GPTData struct {
	ResponseID sql.NullString `db:"gpt_response_id"`
	ExpiresOn  sql.NullTime   `db:"gpt_response_id_expires_on"`
}

type GelbooruService

type GelbooruService interface {
	GetQuery(queryID int64) (string, error)
	SaveQuery(query string) (int64, error)
}

type GeminiData

type GeminiData struct {
	History   sql.NullString `db:"gemini_history"`
	ExpiresOn sql.NullTime   `db:"gemini_history_expires_on"`
}

type GeocodingService

type GeocodingService interface {
	Geocode(address string) (gotgbot.Venue, error)
}

type HomeService

type HomeService interface {
	GetHome(user *gotgbot.User) (gotgbot.Venue, error)
	SetHome(user *gotgbot.User, venue *gotgbot.Venue) error
	DeleteHome(user *gotgbot.User) error
}

type ImageSearchImage

type ImageSearchImage interface {
	ImageLink() string
	ContextLink() string
	IsGIF() bool
}

type ImageSearchImages

type ImageSearchImages struct {
	QueryID      int64
	CurrentIndex int
	Images       []ImageSearchImage
}

type ManagerService

type ManagerService interface {
	Plugins() []plugin.Plugin
	EnablePlugin(name string) error
	EnablePluginForChat(chat *gotgbot.Chat, name string) error
	DisablePlugin(name string) error
	DisablePluginForChat(chat *gotgbot.Chat, name string) error
	IsPluginEnabled(name string) bool
	IsPluginDisabledForChat(chat *gotgbot.Chat, name string) bool
}

type Plugin

type Plugin struct {
	Name    string `db:"name"`
	Enabled bool   `db:"enabled"`
}

type PluginService

type PluginService interface {
	CreateTx(tx *sqlx.Tx, pluginName string) error
	Disable(pluginName string) error
	Enable(pluginName string) error
	GetAllEnabled() ([]string, error)
}

type Reminder

type Reminder struct {
	ID       int64         `db:"id"`
	ChatID   sql.NullInt64 `db:"chat_id"`
	UserID   int64         `db:"user_id"`
	Username string        `db:"username"`
	Time     time.Time     `db:"time"`
	Text     string        `db:"text"`
}

type User

type User struct {
	ID        int64          `db:"id"`
	FirstName string         `db:"first_name"`
	LastName  sql.NullString `db:"last_name"`
	Username  sql.NullString `db:"username"`
	Allowed   bool           `db:"allowed"`
	MsgCount  int64          `db:"msg_count"`
	InGroup   bool           `db:"in_group"`
	Birthday  sql.NullTime   `db:"birthday"`
}

func (*User) GetFullName

func (user *User) GetFullName() string

type UserService

type UserService interface {
	Allow(user *gotgbot.User) error
	Create(user *gotgbot.User) error
	CreateTx(tx *sqlx.Tx, user *gotgbot.User) error
	Deny(user *gotgbot.User) error
	GetAllAllowed() ([]int64, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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