remote

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultHostname       = "dbrain"
	DefaultMCPPath        = "/mcp"
	DefaultStartupTimeout = 45 * time.Second
)
View Source
const SecretCommandTimeout = 10 * time.Second
View Source
const StateLockName = "dbrain.lock"

Variables

View Source
var ErrAlreadyLocked = errors.New("state dir is already locked by another dbrain process")

Functions

func LooksLikeSyncedPath

func LooksLikeSyncedPath(path string) bool

func NewHandler

func NewHandler(opts HandlerOptions) (http.Handler, error)

func PrepareStateDir

func PrepareStateDir(path string) (string, error)

func ResolveStateDir

func ResolveStateDir(path string) (string, error)

func Serve

func Serve(ctx context.Context, cfg config.Config, opts Options, logOut io.Writer) error

func ValidateFunnelOptions added in v0.2.5

func ValidateFunnelOptions(o Options) error

func ValidateMCPPath

func ValidateMCPPath(value string) (string, error)

Types

type HandlerOptions

type HandlerOptions struct {
	Web        bool
	MCP        bool
	MCPPath    string
	TLS        bool
	WebHandler http.Handler
	MCPHandler http.Handler
}

type Options

type Options struct {
	Web                bool
	MCP                bool
	MCPPath            string
	Hostname           string
	StateDir           string
	Listen             string
	TLS                bool
	Funnel             bool
	StartupTimeout     time.Duration
	AuthKey            string
	AuthKeyRef         string
	AuthKeyCommand     []string
	AllowSecretCommand bool
	AdvertiseTags      []string
	ControlURL         string
	Verbose            bool
	OnReady            func()
	SchedulerStatus    func() schedulerstate.SyncAllStatus
}

func OptionsFromRuntime

func OptionsFromRuntime(cfg config.Config) (Options, error)

func (*Options) Validate

func (o *Options) Validate() error

type SecretResult

type SecretResult struct {
	Value    string
	Source   string
	Warnings []string
}

func ResolveAuthKey

func ResolveAuthKey(ctx context.Context, opts Options) (SecretResult, error)

type ServeResult

type ServeResult struct {
	StateDir string
	WebURL   string
	MCPURL   string
}

func URLs

func URLs(status *ipnstate.Status, opts Options) ServeResult

type StateLock

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

func AcquireStateLock

func AcquireStateLock(stateDir string) (*StateLock, error)

func (*StateLock) Close

func (l *StateLock) Close() error

func (*StateLock) Path

func (l *StateLock) Path() string

Jump to

Keyboard shortcuts

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