Documentation
¶
Index ¶
- func AddConnectionsOpenAPI(spec *rpc.OpenAPISpec)
- func MaskValue(value string) string
- func Parse(body map[string]any) (*models.Connection, error)
- type BodyDecoder
- type ConnectionInspection
- type ConnectionInspectionTarget
- type ContextProvider
- type DatabaseProvider
- type InspectFlags
- type ListOptions
- type Options
- type ProfileProvider
- type Service
- func (s *Service) Create(ctx context.Context, body map[string]any) (*models.Connection, error)
- func (s *Service) Delete(id string) error
- func (s *Service) Get(id string) (*models.Connection, error)
- func (s *Service) Handler(prefix string, next http.Handler) http.Handler
- func (s *Service) Inspect(ctx context.Context, id string, options InspectFlags) (*ConnectionInspection, error)
- func (s *Service) List(options ListOptions) ([]*models.Connection, error)
- func (s *Service) RegisterClicky()
- func (s *Service) SetVirtual(provider VirtualConnectionProvider)
- func (s *Service) Update(ctx context.Context, id string, body map[string]any) (*models.Connection, error)
- type VirtualConnectionProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddConnectionsOpenAPI ¶ added in v0.1.29
func AddConnectionsOpenAPI(spec *rpc.OpenAPISpec)
AddConnectionsOpenAPI documents the inventory read and its opt-in health trigger without publishing either as an explorer surface.
Types ¶
type ConnectionInspection ¶ added in v0.1.30
type ConnectionInspection struct {
Targets []ConnectionInspectionTarget `json:"targets,omitempty"`
Result *query.InspectionResult `json:"result,omitempty"`
}
func (*ConnectionInspection) Pretty ¶ added in v0.1.30
func (result *ConnectionInspection) Pretty() api.Text
func (*ConnectionInspection) PrettyFull ¶ added in v0.1.30
func (result *ConnectionInspection) PrettyFull() api.Textable
type ConnectionInspectionTarget ¶ added in v0.1.30
type ConnectionInspectionTarget struct {
Name string `json:"name"`
Target string `json:"target"`
Kind string `json:"kind"`
Schema string `json:"schema,omitempty"`
FieldCount int `json:"fieldCount,omitempty"`
Inspect api.LinkCommand `json:"inspect"`
}
func (ConnectionInspectionTarget) Columns ¶ added in v0.1.30
func (ConnectionInspectionTarget) Columns() []api.ColumnDef
func (ConnectionInspectionTarget) Row ¶ added in v0.1.30
func (target ConnectionInspectionTarget) Row() map[string]any
type ContextProvider ¶
type DatabaseProvider ¶
type InspectFlags ¶ added in v0.1.30
type InspectFlags struct {
Database string `flag:"database" help:"Database to inspect"`
Schema string `flag:"schema" hidden:"true" help:"SQL schema containing the target"`
Target string `flag:"target" help:"Table, view, index, alias, data stream, or pattern to inspect"`
TargetKind string `flag:"target-kind" hidden:"true" help:"OpenSearch target kind"`
Sample bool `flag:"sample" help:"Sample the selected target to resolve cardinality and auto-filters"`
Refresh bool `flag:"refresh" help:"Refresh cached inspection metadata"`
// contains filtered or unexported fields
}
func (InspectFlags) ClickyActionFlags ¶ added in v0.1.30
func (InspectFlags) ClickyActionFlags()
func (InspectFlags) Filters ¶ added in v0.1.30
func (options InspectFlags) Filters() []entity.Filter[InspectFlags]
func (*InspectFlags) SetClickyActionContext ¶ added in v0.1.30
func (options *InspectFlags) SetClickyActionContext(ctx context.Context, id string)
type ListOptions ¶
type ListOptions struct {
Type string `flag:"type" help:"Filter by connection type"`
Types string `flag:"types" help:"Filter by connection types (comma-separated)"`
}
ListOptions are the list/filter options for the connection entity. Types is the comma-separated form used by the connection lookup to scope a picker to the connection types valid for a profile's provider (e.g. sql → postgres,mysql,...).
type Options ¶
type Options struct {
Database DatabaseProvider
Context ContextProvider
DecodeBody BodyDecoder
Profiles ProfileProvider
Virtual VirtualConnectionProvider
}
type ProfileProvider ¶ added in v0.1.29
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Inspect ¶ added in v0.1.30
func (s *Service) Inspect(ctx context.Context, id string, options InspectFlags) (*ConnectionInspection, error)
func (*Service) List ¶
func (s *Service) List(options ListOptions) ([]*models.Connection, error)
func (*Service) RegisterClicky ¶
func (s *Service) RegisterClicky()
registerConnectionEntity registers the DB-backed connection entity with full CRUD on both the CLI and over HTTP. Create/Update use the context-aware handlers so they can read the raw nested JSON body (e.g. connection `properties`) clicky stashes on the context via rpc.RequestFromContext, which the executor would otherwise flatten to string flags. The database provider resolves lazily because entities register before the database exists.
func (*Service) SetVirtual ¶ added in v0.1.29
func (s *Service) SetVirtual(provider VirtualConnectionProvider)
type VirtualConnectionProvider ¶ added in v0.1.29
type VirtualConnectionProvider interface {
ListConnections() []*models.Connection
ResolveConnection(string) (*models.Connection, error)
}