Documentation
¶
Index ¶
- type AthenaService
- func (s *AthenaService) Actions() []service.Action
- func (s *AthenaService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
- func (s *AthenaService) HealthCheck() error
- func (s *AthenaService) Name() string
- func (s *AthenaService) RegisterSchema(database, table string, columns []string)
- func (s *AthenaService) SetLocator(locator ServiceLocator)
- type ColumnInfo
- type DataCatalog
- type NamedQuery
- type QueryExecution
- type QueryExecutionStatistics
- type QueryExecutionStatus
- type QueryResultSet
- type ResultConfiguration
- type ServiceLocator
- type Store
- func (s *Store) BatchGetNamedQuery(ids []string) ([]*NamedQuery, []string)
- func (s *Store) BatchGetQueryExecution(ids []string) ([]*QueryExecution, []string)
- func (s *Store) CreateDataCatalog(name, catalogType, description string, params, tags map[string]string) (*DataCatalog, bool)
- func (s *Store) CreateNamedQuery(name, description, database, queryString, workGroup string) *NamedQuery
- func (s *Store) CreateWorkGroup(name, description string, tags map[string]string, ...) (*WorkGroup, bool)
- func (s *Store) DeleteDataCatalog(name string) bool
- func (s *Store) DeleteNamedQuery(id string) bool
- func (s *Store) DeleteWorkGroup(name string) bool
- func (s *Store) GetDataCatalog(name string) (*DataCatalog, bool)
- func (s *Store) GetNamedQuery(id string) (*NamedQuery, bool)
- func (s *Store) GetQueryExecution(id string) (*QueryExecution, bool)
- func (s *Store) GetQueryResultSet(executionID string) (*QueryResultSet, bool)
- func (s *Store) GetWorkGroup(name string) (*WorkGroup, bool)
- func (s *Store) ListDataCatalogs() []*DataCatalog
- func (s *Store) ListNamedQueries(workGroup string) []string
- func (s *Store) ListQueryExecutions(workGroup string) []string
- func (s *Store) ListTagsForResource(arn string) (map[string]string, bool)
- func (s *Store) ListWorkGroups() []*WorkGroup
- func (s *Store) SetLocator(locator ServiceLocator)
- func (s *Store) StartQueryExecution(query, database, workGroup, outputLocation string) *QueryExecution
- func (s *Store) StopQueryExecution(id string) bool
- func (s *Store) TagResource(arn string, tags map[string]string) bool
- func (s *Store) UntagResource(arn string, keys []string) bool
- func (s *Store) UpdateDataCatalog(name, description string, params map[string]string) bool
- func (s *Store) UpdateWorkGroup(name, description, state string) (*WorkGroup, bool)
- type WorkGroup
- type WorkGroupConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AthenaService ¶
type AthenaService struct {
// contains filtered or unexported fields
}
AthenaService is the cloudmock implementation of the AWS Athena API.
func New ¶
func New(accountID, region string) *AthenaService
New returns a new AthenaService for the given AWS account ID and region.
func (*AthenaService) Actions ¶
func (s *AthenaService) Actions() []service.Action
Actions returns the list of Athena API actions supported by this service.
func (*AthenaService) HandleRequest ¶
func (s *AthenaService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
HandleRequest routes an incoming Athena request to the appropriate handler.
func (*AthenaService) HealthCheck ¶
func (s *AthenaService) HealthCheck() error
HealthCheck always returns nil (no external dependencies).
func (*AthenaService) Name ¶
func (s *AthenaService) Name() string
Name returns the AWS service name used for routing.
func (*AthenaService) RegisterSchema ¶
func (s *AthenaService) RegisterSchema(database, table string, columns []string)
RegisterSchema registers a table schema for SQL validation.
func (*AthenaService) SetLocator ¶
func (s *AthenaService) SetLocator(locator ServiceLocator)
SetLocator sets the service locator for cross-service lookups (e.g., Glue catalog).
type ColumnInfo ¶
ColumnInfo describes a result column.
type DataCatalog ¶
type DataCatalog struct {
Name string
Type string // LAMBDA, GLUE, HIVE
Description string
Parameters map[string]string
Tags map[string]string
}
DataCatalog represents an Athena data catalog.
type NamedQuery ¶
type NamedQuery struct {
ID string
Name string
Description string
Database string
QueryString string
WorkGroup string
}
NamedQuery represents an Athena named query.
type QueryExecution ¶
type QueryExecution struct {
ID string
Query string
Database string
WorkGroup string
Status QueryExecutionStatus
ResultConfig ResultConfiguration
Statistics QueryExecutionStatistics
SubmissionTime time.Time
}
QueryExecution represents a running or completed query.
type QueryExecutionStatistics ¶
type QueryExecutionStatistics struct {
EngineExecutionTimeInMillis int64
DataScannedInBytes int64
TotalExecutionTimeInMillis int64
}
QueryExecutionStatistics holds execution stats.
type QueryExecutionStatus ¶
type QueryExecutionStatus struct {
State string // QUEUED, RUNNING, SUCCEEDED, FAILED, CANCELLED
StateChangeReason string
SubmissionTime time.Time
CompletionTime *time.Time
}
QueryExecutionStatus holds query state.
type QueryResultSet ¶
type QueryResultSet struct {
ColumnInfo []ColumnInfo
Rows [][]string
}
QueryResultSet holds mock query results for a completed execution.
type ResultConfiguration ¶
type ResultConfiguration struct {
OutputLocation string
}
ResultConfiguration holds result output settings.
type ServiceLocator ¶
ServiceLocator resolves other services by name.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages all Athena resources in memory.
func (*Store) BatchGetNamedQuery ¶
func (s *Store) BatchGetNamedQuery(ids []string) ([]*NamedQuery, []string)
BatchGetNamedQuery returns multiple named queries by ID.
func (*Store) BatchGetQueryExecution ¶
func (s *Store) BatchGetQueryExecution(ids []string) ([]*QueryExecution, []string)
BatchGetQueryExecution returns multiple query executions by ID.
func (*Store) CreateDataCatalog ¶
func (s *Store) CreateDataCatalog(name, catalogType, description string, params, tags map[string]string) (*DataCatalog, bool)
CreateDataCatalog creates a new data catalog. Returns false if already exists.
func (*Store) CreateNamedQuery ¶
func (s *Store) CreateNamedQuery(name, description, database, queryString, workGroup string) *NamedQuery
CreateNamedQuery creates a named query. Returns the query ID.
func (*Store) CreateWorkGroup ¶
func (s *Store) CreateWorkGroup(name, description string, tags map[string]string, config WorkGroupConfiguration) (*WorkGroup, bool)
CreateWorkGroup creates a new workgroup. Returns false if it already exists.
func (*Store) DeleteDataCatalog ¶
DeleteDataCatalog deletes a data catalog. Returns false if not found.
func (*Store) DeleteNamedQuery ¶
DeleteNamedQuery deletes a named query. Returns false if not found.
func (*Store) DeleteWorkGroup ¶
DeleteWorkGroup deletes a workgroup. Returns false if not found.
func (*Store) GetDataCatalog ¶
func (s *Store) GetDataCatalog(name string) (*DataCatalog, bool)
GetDataCatalog returns a data catalog by name.
func (*Store) GetNamedQuery ¶
func (s *Store) GetNamedQuery(id string) (*NamedQuery, bool)
GetNamedQuery returns a named query by ID.
func (*Store) GetQueryExecution ¶
func (s *Store) GetQueryExecution(id string) (*QueryExecution, bool)
GetQueryExecution returns a query execution by ID.
func (*Store) GetQueryResultSet ¶
func (s *Store) GetQueryResultSet(executionID string) (*QueryResultSet, bool)
GetQueryResultSet returns mock results for a completed query execution.
func (*Store) GetWorkGroup ¶
GetWorkGroup returns a workgroup by name.
func (*Store) ListDataCatalogs ¶
func (s *Store) ListDataCatalogs() []*DataCatalog
ListDataCatalogs returns all data catalogs.
func (*Store) ListNamedQueries ¶
ListNamedQueries returns all named query IDs, optionally filtered by workgroup.
func (*Store) ListQueryExecutions ¶
ListQueryExecutions returns all query execution IDs, optionally filtered by workgroup.
func (*Store) ListTagsForResource ¶
ListTagsForResource returns tags for the given resource ARN.
func (*Store) ListWorkGroups ¶
ListWorkGroups returns all workgroups.
func (*Store) SetLocator ¶
func (s *Store) SetLocator(locator ServiceLocator)
SetLocator sets the service locator for cross-service lookups.
func (*Store) StartQueryExecution ¶
func (s *Store) StartQueryExecution(query, database, workGroup, outputLocation string) *QueryExecution
StartQueryExecution creates a new query execution, parses and validates the SQL, and generates mock results for SELECT queries.
func (*Store) StopQueryExecution ¶
StopQueryExecution cancels a query execution.
func (*Store) TagResource ¶
TagResource adds tags to a workgroup ARN.
func (*Store) UntagResource ¶
UntagResource removes tag keys from a workgroup ARN.
func (*Store) UpdateDataCatalog ¶
UpdateDataCatalog updates a data catalog's description and parameters.
type WorkGroup ¶
type WorkGroup struct {
Name string
Description string
State string // ENABLED or DISABLED
CreationTime time.Time
Tags map[string]string
Configuration WorkGroupConfiguration
}
WorkGroup represents an Athena workgroup.
type WorkGroupConfiguration ¶
type WorkGroupConfiguration struct {
ResultOutputLocation string
EnforceWorkGroupConfiguration bool
BytesScannedCutoffPerQuery int64
}
WorkGroupConfiguration holds workgroup settings.