Documentation
¶
Overview ¶
Package adapter is the host↔remote glue layer. It is the only place where main-module persistence types (internal/data/db) meet the pure remote library interfaces, keeping the db.Settings type on the host side of the boundary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BotSettingFromRecord ¶
func BotSettingFromRecord(record db.Settings) bot.BotSetting
BotSettingFromRecord converts a stored db.Settings row into the bot.BotSetting the runtime consumes. This is the ONE conversion point — both the host wiring and the adapter go through it.
Types ¶
type BindingStore ¶
type BindingStore struct {
// contains filtered or unexported fields
}
BindingStore adapts a host settings store to binding.Store, mapping db.Settings onto the small binding.BotInfo record the resolver consumes. This is the single db↔remote bridge.
func NewBindingStore ¶
func NewBindingStore(store SettingsLister) *BindingStore
NewBindingStore wraps a host settings store as a binding.Store.
func (*BindingStore) ListEnabledBindings ¶
func (b *BindingStore) ListEnabledBindings() ([]binding.BotInfo, error)
ListEnabledBindings implements binding.Store.
type SettingsLister ¶
SettingsLister is the read surface the bridge needs from the imbot settings store. *db.ImBotSettingsStore satisfies it directly.
type SettingsReader ¶
type SettingsReader interface {
GetSettingsByUUID(uuid string) (db.Settings, error)
ListEnabledSettings() ([]db.Settings, error)
}
SettingsReader is the read surface the bridge needs from the imbot settings store. *db.ImBotSettingsStore satisfies it directly.
type SettingsStore ¶
type SettingsStore struct {
// contains filtered or unexported fields
}
SettingsStore adapts a host settings store to bot.SettingsStore, mapping db.Settings onto the remote-owned bot.BotSetting. This is the single db↔remote-control bridge for settings; it keeps the db.Settings type on the host side of the boundary.
func NewSettingsStore ¶
func NewSettingsStore(store SettingsReader) *SettingsStore
NewSettingsStore wraps a host settings store as a bot.SettingsStore.
func (*SettingsStore) GetSettingsByUUID ¶
func (s *SettingsStore) GetSettingsByUUID(uuid string) (bot.BotSetting, error)
GetSettingsByUUID implements bot.SettingsStore.
func (*SettingsStore) ListEnabledSettings ¶
func (s *SettingsStore) ListEnabledSettings() ([]bot.BotSetting, error)
ListEnabledSettings implements bot.SettingsStore.