adapter

package
v1.261006.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MPL-2.0 Imports: 5 Imported by: 0 modules, 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

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

type SettingsLister interface {
	ListEnabledSettings() ([]db.Settings, error)
}

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.

Jump to

Keyboard shortcuts

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