mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
Resolves #37220 Added a dummy implementation of the orbit_info table to the orbit shell. A full implementation is not possible directly in the shell because the orbit service stores specific instrumentation values in memory. To query the live orbit_info table, users must connect to the osquery-orbit extension socket.
40 lines
765 B
Go
40 lines
765 B
Go
package table
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/osquery/osquery-go/plugin/table"
|
|
)
|
|
|
|
// EmptyExtension implements a basic table extension that displays an instructional
|
|
// message to the user during queries.
|
|
type EmptyExtension struct {
|
|
name string
|
|
msg string
|
|
}
|
|
|
|
func NewEmptyExtension(
|
|
name string,
|
|
msg string,
|
|
) Opt {
|
|
return WithExtension(
|
|
&EmptyExtension{
|
|
name: name,
|
|
msg: msg,
|
|
},
|
|
)
|
|
}
|
|
|
|
func (o EmptyExtension) Name() string {
|
|
return o.name
|
|
}
|
|
func (o EmptyExtension) Columns() []table.ColumnDefinition {
|
|
return []table.ColumnDefinition{
|
|
table.TextColumn("message"),
|
|
}
|
|
}
|
|
func (o EmptyExtension) GenerateFunc(_ context.Context, _ table.QueryContext) ([]map[string]string, error) {
|
|
return []map[string]string{{
|
|
"message": o.msg,
|
|
}}, nil
|
|
}
|