config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateManifest

func CreateManifest(cfg Config, driver DriverInfo) (err error)

func EnsureLocation

func EnsureLocation(cfg Config) (string, error)

func Get

func Get() map[ConfigLevel]Config

func PlatformTuple

func PlatformTuple() string

func UninstallDriver

func UninstallDriver(_ Config, info DriverInfo) error

func UninstallDriverShared

func UninstallDriverShared(info DriverInfo) error

Common, non-platform-specific code for uninstalling a driver. Called by platform-specific UninstallDriver function.

Types

type Config

type Config struct {
	Level    ConfigLevel
	Location string
	Drivers  map[string]DriverInfo
	Exists   bool
	Err      error
}

type ConfigLevel

type ConfigLevel int
const (
	ConfigUnknown ConfigLevel = iota
	ConfigSystem
	ConfigUser
	ConfigEnv
)

func (ConfigLevel) String

func (c ConfigLevel) String() string

func (*ConfigLevel) UnmarshalText

func (c *ConfigLevel) UnmarshalText(b []byte) error

type DriverInfo

type DriverInfo struct {
	ID       string
	FilePath string

	Name      string
	Publisher string
	License   string
	Version   *semver.Version
	Source    string

	AdbcInfo struct {
		Version  *semver.Version `toml:"version"`
		Features struct {
			Supported   []string `toml:"supported,omitempty"`
			Unsupported []string `toml:"unsupported,omitempty"`
		} `toml:"features,omitempty"`
	} `toml:"ADBC"`

	Driver struct {
		Entrypoint string
		Shared     driverMap
	}
}

func FindDriverConfigs

func FindDriverConfigs(lvl ConfigLevel) []DriverInfo

func GetDriver

func GetDriver(cfg Config, driverName string) (DriverInfo, error)

type Manifest

type Manifest struct {
	DriverInfo

	Files struct {
		Driver    string `toml:"driver,omitempty"`
		Signature string `toml:"signature,omitempty"`
	} `toml:"Files,omitempty"`

	PostInstall struct {
		Messages []string `toml:"messages,inline,omitempty"`
	} `toml:"PostInstall,omitempty"`
}

func InflateTarball

func InflateTarball(f *os.File, outDir string) (Manifest, error)

TODO: Unexport once we refactor sync.go. sync.go has it's own separate installation routine which it probably shouldn't.

func InstallDriver

func InstallDriver(cfg Config, shortName string, downloaded *os.File) (Manifest, error)

type Model

type Model struct {
	Prev tea.Model

	Drivers []DriverInfo
	// contains filtered or unexported fields
}

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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