settings

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeSettingsUpdateMsg

func MakeSettingsUpdateMsg(s Settings) tea.Cmd

Types

type Model

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

set up a text input model that only renders if it is not viewMode based on the mode we are in, that is the column we will update in the sql database. After a successful save, we are going to go back to view mode.

func New

func New(db *sql.DB) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type Settings

type Settings struct {
	ID        int
	Model     string
	MaxTokens int
	Frequency int
}

type SettingsService

type SettingsService struct {
	DB *sql.DB
}

func NewSettingsService

func NewSettingsService(db *sql.DB) *SettingsService

func (*SettingsService) GetSettings

func (ss *SettingsService) GetSettings() (Settings, error)

func (*SettingsService) UpdateSettings

func (ss *SettingsService) UpdateSettings(newSettings Settings) (Settings, error)

type UpdateSettingsEvent

type UpdateSettingsEvent struct {
	Settings Settings
}

Jump to

Keyboard shortcuts

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