Documentation
¶
Index ¶
- Variables
- func Register(def *QueryRunnerDefinition) error
- func RestrictQueryBlock(queryRunnerType string, body hcl.Body) hcl.Diagnostics
- func RestrictQueryRunnerBlock(queryRunnerType string, body hcl.Body) hcl.Diagnostics
- func WithQueryRunningContext(ctx context.Context, info *QueryRunningContext) context.Context
- type PreparedQuery
- type QueryResult
- func NewEmptyQueryResult(name string, query string) *QueryResult
- func NewQueryResult(name string, query string, columns []string, rows [][]string) *QueryResult
- func NewQueryResultWithJSONLines(name string, query string, lines [][]byte) *QueryResult
- func NewQueryResultWithRowsMap(name, query string, columnsMap map[string]int, ...) *QueryResult
- type QueryRunner
- type QueryRunnerDefinition
- type QueryRunningContext
- type Waiter
Constants ¶
This section is empty.
Variables ¶
View Source
var QueryRunningContextKey contextKey = "__handle_context"
Functions ¶
func Register ¶
func Register(def *QueryRunnerDefinition) error
func RestrictQueryBlock ¶
func RestrictQueryBlock(queryRunnerType string, body hcl.Body) hcl.Diagnostics
func RestrictQueryRunnerBlock ¶
func RestrictQueryRunnerBlock(queryRunnerType string, body hcl.Body) hcl.Diagnostics
func WithQueryRunningContext ¶
func WithQueryRunningContext(ctx context.Context, info *QueryRunningContext) context.Context
Types ¶
type PreparedQuery ¶
type PreparedQuery interface { Name() string Run(ctx context.Context, data interface{}) (*QueryResult, error) }
type QueryResult ¶
func NewEmptyQueryResult ¶
func NewEmptyQueryResult(name string, query string) *QueryResult
func NewQueryResult ¶
func NewQueryResult(name string, query string, columns []string, rows [][]string) *QueryResult
func NewQueryResultWithJSONLines ¶ added in v0.5.0
func NewQueryResultWithJSONLines(name string, query string, lines [][]byte) *QueryResult
func NewQueryResultWithRowsMap ¶ added in v0.6.0
func NewQueryResultWithRowsMap(name, query string, columnsMap map[string]int, rowsMap []map[string]interface{}) *QueryResult
func (*QueryResult) ToJSON ¶ added in v0.5.0
func (qr *QueryResult) ToJSON() string
func (*QueryResult) ToTable ¶
func (qr *QueryResult) ToTable(optFns ...func(*tablewriter.Table)) string
func (*QueryResult) ToVertical ¶
func (qr *QueryResult) ToVertical() string
type QueryRunner ¶
type QueryRunner interface {
Prepare(name string, body hcl.Body, ctx *hcl.EvalContext) (PreparedQuery, hcl.Diagnostics)
}
func NewQueryRunner ¶
func NewQueryRunner(queryRunnerType string, name string, body hcl.Body, ctx *hcl.EvalContext) (QueryRunner, hcl.Diagnostics)
type QueryRunnerDefinition ¶
type QueryRunnerDefinition struct { TypeName string RestrictQueryRunnerBlockFunc func(body hcl.Body) hcl.Diagnostics RestrictQueryBlockFunc func(body hcl.Body) hcl.Diagnostics BuildQueryRunnerFunc func(name string, body hcl.Body, ctx *hcl.EvalContext) (QueryRunner, hcl.Diagnostics) }
type QueryRunningContext ¶
type QueryRunningContext struct { ReqID uint64 // contains filtered or unexported fields }
func GetQueryRunningContext ¶
func GetQueryRunningContext(ctx context.Context) (*QueryRunningContext, bool)
func NewQueryRunningContext ¶
func NewQueryRunningContext(sqsClient *sqs.Client, queueURL string, reqID uint64, message *events.SQSMessage) *QueryRunningContext
func (*QueryRunningContext) ChangeSQSMessageVisibilityTimeout ¶
Click to show internal directories.
Click to hide internal directories.