models

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2020 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QuerySucceeded = "succeeded"
	QueryFailed    = "failed"
	QueryRunning   = "running"
	QueryCancelled = "cancelled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Value *string `json:"value"` // NULL values are nil
	Type  *string `json:"type,omitempty"`
}

type Database

type Database struct {
	DatabaseName string `json:"databaseName" validate:"required"`
}

type ExecuteAsyncQueryInput

type ExecuteAsyncQueryInput struct {
	Database
	SQLQuery
	UserID *string `json:"userId,omitempty"`
}

type ExecuteAsyncQueryNotifyInput

type ExecuteAsyncQueryNotifyInput struct {
	ExecuteAsyncQueryInput
	LambdaInvoke
	UserPassThruData
	DelaySeconds int `json:"delaySeconds"` // wait this long before starting workflow (default 0)
}

type ExecuteAsyncQueryNotifyOutput

type ExecuteAsyncQueryNotifyOutput struct {
	Workflow
}

type ExecuteAsyncQueryOutput

type ExecuteAsyncQueryOutput struct {
	QueryStatus
	QueryInfo
}

type ExecuteQueryInput

type ExecuteQueryInput = ExecuteAsyncQueryInput

Blocking query

type ExecuteQueryOutput

type ExecuteQueryOutput = GetQueryResultsOutput // call GetQueryResults() to page through results

type GetDatabasesInput

type GetDatabasesInput struct {
	OptionalName // if nil get all databases
}

type GetDatabasesOutput

type GetDatabasesOutput struct {
	Databases []*NameAndDescription `json:"databases,omitempty"`
}

NOTE: we will assume this is small an not paginate

type GetQueryResultsInput

type GetQueryResultsInput struct {
	QueryInfo
	Pagination
	PageSize *int64 `json:"pageSize" validate:"omitempty,gt=1,lt=1000"` // only return this many rows per call

}

type GetQueryResultsLinkInput

type GetQueryResultsLinkInput struct {
	QueryInfo
}

type GetQueryResultsLinkOutput

type GetQueryResultsLinkOutput struct {
	QueryStatus
	PresignedLink string `json:"presignedLink"` // presigned s3 link to results
}

type GetQueryResultsOutput

type GetQueryResultsOutput struct {
	GetQueryStatusOutput
	ColumnInfo  []*Column        `json:"columnInfo" validate:"required"`
	ResultsPage QueryResultsPage `json:"resultsPage" validate:"required"`
}

type GetQueryStatusInput

type GetQueryStatusInput = QueryInfo

type GetQueryStatusOutput

type GetQueryStatusOutput struct {
	QueryStatus
	SQLQuery
	Stats *QueryResultsStats `json:"stats,omitempty"` // present only on successful queries
}

type GetTablesDetailInput

type GetTablesDetailInput struct {
	Database
	Names []string `json:"names" validate:"required"`
}

type GetTablesDetailOutput

type GetTablesDetailOutput struct {
	TablesDetail
}

NOTE: we will assume this is small an not paginate

type GetTablesInput

type GetTablesInput struct {
	Database
	IncludePopulatedTablesOnly *bool `json:"includePopulatedTablesOnly,omitempty"` // if true OR nil, return only tables that have data
}

type GetTablesOutput

type GetTablesOutput struct {
	TablesDetail
}

NOTE: we will assume this is small an not paginate

type InvokeNotifyLambdaInput

type InvokeNotifyLambdaInput struct {
	LambdaInvoke
	QueryInfo
	Workflow
	UserPassThruData
}

type InvokeNotifyLambdaOutput

type InvokeNotifyLambdaOutput = InvokeNotifyLambdaInput // so input can be confirmed

type LambdaInput

type LambdaInput struct {
	// run a query, returning immediately with an id for the running query
	ExecuteAsyncQuery *ExecuteAsyncQueryInput `json:"executeAsyncQuery"`
	// run a query, returning immediately with an id for the step function running the query (will invoke lambda callback when done)
	ExecuteAsyncQueryNotify *ExecuteAsyncQueryNotifyInput `json:"executeAsyncQueryNotify"`
	// run a query, waiting for results
	ExecuteQuery *ExecuteQueryInput `json:"executeQuery"`
	// list databases
	GetDatabases *GetDatabasesInput `json:"getDatabases"`
	// given a query id, return paged results
	GetQueryResults *GetQueryResultsInput `json:"getQueryResults"`
	// given a query id, return a presigned s3 link to the results
	GetQueryResultsLink *GetQueryResultsLinkInput `json:"getQueryResultsLink"`
	// given a query id, return the status of the query
	GetQueryStatus *GetQueryStatusInput `json:"getQueryStatus"`
	// given a database, list tables
	GetTables *GetTablesInput `json:"getTables"`
	// given a database and list of tables, return tables
	GetTablesDetail *GetTablesDetailInput `json:"getTablesDetail"`
	// given a lambda and method, execute callback for step function
	InvokeNotifyLambda *InvokeNotifyLambdaInput `json:"invokeNotifyLambda"`
	// used as a callback lambda, will notify appsync that a UI query is complete
	NotifyAppSync *NotifyAppSyncInput `json:"notifyAppSync"`
	// given a query id, cancel query
	StopQuery *StopQueryInput `json:"stopQuery"`
}

LambdaInput is the collection of all possible args to the Lambda function.

type LambdaInvoke

type LambdaInvoke struct {
	LambdaName string `json:"lambdaName" validate:"required"` // the name of the lambda to call when done
	MethodName string `json:"methodName" validate:"required"` // the method to call on the lambda
}

type NameAndDescription

type NameAndDescription struct {
	Name        string  `json:"name" validate:"required"`
	Description *string `json:"description,omitempty"`
}

type NotifyAppSyncInput

type NotifyAppSyncInput struct {
	NotifyInput
}

type NotifyAppSyncOutput

type NotifyAppSyncOutput struct {
	StatusCode int `json:"statusCode" validate:"required"` // the http status returned from POSTing callback to appsync
}

type OptionalName

type OptionalName struct {
	Name *string `json:"name,omitempty"`
}

type Pagination

type Pagination struct {
	PaginationToken *string `json:"paginationToken,omitempty"`
}

type QueryInfo

type QueryInfo struct {
	QueryID string `json:"queryId" validate:"required"`
}

type QueryResultsPage

type QueryResultsPage struct {
	Pagination
	NumRows int    `json:"numRows"  validate:"required"` // number of rows in page of results, len(Rows)
	Rows    []*Row `json:"rows"  validate:"required"`
}

type QueryResultsStats

type QueryResultsStats struct {
	ExecutionTimeMilliseconds int64 `json:"executionTimeMilliseconds"  validate:"required"`
	DataScannedBytes          int64 `json:"dataScannedBytes"  validate:"required"`
}

type QueryStatus

type QueryStatus struct {
	Status   string `json:"status" validate:"required,oneof=running,succeeded,failed,canceled"`
	SQLError string `json:"sqlError,omitempty"`
}

type Row

type Row struct {
	Columns []*Column `json:"columns" validate:"required"`
}

type SQLQuery

type SQLQuery struct {
	SQL string `json:"sql" validate:"required"`
}

type StopQueryInput

type StopQueryInput = QueryInfo

type StopQueryOutput

type StopQueryOutput = GetQueryStatusOutput

type TableColumn

type TableColumn struct {
	NameAndDescription
	Type string `json:"type" validate:"required"`
}

type TableDescription

type TableDescription struct {
	Database
	NameAndDescription
}

type TableDetail

type TableDetail struct {
	TableDescription
	Columns []*TableColumn `json:"columns"`
}

type TablesDetail

type TablesDetail struct {
	Tables []*TableDetail `json:"tables"`
}

type UserPassThruData

type UserPassThruData struct {
	UserData string `json:"userData" validate:"required,gt=0"` // token passed though to notifications (usually the userid)
}

type Workflow

type Workflow struct {
	WorkflowID string `json:"workflowId" validate:"required"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL