model

package
v2.3.9 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() string

func SaveToFile

func SaveToFile(conf *FileConfig) error

Types

type FileConfig

type FileConfig struct {
	Token       string `json:"personal_access_token"`
	MyNodes     string `json:"my_node_keys"`
	Timeout     uint   `json:"timeout"`
	ActiveTab   int    `json:"active_tab"`
	ShowMode    int    `json:"show_mode"`
	Env         string `json:"env"`
	ChooseAPIV2 bool   `json:"choose_api_v2"`
}

func NewDefaultFileConfig

func NewDefaultFileConfig() *FileConfig

func (*FileConfig) GetShowModeText

func (c *FileConfig) GetShowModeText() string

func (*FileConfig) IsDevelopmentEnv

func (c *FileConfig) IsDevelopmentEnv() bool

func (*FileConfig) IsMockEnv

func (c *FileConfig) IsMockEnv() bool

func (*FileConfig) IsProductionEnv

func (c *FileConfig) IsProductionEnv() bool

func (*FileConfig) ShowFooter

func (c *FileConfig) ShowFooter() bool

func (*FileConfig) ShowHelp

func (c *FileConfig) ShowHelp() bool

func (*FileConfig) ShowLimit

func (c *FileConfig) ShowLimit() bool

func (*FileConfig) SwitchShowMode

func (c *FileConfig) SwitchShowMode() int

type Safe

type Safe[T any] struct {
	// contains filtered or unexported fields
}

func NewSafe

func NewSafe[T any](v T, fn func(v T) error) *Safe[T]

func (*Safe[T]) Get

func (s *Safe[T]) Get() T

func (*Safe[T]) Save

func (s *Safe[T]) Save(fn func(T)) error

func (*Safe[T]) Set

func (s *Safe[T]) Set(v T)

func (*Safe[T]) Update

func (s *Safe[T]) Update(fn func(T))

type SessionData

type SessionData struct {
	HideFooter atomic.Bool
	IsApiV2    atomic.Bool
}

type WindowSize

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

func (*WindowSize) GetSize

func (w *WindowSize) GetSize() (int, int)

GetSize 原子性地获取窗口大小

func (*WindowSize) SetSize

func (w *WindowSize) SetSize(msg tea.WindowSizeMsg)

SetSize 原子性地设置窗口大小

Jump to

Keyboard shortcuts

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