builtin

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultWorld []byte
View Source
var ServerURL string = "localhost:50051"

Functions

func BuiltinClientConn

func BuiltinClientConn() (*grpc.ClientConn, error)

func BuiltinDialer

func BuiltinDialer() grpc.DialOption

func GetBuiltinListener

func GetBuiltinListener() *bufconn.Listener

func HTTPHandler added in v0.0.20

func HTTPHandler() http.Handler

HTTPHandler returns a handler that delegates to the current shared mux. The indirection allows ResetHTTPHandlers to swap the underlying mux.

func Handle added in v0.0.20

func Handle(pattern string, handler http.Handler)

Handle registers an HTTP handler on the shared builtin mux.

func HandleFunc added in v0.0.20

func HandleFunc(pattern string, handler http.HandlerFunc)

HandleFunc registers an HTTP handler function on the shared builtin mux.

func Register

func Register(name string, run func(ctx context.Context, logger *slog.Logger, serverURL string) error)

func ResetHTTPHandlers added in v0.0.20

func ResetHTTPHandlers()

ResetHTTPHandlers replaces the shared mux so that restarting builtins can re-register their HTTP routes without conflicting with old patterns.

func RestartAll added in v0.0.20

func RestartAll()

RestartAll cancels all running builtins and starts them again.

func StartAll

func StartAll(ctx context.Context, serverURL string)

func ValidatePath added in v0.0.19

func ValidatePath(path string) error

ValidatePath checks that the given file path is under the current working directory or one of the explicitly allowed paths (--allow-path).

Types

type Builtin

type Builtin struct {
	Name string
	Run  func(ctx context.Context, logger *slog.Logger, serverURL string) error
}

type Permissions

type Permissions struct {
	DisableLocalSerial bool
	AllowNetscan       bool
	AllowedPaths       []string
}

Permissions controls which local resources builtins are allowed to access. Set before calling StartAll.

var LocalPermissions Permissions

Directories

Path Synopsis
Package all imports all builtin controllers so that a single
Package all imports all builtin controllers so that a single
Package controller provides a framework for managing entity-driven connectors.
Package controller provides a framework for managing entity-driven connectors.
Package playground is a builtin designed for frontend developers to test configuration UIs.
Package playground is a builtin designed for frontend developers to test configuration UIs.
Package plugins implements a builtin controller that fetches a plugin registry index and presents each available plugin as a configurable entity.
Package plugins implements a builtin controller that fetches a plugin registry index and presents each available plugin as a configurable entity.

Jump to

Keyboard shortcuts

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