Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandResponse ¶
type CommandResponse struct {
Items []CommandResponseItem `json:"items"`
}
CommandResponse defiens command response
type CommandResponseItem ¶
type CommandResponseItem struct { Type string `json:"type"` // e.g. recordset Value interface{} `json:"value"` }
CommandResponseItem defines response item
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor executes DataTug commands
func NewExecutor ¶
func NewExecutor( getDbByID func(envID, dbID string) (*models.EnvDb, error), getCatalogSummary func(server models.ServerReference, catalogID string) (*models.DbCatalogSummary, error), ) Executor
NewExecutor creates new executor
func (Executor) ExecuteSingle ¶
func (e Executor) ExecuteSingle(command RequestCommand) (response Response, err error)
ExecuteSingle executes single DB command
type Request ¶
type Request struct { ID string `json:"id"` Project string `json:"project"` Commands []RequestCommand `json:"commands"` }
Request defines what needs to be executed
type RequestCommand ¶
type RequestCommand struct { models.Credentials // holds username & password, if not provided trusted connection models.ServerReference Env string `json:"env"` DB string `json:"db"` Text string `json:"text"` Parameters []models.Parameter `json:"parameters"` }
RequestCommand holds parameters for command to be executed
func (RequestCommand) Validate ¶
func (v RequestCommand) Validate() error
Validate checks of command request is valid
type Response ¶
type Response struct { Duration time.Duration `json:"durationNanoseconds"` Commands []*CommandResponse `json:"commands"` }
Response holds execute response
Click to show internal directories.
Click to hide internal directories.