Documentation
¶
Index ¶
- Constants
- Variables
- func LooksLikeSyncedPath(path string) bool
- func NewHandler(opts HandlerOptions) (http.Handler, error)
- func PrepareStateDir(path string) (string, error)
- func ResolveStateDir(path string) (string, error)
- func Serve(ctx context.Context, cfg config.Config, opts Options, logOut io.Writer) error
- func SetMCPDependencies(opts *Options, dependencies mcpserver.ServerDependencies)
- func SetWebAuditDependencies(opts *Options, dependencies web.AuditHandlerDependencies)
- func ValidateFunnelOptions(o Options) error
- func ValidateMCPPath(value string) (string, error)
- func ValidateSurfacePaths(webEnabled, mcpEnabled bool, mcpPath string) error
- type HandlerOptions
- type Options
- type SecretResult
- type ServeResult
- type StateLock
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 NewHandler ¶
func NewHandler(opts HandlerOptions) (http.Handler, error)
func PrepareStateDir ¶
func ResolveStateDir ¶
func SetMCPDependencies ¶ added in v0.7.0
func SetMCPDependencies(opts *Options, dependencies mcpserver.ServerDependencies)
func SetWebAuditDependencies ¶ added in v0.7.0
func SetWebAuditDependencies(opts *Options, dependencies web.AuditHandlerDependencies)
func ValidateFunnelOptions ¶ added in v0.2.5
func ValidateMCPPath ¶
func ValidateSurfacePaths ¶ added in v0.7.0
Types ¶
type HandlerOptions ¶
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
// contains filtered or unexported fields
}
type SecretResult ¶
func ResolveAuthKey ¶
func ResolveAuthKey(ctx context.Context, opts Options) (SecretResult, error)
type ServeResult ¶
Click to show internal directories.
Click to hide internal directories.