platform

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const NoKeychainEnv = "DEVSTRAP_NO_KEYCHAIN"

NoKeychainEnv, when set to "1", forces the file-backed key store instead of the OS keychain. This is required for headless/CI runs and hermetic end-to-end tests, where an OS keychain call can block on a GUI unlock prompt.

Variables

View Source
var (
	ErrUnsupported    = errors.New("platform feature unsupported")
	ErrEditorNotFound = errors.New("editor command not found")
	ErrSecretNotFound = errors.New("platform secret not found")
)

Functions

This section is empty.

Types

type EditorAdapter

type EditorAdapter interface {
	Name() string
	Open(ctx context.Context, dir, editor string) error
}

type FSEvent

type FSEvent struct {
	Kind FSEventKind
	Path string
	At   time.Time
}

type FSEventKind

type FSEventKind string
const (
	FSEventUnknown FSEventKind = "unknown"
	FSEventScan    FSEventKind = "scan"
)

type Keychain

type Keychain interface {
	Name() string
	Store(ctx context.Context, service, account string, secret []byte) error
	Load(ctx context.Context, service, account string) ([]byte, error)
	Delete(ctx context.Context, service, account string) error
}

type NativeWatcher

type NativeWatcher struct {
	Debounce   time.Duration
	MaxLatency time.Duration
}

func (NativeWatcher) Name

func (w NativeWatcher) Name() string

func (NativeWatcher) Watch

func (w NativeWatcher) Watch(ctx context.Context, root string, events chan<- FSEvent) error

type PollWatcher

type PollWatcher struct {
	Interval time.Duration
}

func (PollWatcher) Name

func (w PollWatcher) Name() string

func (PollWatcher) Watch

func (w PollWatcher) Watch(ctx context.Context, root string, events chan<- FSEvent) error

type RuntimeInfo

type RuntimeInfo struct {
	OS   string
	Arch string
}

func Runtime

func Runtime() RuntimeInfo

type ServiceManager

type ServiceManager interface {
	Name() string
	Install(ctx context.Context, spec ServiceSpec) error
	Uninstall(ctx context.Context, label string) error
	Status(ctx context.Context, label string) (ServiceStatus, error)
}

type ServiceSpec

type ServiceSpec struct {
	Label    string
	ExecPath string
	Args     []string
	Env      map[string]string
}

type ServiceStatus

type ServiceStatus struct {
	Installed bool
	Running   bool
	Detail    string
}

type Set

type Set struct {
	OS       string
	Watcher  Watcher
	Service  ServiceManager
	Keychain Keychain
	Editor   EditorAdapter
}

func Detect

func Detect() Set

type SystemEditor

type SystemEditor struct{}

func (SystemEditor) Name

func (SystemEditor) Name() string

func (SystemEditor) Open

func (SystemEditor) Open(ctx context.Context, dir, editor string) error

type SystemKeychain

type SystemKeychain struct {
	Platform string
	Target   string
}

func (SystemKeychain) Delete

func (k SystemKeychain) Delete(_ context.Context, service, account string) error

func (SystemKeychain) Load

func (k SystemKeychain) Load(_ context.Context, service, account string) ([]byte, error)

func (SystemKeychain) Name

func (k SystemKeychain) Name() string

func (SystemKeychain) Store

func (k SystemKeychain) Store(_ context.Context, service, account string, secret []byte) error

type UnsupportedKeychain

type UnsupportedKeychain struct {
	Platform string
	Target   string
}

func (UnsupportedKeychain) Delete

func (UnsupportedKeychain) Load

func (UnsupportedKeychain) Name

func (k UnsupportedKeychain) Name() string

func (UnsupportedKeychain) Store

type UnsupportedServiceManager

type UnsupportedServiceManager struct {
	Platform string
	Target   string
}

func (UnsupportedServiceManager) Install

func (UnsupportedServiceManager) Name

func (UnsupportedServiceManager) Status

func (UnsupportedServiceManager) Uninstall

type Watcher

type Watcher interface {
	Name() string
	Watch(ctx context.Context, root string, events chan<- FSEvent) error
}

Jump to

Keyboard shortcuts

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