db

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDatabaseFilename

func DefaultDatabaseFilename() (string, error)

Types

type DAO

type DAO interface {
	WorkingSetDAO
}

func New

func New(opts ...Option) (DAO, error)

type Option

type Option func(o *options) error

func WithDatabaseFile

func WithDatabaseFile(dbFile string) Option

type Secret

type Secret struct {
	Provider string `json:"provider"`
}

type SecretMap

type SecretMap map[string]Secret

func (*SecretMap) Scan

func (secrets *SecretMap) Scan(value any) error

func (SecretMap) Value

func (secrets SecretMap) Value() (driver.Value, error)

type Server

type Server struct {
	Type    string         `json:"type"`
	Config  map[string]any `json:"config,omitempty"`
	Secrets string         `json:"secrets,omitempty"`
	Tools   []string       `json:"tools,omitempty"`
	Source  string         `json:"source,omitempty"`
	Image   string         `json:"image,omitempty"`
}

type ServerList

type ServerList []Server

func (*ServerList) Scan

func (servers *ServerList) Scan(value any) error

func (ServerList) Value

func (servers ServerList) Value() (driver.Value, error)

type WorkingSet

type WorkingSet struct {
	ID      string     `db:"id"`
	Name    string     `db:"name"`
	Servers ServerList `db:"servers"`
	Secrets SecretMap  `db:"secrets"`
}

type WorkingSetDAO

type WorkingSetDAO interface {
	GetWorkingSet(ctx context.Context, id string) (*WorkingSet, error)
	FindWorkingSetsByIDPrefix(ctx context.Context, prefix string) ([]WorkingSet, error)
	ListWorkingSets(ctx context.Context) ([]WorkingSet, error)
	CreateWorkingSet(ctx context.Context, workingSet WorkingSet) error
	UpdateWorkingSet(ctx context.Context, workingSet WorkingSet) error
	RemoveWorkingSet(ctx context.Context, id string) error
}

Jump to

Keyboard shortcuts

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