Documentation
¶
Overview ¶
Package tools provides the tailkitd tool registry. It reads tool registration files from /etc/tailkitd/tools/ on every GET /tools request so that installs and upgrades are reflected immediately without a tailkitd restart.
Index ¶
- type Registry
- func (r *Registry) Handler() http.HandlerFunc
- func (r *Registry) HasTool(ctx context.Context, name, minVersion string) (bool, error)
- func (r *Registry) List(ctx context.Context) ([]tailkit.Tool, error)
- func (r *Registry) LookupCommand(ctx context.Context, toolName, cmdName string) (tailkit.Tool, tailkit.Command, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry reads tool registration files and serves the GET /tools endpoint. It reads from disk on every request so installs and upgrades are live.
func NewRegistry ¶
NewRegistry constructs a Registry that reads from the given directory. Pass defaultToolsDir ("/etc/tailkitd/tools") in production.
func (*Registry) Handler ¶
func (r *Registry) Handler() http.HandlerFunc
Handler returns an http.HandlerFunc for GET /tools. It lists all registered tools and responds with JSON.
func (*Registry) HasTool ¶
HasTool reports whether a tool with the given name (and at least the given minimum version) is registered. An empty minVersion matches any version.