Documentation
¶
Overview ¶
Package kinesisanalyticsv2 provides an in-memory stub of AWS Kinesis Data Analytics v2.
Index ¶
- Constants
- Variables
- type Application
- type ApplicationOperation
- type ApplicationVersionSummary
- type CloudWatchLoggingOptionDesc
- type DestinationSchemaDesc
- type DiscoveredSchema
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AccountID() string
- func (b *InMemoryBackend) AddApplicationCloudWatchLoggingOption(ctx context.Context, name string, currentVersionID int64, ...) error
- func (b *InMemoryBackend) AddApplicationInput(ctx context.Context, name string, currentVersionID int64, ...) error
- func (b *InMemoryBackend) AddApplicationInputProcessingConfiguration(ctx context.Context, name string, currentVersionID int64, inputID string, ...) error
- func (b *InMemoryBackend) AddApplicationInternal(ctx context.Context, app *Application)
- func (b *InMemoryBackend) AddApplicationOutput(ctx context.Context, name string, currentVersionID int64, ...) error
- func (b *InMemoryBackend) AddApplicationReferenceDataSource(ctx context.Context, name string, currentVersionID int64, ...) error
- func (b *InMemoryBackend) AddApplicationVpcConfiguration(ctx context.Context, name string, currentVersionID int64, ...) error
- func (b *InMemoryBackend) CreateApplication(ctx context.Context, name, runtimeEnv, serviceRole, description, mode string, ...) (*Application, error)
- func (b *InMemoryBackend) CreateApplicationSnapshot(ctx context.Context, appName, snapshotName string) (*Snapshot, error)
- func (b *InMemoryBackend) DeleteApplication(ctx context.Context, name string) error
- func (b *InMemoryBackend) DeleteApplicationCloudWatchLoggingOption(ctx context.Context, name string, currentVersionID int64, ...) error
- func (b *InMemoryBackend) DeleteApplicationInputProcessingConfiguration(ctx context.Context, name string, currentVersionID int64, inputID string) error
- func (b *InMemoryBackend) DeleteApplicationOutput(ctx context.Context, name string, currentVersionID int64, outputID string) error
- func (b *InMemoryBackend) DeleteApplicationReferenceDataSource(ctx context.Context, name string, currentVersionID int64, referenceID string) error
- func (b *InMemoryBackend) DeleteApplicationSnapshot(ctx context.Context, appName, snapshotName string) error
- func (b *InMemoryBackend) DeleteApplicationVpcConfiguration(ctx context.Context, name string, currentVersionID int64, ...) error
- func (b *InMemoryBackend) DescribeApplication(ctx context.Context, name string) (*Application, error)
- func (b *InMemoryBackend) DescribeApplicationOperation(ctx context.Context, name, operationID string) (*ApplicationOperation, error)
- func (b *InMemoryBackend) DescribeApplicationSnapshot(ctx context.Context, appName, snapshotName string) (*Snapshot, error)
- func (b *InMemoryBackend) DescribeApplicationVersion(ctx context.Context, name string, versionID int64) (*Application, error)
- func (b *InMemoryBackend) DiscoverInputSchema(_ context.Context, resourceARN, _, _ string) (*DiscoveredSchema, error)
- func (b *InMemoryBackend) GenerateApplicationARN(name string) string
- func (b *InMemoryBackend) ListApplicationOperations(ctx context.Context, name, nextToken string) ([]*ApplicationOperation, string, error)
- func (b *InMemoryBackend) ListApplicationSnapshots(ctx context.Context, appName, nextToken string) ([]*Snapshot, string, error)
- func (b *InMemoryBackend) ListApplicationVersions(ctx context.Context, name, nextToken string) ([]*ApplicationVersionSummary, string, error)
- func (b *InMemoryBackend) ListApplications(ctx context.Context, nextToken string) ([]*Application, string)
- func (b *InMemoryBackend) ListTagsForResource(_ context.Context, resourceARN string) ([]Tag, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RollbackApplication(ctx context.Context, name string, currentVersionID int64) (*Application, string, error)
- func (b *InMemoryBackend) SeedApplicationConfiguration(ctx context.Context, name string, inputs []InputDescription, ...) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartApplication(ctx context.Context, name string) (string, error)
- func (b *InMemoryBackend) StopApplication(ctx context.Context, name string) (string, error)
- func (b *InMemoryBackend) TagResource(_ context.Context, resourceARN string, tags []Tag) error
- func (b *InMemoryBackend) UntagResource(_ context.Context, resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateApplication(ctx context.Context, name string, currentVersionID int64, ...) (*Application, string, error)
- func (b *InMemoryBackend) UpdateApplicationMaintenanceConfiguration(ctx context.Context, name string, maintenanceWindowStartTime string) (*Application, error)
- type InputDescription
- type InputProcessingConfigurationDesc
- type KinesisFirehoseInputDesc
- type KinesisFirehoseOutputDesc
- type KinesisStreamsInputDesc
- type KinesisStreamsOutputDesc
- type LambdaOutputDesc
- type LambdaProcessorDesc
- type OutputDescription
- type Provider
- type ReferenceDataSourceDescription
- type S3ReferenceDataSourceDesc
- type Snapshot
- type StorageBackend
- type Tag
- type VpcConfigurationDescription
Constants ¶
const ( // ApplicationStatusReady indicates a running application that is ready. ApplicationStatusReady = "READY" // ApplicationStatusRunning indicates a running application. ApplicationStatusRunning = "RUNNING" // ApplicationStatusDeleting indicates an application being deleted. ApplicationStatusDeleting = "DELETING" )
const OperationStatusSuccessful = "SUCCESSFUL"
OperationStatusSuccessful is the real Kinesis Analytics v2 OperationStatus enum value ("SUCCESSFUL", not "SUCCESS") for a completed operation. gopherstack applies application-lifecycle operations (Start/Stop/UpdateApplication/RollbackApplication) synchronously, so every recorded operation goes straight to SUCCESSFUL -- there is no IN_PROGRESS window to observe via DescribeApplicationOperation/ListApplicationOperations.
Variables ¶
var ( // ErrNotFound is returned when a requested resource does not exist. ErrNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrAlreadyExists is returned when a resource already exists. ErrAlreadyExists = awserr.New("ResourceInUseException", awserr.ErrAlreadyExists) // ErrConcurrentModification is returned when the application version does not match. ErrConcurrentModification = awserr.New( "ConcurrentModificationException", awserr.ErrInvalidParameter, ) // ErrValidation is returned for invalid input parameters. ErrValidation = awserr.New("InvalidArgumentException", awserr.ErrInvalidParameter) )
var ErrNilAppContext = errors.New("kinesisanalyticsv2: AppContext must not be nil")
ErrNilAppContext is returned by Provider.Init when a nil AppContext is supplied.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
CreatedAt time.Time `json:"-"`
ApplicationARN string `json:"ApplicationARN"`
ApplicationName string `json:"ApplicationName"`
ApplicationStatus string `json:"ApplicationStatus"`
RuntimeEnvironment string `json:"RuntimeEnvironment"`
ServiceExecutionRole string `json:"ServiceExecutionRole,omitempty"`
ApplicationDescription string `json:"ApplicationDescription,omitempty"`
ApplicationMode string `json:"ApplicationMode,omitempty"`
MaintenanceWindowStartTime string `json:"MaintenanceWindowStartTime,omitempty"`
// Region is the owning region, used only to derive the store.Table
// composite key (region#name) and the byRegion index -- ApplicationName
// alone is only unique within a region, matching the pre-Phase-3.3
// nested map[region]map[name]*Application layout. Never serialized on the
// wire: handler.go always builds a dedicated response DTO
// (applicationDetailOutput/applicationSummary), never marshals Application
// directly.
Region string `json:"-"`
Tags []Tag `json:"-"`
CloudWatchLoggingOptionDescs []CloudWatchLoggingOptionDesc `json:"-"`
InputDescriptions []InputDescription `json:"-"`
OutputDescriptions []OutputDescription `json:"-"`
ReferenceDataSourceDescriptions []ReferenceDataSourceDescription `json:"-"`
VpcConfigurationDescriptions []VpcConfigurationDescription `json:"-"`
ApplicationVersionID int64 `json:"ApplicationVersionId"`
}
Application represents a Kinesis Data Analytics v2 application.
type ApplicationOperation ¶
type ApplicationOperation struct {
StartTimestamp time.Time `json:"-"`
EndTimestamp time.Time `json:"-"`
OperationID string `json:"OperationId"`
ApplicationName string `json:"ApplicationName"`
Operation string `json:"Operation"`
OperationStatus string `json:"OperationStatus"`
}
ApplicationOperation represents a single KDA v2 application operation record.
type ApplicationVersionSummary ¶
type ApplicationVersionSummary struct {
ApplicationStatus string `json:"ApplicationStatus"`
ApplicationVersionID int64 `json:"ApplicationVersionId"`
}
ApplicationVersionSummary is a compact view of an application version.
type CloudWatchLoggingOptionDesc ¶
type CloudWatchLoggingOptionDesc struct {
CloudWatchLoggingOptionID string `json:"CloudWatchLoggingOptionId"`
LogStreamARN string `json:"LogStreamARN"`
RoleARN string `json:"RoleARN,omitempty"`
}
CloudWatchLoggingOptionDesc describes a CloudWatch logging option.
type DestinationSchemaDesc ¶
type DestinationSchemaDesc struct {
RecordFormatType string `json:"RecordFormatType"`
}
DestinationSchemaDesc describes the destination record format.
type DiscoveredSchema ¶
type DiscoveredSchema struct {
RecordFormat string `json:"RecordFormat"`
RecordEncoding string `json:"RecordEncoding,omitempty"`
ParsedInputRecords [][]string `json:"ParsedInputRecords,omitempty"`
}
DiscoveredSchema holds the inferred schema from DiscoverInputSchema.
type Handler ¶
type Handler struct {
Backend StorageBackend
// contains filtered or unexported fields
}
Handler is the HTTP handler for the Kinesis Data Analytics v2 JSON API.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new Kinesis Data Analytics v2 handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the operation name from the X-Amz-Target header.
func (*Handler) ExtractResource ¶
ExtractResource extracts the application name from the request body.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for Kinesis Data Analytics v2 requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) Reset ¶
func (h *Handler) Reset()
Reset clears handler state by delegating to the backend if it supports it.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches Kinesis Data Analytics v2 requests. The SDK uses X-Amz-Target: KinesisAnalytics_20180523.{Operation} with POST to /.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend stores Kinesis Data Analytics v2 state in memory.
applications and snapshots are store.Table-backed (Phase 3.3); see store_setup.go for the composite keys and secondary indexes that replace the pre-Phase-3.3 nested map[region]map[name]* layout. operations and versions are left as plain nested maps of slices: both are order-sensitive append histories (versions is read by positional index in RollbackApplication; operations is returned in insertion order with no explicit sort), and store.Index does not preserve insertion order, so neither fits a store.Table+Index conversion -- see pkgs/store's package doc and .claude/memories/pkgs-catalog.md. Neither was persisted before this conversion and neither is persisted after it (see persistence.go).
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates a new in-memory Kinesis Data Analytics v2 backend.
func (*InMemoryBackend) AccountID ¶
func (b *InMemoryBackend) AccountID() string
AccountID returns the backend account ID.
func (*InMemoryBackend) AddApplicationCloudWatchLoggingOption ¶
func (b *InMemoryBackend) AddApplicationCloudWatchLoggingOption( ctx context.Context, name string, currentVersionID int64, logStreamARN, roleARN string, ) error
AddApplicationCloudWatchLoggingOption adds a CloudWatch logging option to an application.
func (*InMemoryBackend) AddApplicationInput ¶
func (b *InMemoryBackend) AddApplicationInput( ctx context.Context, name string, currentVersionID int64, input InputDescription, ) error
AddApplicationInput adds an input configuration to an application.
func (*InMemoryBackend) AddApplicationInputProcessingConfiguration ¶
func (b *InMemoryBackend) AddApplicationInputProcessingConfiguration( ctx context.Context, name string, currentVersionID int64, inputID string, config *InputProcessingConfigurationDesc, ) error
AddApplicationInputProcessingConfiguration sets a processing config on an existing input.
func (*InMemoryBackend) AddApplicationInternal ¶
func (b *InMemoryBackend) AddApplicationInternal(ctx context.Context, app *Application)
AddApplicationInternal is a test-only seed helper that stores an application directly.
func (*InMemoryBackend) AddApplicationOutput ¶
func (b *InMemoryBackend) AddApplicationOutput( ctx context.Context, name string, currentVersionID int64, output OutputDescription, ) error
AddApplicationOutput adds an output configuration to an application.
func (*InMemoryBackend) AddApplicationReferenceDataSource ¶
func (b *InMemoryBackend) AddApplicationReferenceDataSource( ctx context.Context, name string, currentVersionID int64, ref ReferenceDataSourceDescription, ) error
AddApplicationReferenceDataSource adds a reference data source to an application.
func (*InMemoryBackend) AddApplicationVpcConfiguration ¶
func (b *InMemoryBackend) AddApplicationVpcConfiguration( ctx context.Context, name string, currentVersionID int64, vpc VpcConfigurationDescription, ) error
AddApplicationVpcConfiguration adds a VPC configuration to an application.
func (*InMemoryBackend) CreateApplication ¶
func (b *InMemoryBackend) CreateApplication( ctx context.Context, name, runtimeEnv, serviceRole, description, mode string, tags []Tag, ) (*Application, error)
CreateApplication creates a new Kinesis Data Analytics v2 application.
func (*InMemoryBackend) CreateApplicationSnapshot ¶
func (b *InMemoryBackend) CreateApplicationSnapshot( ctx context.Context, appName, snapshotName string, ) (*Snapshot, error)
CreateApplicationSnapshot creates a snapshot for an application.
func (*InMemoryBackend) DeleteApplication ¶
func (b *InMemoryBackend) DeleteApplication(ctx context.Context, name string) error
DeleteApplication deletes an application by name.
func (*InMemoryBackend) DeleteApplicationCloudWatchLoggingOption ¶
func (b *InMemoryBackend) DeleteApplicationCloudWatchLoggingOption( ctx context.Context, name string, currentVersionID int64, loggingOptionID string, ) error
DeleteApplicationCloudWatchLoggingOption removes a CloudWatch logging option from an application.
func (*InMemoryBackend) DeleteApplicationInputProcessingConfiguration ¶
func (b *InMemoryBackend) DeleteApplicationInputProcessingConfiguration( ctx context.Context, name string, currentVersionID int64, inputID string, ) error
DeleteApplicationInputProcessingConfiguration removes the processing config from an input.
func (*InMemoryBackend) DeleteApplicationOutput ¶
func (b *InMemoryBackend) DeleteApplicationOutput( ctx context.Context, name string, currentVersionID int64, outputID string, ) error
DeleteApplicationOutput removes an output configuration from an application.
func (*InMemoryBackend) DeleteApplicationReferenceDataSource ¶
func (b *InMemoryBackend) DeleteApplicationReferenceDataSource( ctx context.Context, name string, currentVersionID int64, referenceID string, ) error
DeleteApplicationReferenceDataSource removes a reference data source from an application.
func (*InMemoryBackend) DeleteApplicationSnapshot ¶
func (b *InMemoryBackend) DeleteApplicationSnapshot(ctx context.Context, appName, snapshotName string) error
DeleteApplicationSnapshot deletes a snapshot.
func (*InMemoryBackend) DeleteApplicationVpcConfiguration ¶
func (b *InMemoryBackend) DeleteApplicationVpcConfiguration( ctx context.Context, name string, currentVersionID int64, vpcConfigurationID string, ) error
DeleteApplicationVpcConfiguration removes a VPC configuration from an application.
func (*InMemoryBackend) DescribeApplication ¶
func (b *InMemoryBackend) DescribeApplication(ctx context.Context, name string) (*Application, error)
DescribeApplication retrieves an application by name. Returns a deep copy so callers cannot mutate internal state.
func (*InMemoryBackend) DescribeApplicationOperation ¶
func (b *InMemoryBackend) DescribeApplicationOperation( ctx context.Context, name, operationID string, ) (*ApplicationOperation, error)
DescribeApplicationOperation returns a single operation by ID.
func (*InMemoryBackend) DescribeApplicationSnapshot ¶
func (b *InMemoryBackend) DescribeApplicationSnapshot( ctx context.Context, appName, snapshotName string, ) (*Snapshot, error)
DescribeApplicationSnapshot retrieves a snapshot by application name and snapshot name.
func (*InMemoryBackend) DescribeApplicationVersion ¶
func (b *InMemoryBackend) DescribeApplicationVersion( ctx context.Context, name string, versionID int64, ) (*Application, error)
DescribeApplicationVersion returns the application state at a specific version ID.
func (*InMemoryBackend) DiscoverInputSchema ¶
func (b *InMemoryBackend) DiscoverInputSchema( _ context.Context, resourceARN, _, _ string, ) (*DiscoveredSchema, error)
DiscoverInputSchema returns a synthetic discovered schema for a resource ARN.
func (*InMemoryBackend) GenerateApplicationARN ¶
func (b *InMemoryBackend) GenerateApplicationARN(name string) string
GenerateApplicationARN exposes the ARN builder for testing.
func (*InMemoryBackend) ListApplicationOperations ¶
func (b *InMemoryBackend) ListApplicationOperations( ctx context.Context, name, nextToken string, ) ([]*ApplicationOperation, string, error)
ListApplicationOperations returns operations for an application with optional pagination.
func (*InMemoryBackend) ListApplicationSnapshots ¶
func (b *InMemoryBackend) ListApplicationSnapshots( ctx context.Context, appName, nextToken string, ) ([]*Snapshot, string, error)
ListApplicationSnapshots returns snapshots for an application with optional pagination, sorted by creation time.
func (*InMemoryBackend) ListApplicationVersions ¶
func (b *InMemoryBackend) ListApplicationVersions( ctx context.Context, name, nextToken string, ) ([]*ApplicationVersionSummary, string, error)
ListApplicationVersions returns version summaries for an application.
func (*InMemoryBackend) ListApplications ¶
func (b *InMemoryBackend) ListApplications(ctx context.Context, nextToken string) ([]*Application, string)
ListApplications returns applications with optional pagination.
func (*InMemoryBackend) ListTagsForResource ¶
ListTagsForResource returns tags for an application, sorted by key.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the backend default region.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all state and resets the ID counter.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot.
func (*InMemoryBackend) RollbackApplication ¶
func (b *InMemoryBackend) RollbackApplication( ctx context.Context, name string, currentVersionID int64, ) (*Application, string, error)
RollbackApplication rolls back an application to its previous version, returning the OperationID of the recorded RollbackApplication operation (see recordOperation).
func (*InMemoryBackend) SeedApplicationConfiguration ¶
func (b *InMemoryBackend) SeedApplicationConfiguration( ctx context.Context, name string, inputs []InputDescription, outputs []OutputDescription, refDataSources []ReferenceDataSourceDescription, vpcConfigs []VpcConfigurationDescription, cwlOptions []CloudWatchLoggingOptionDesc, ) error
SeedApplicationConfiguration sets a newly created application's initial input/output/reference-data-source/VPC/CloudWatch-logging configuration in one step, without bumping ApplicationVersionId or appending a second version-history entry -- this mirrors real AWS, where CreateApplication's inline ApplicationConfiguration is part of the application's first version (ApplicationVersionId stays 1), unlike the separately-versioned Add* operations. Callers (handleCreateApplication) must invoke this immediately after CreateApplication succeeds, before the new application is exposed to any other caller. Returns ErrNotFound if name doesn't exist.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON.
func (*InMemoryBackend) StartApplication ¶
StartApplication sets the application status to RUNNING and returns the OperationID of the recorded StartApplication operation (see recordOperation). Returns ResourceInUseException if the application is not in READY state, matching real AWS Kinesis Analytics v2 behavior.
func (*InMemoryBackend) StopApplication ¶
StopApplication sets the application status to READY and returns the OperationID of the recorded StopApplication operation (see recordOperation). Returns ResourceInUseException if the application is not in RUNNING state, matching real AWS Kinesis Analytics v2 behavior.
func (*InMemoryBackend) TagResource ¶
TagResource adds tags to an application.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(_ context.Context, resourceARN string, tagKeys []string) error
UntagResource removes tags from an application.
func (*InMemoryBackend) UpdateApplication ¶
func (b *InMemoryBackend) UpdateApplication( ctx context.Context, name string, currentVersionID int64, serviceRole, description string, ) (*Application, string, error)
UpdateApplication updates an application's description and service role, returning the OperationID of the recorded UpdateApplication operation (see recordOperation). currentVersionID implements the optimistic-concurrency check real AWS performs via CurrentApplicationVersionId (a zero/negative value skips the check, matching checkAndBumpVersion's convention for the Add*/Delete* config ops elsewhere in this package).
func (*InMemoryBackend) UpdateApplicationMaintenanceConfiguration ¶
func (b *InMemoryBackend) UpdateApplicationMaintenanceConfiguration( ctx context.Context, name string, maintenanceWindowStartTime string, ) (*Application, error)
UpdateApplicationMaintenanceConfiguration sets the maintenance window start time.
type InputDescription ¶
type InputDescription struct {
InputProcessingConfigurationDescription *InputProcessingConfigurationDesc `json:"InputProcessingConfigurationDescription,omitempty"` //nolint:lll // AWS API name
KinesisStreamsInputDescription *KinesisStreamsInputDesc `json:"KinesisStreamsInputDescription,omitempty"` //nolint:lll // AWS API name
KinesisFirehoseInputDescription *KinesisFirehoseInputDesc `json:"KinesisFirehoseInputDescription,omitempty"` //nolint:lll // AWS API name
InputID string `json:"InputId"`
NamePrefix string `json:"NamePrefix,omitempty"`
}
InputDescription describes an application input configuration.
type InputProcessingConfigurationDesc ¶
type InputProcessingConfigurationDesc struct {
InputLambdaProcessor *LambdaProcessorDesc `json:"InputLambdaProcessor,omitempty"`
}
InputProcessingConfigurationDesc describes an input processing configuration.
type KinesisFirehoseInputDesc ¶
type KinesisFirehoseInputDesc struct {
ResourceARN string `json:"ResourceARN"`
RoleARN string `json:"RoleARN,omitempty"`
}
KinesisFirehoseInputDesc describes a Kinesis Firehose input.
type KinesisFirehoseOutputDesc ¶
type KinesisFirehoseOutputDesc struct {
ResourceARN string `json:"ResourceARN"`
}
KinesisFirehoseOutputDesc describes a Kinesis Firehose output.
type KinesisStreamsInputDesc ¶
type KinesisStreamsInputDesc struct {
ResourceARN string `json:"ResourceARN"`
RoleARN string `json:"RoleARN,omitempty"`
}
KinesisStreamsInputDesc describes a Kinesis Streams input.
type KinesisStreamsOutputDesc ¶
type KinesisStreamsOutputDesc struct {
ResourceARN string `json:"ResourceARN"`
}
KinesisStreamsOutputDesc describes a Kinesis Streams output.
type LambdaOutputDesc ¶
type LambdaOutputDesc struct {
ResourceARN string `json:"ResourceARN"`
}
LambdaOutputDesc describes a Lambda output.
type LambdaProcessorDesc ¶
type LambdaProcessorDesc struct {
ResourceARN string `json:"ResourceARN"`
}
LambdaProcessorDesc describes a Lambda input processor.
type OutputDescription ¶
type OutputDescription struct {
KinesisStreamsOutputDescription *KinesisStreamsOutputDesc `json:"KinesisStreamsOutputDescription,omitempty"`
KinesisFirehoseOutputDescription *KinesisFirehoseOutputDesc `json:"KinesisFirehoseOutputDescription,omitempty"`
LambdaOutputDescription *LambdaOutputDesc `json:"LambdaOutputDescription,omitempty"`
DestinationSchema *DestinationSchemaDesc `json:"DestinationSchema,omitempty"`
OutputID string `json:"OutputId"`
Name string `json:"Name,omitempty"`
}
OutputDescription describes an application output configuration.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for Kinesis Data Analytics v2.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the Kinesis Data Analytics v2 backend and handler.
type ReferenceDataSourceDescription ¶
type ReferenceDataSourceDescription struct {
S3ReferenceDataSourceDescription *S3ReferenceDataSourceDesc `json:"S3ReferenceDataSourceDescription,omitempty"`
ReferenceID string `json:"ReferenceId"`
TableName string `json:"TableName,omitempty"`
}
ReferenceDataSourceDescription describes a reference data source.
type S3ReferenceDataSourceDesc ¶
type S3ReferenceDataSourceDesc struct {
BucketARN string `json:"BucketARN"`
FileKey string `json:"FileKey"`
}
S3ReferenceDataSourceDesc describes the S3 source for reference data.
type Snapshot ¶
type Snapshot struct {
SnapshotCreation time.Time `json:"-"`
ApplicationARN string `json:"ApplicationARN"`
SnapshotName string `json:"SnapshotName"`
SnapshotStatus string `json:"SnapshotStatus"`
// Region and AppName are the owning region and application name, used
// only to derive the store.Table composite key (region#appName#name) and
// the byApp index -- SnapshotName alone is only unique within an
// application. Never serialized on the wire: handler.go always builds a
// dedicated snapshotDetail response DTO.
Region string `json:"-"`
AppName string `json:"-"`
ApplicationVersion int64 `json:"ApplicationVersionId"`
}
Snapshot represents an application snapshot.
type StorageBackend ¶
type StorageBackend interface {
Region() string
AccountID() string
GenerateApplicationARN(name string) string
CreateApplication(
ctx context.Context, name, runtimeEnv, serviceRole, description, mode string, tags []Tag,
) (*Application, error)
SeedApplicationConfiguration(
ctx context.Context,
name string,
inputs []InputDescription,
outputs []OutputDescription,
refDataSources []ReferenceDataSourceDescription,
vpcConfigs []VpcConfigurationDescription,
cwlOptions []CloudWatchLoggingOptionDesc,
) error
DescribeApplication(ctx context.Context, name string) (*Application, error)
ListApplications(ctx context.Context, nextToken string) ([]*Application, string)
UpdateApplication(
ctx context.Context, name string, currentVersionID int64, serviceRole, description string,
) (*Application, string, error)
DeleteApplication(ctx context.Context, name string) error
StartApplication(ctx context.Context, name string) (string, error)
StopApplication(ctx context.Context, name string) (string, error)
CreateApplicationSnapshot(ctx context.Context, appName, snapshotName string) (*Snapshot, error)
DescribeApplicationSnapshot(ctx context.Context, appName, snapshotName string) (*Snapshot, error)
ListApplicationSnapshots(ctx context.Context, appName, nextToken string) ([]*Snapshot, string, error)
DeleteApplicationSnapshot(ctx context.Context, appName, snapshotName string) error
TagResource(ctx context.Context, resourceARN string, tags []Tag) error
UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
ListTagsForResource(ctx context.Context, resourceARN string) ([]Tag, error)
AddApplicationCloudWatchLoggingOption(
ctx context.Context, name string, currentVersionID int64, logStreamARN, roleARN string,
) error
AddApplicationInput(ctx context.Context, name string, currentVersionID int64, input InputDescription) error
AddApplicationInputProcessingConfiguration(
ctx context.Context,
name string,
currentVersionID int64,
inputID string,
config *InputProcessingConfigurationDesc,
) error
AddApplicationOutput(ctx context.Context, name string, currentVersionID int64, output OutputDescription) error
AddApplicationReferenceDataSource(
ctx context.Context, name string, currentVersionID int64, ref ReferenceDataSourceDescription,
) error
AddApplicationVpcConfiguration(
ctx context.Context, name string, currentVersionID int64, vpc VpcConfigurationDescription,
) error
DeleteApplicationCloudWatchLoggingOption(
ctx context.Context, name string, currentVersionID int64, loggingOptionID string,
) error
DeleteApplicationInputProcessingConfiguration(
ctx context.Context, name string, currentVersionID int64, inputID string,
) error
DeleteApplicationOutput(ctx context.Context, name string, currentVersionID int64, outputID string) error
DeleteApplicationReferenceDataSource(
ctx context.Context, name string, currentVersionID int64, referenceID string,
) error
DeleteApplicationVpcConfiguration(
ctx context.Context, name string, currentVersionID int64, vpcConfigurationID string,
) error
DescribeApplicationOperation(ctx context.Context, name, operationID string) (*ApplicationOperation, error)
ListApplicationOperations(ctx context.Context, name, nextToken string) ([]*ApplicationOperation, string, error)
DescribeApplicationVersion(ctx context.Context, name string, versionID int64) (*Application, error)
ListApplicationVersions(ctx context.Context, name, nextToken string) ([]*ApplicationVersionSummary, string, error)
RollbackApplication(ctx context.Context, name string, currentVersionID int64) (*Application, string, error)
UpdateApplicationMaintenanceConfiguration(
ctx context.Context, name string, maintenanceWindowStartTime string,
) (*Application, error)
DiscoverInputSchema(
ctx context.Context, resourceARN, roleARN, inputStartingPosition string,
) (*DiscoveredSchema, error)
}
StorageBackend is the interface for the Kinesis Data Analytics v2 in-memory backend.
type VpcConfigurationDescription ¶
type VpcConfigurationDescription struct {
VpcConfigurationID string `json:"VpcConfigurationId"`
VpcID string `json:"VpcId,omitempty"`
SubnetIDs []string `json:"SubnetIds"`
SecurityGroupIDs []string `json:"SecurityGroupIds"`
}
VpcConfigurationDescription describes a VPC configuration.
Source Files
¶
- application_config.go
- application_snapshots.go
- application_versions.go
- applications.go
- errors.go
- handler.go
- handler_application_config.go
- handler_application_presigned_url.go
- handler_application_snapshots.go
- handler_application_versions.go
- handler_applications.go
- handler_tags.go
- interfaces.go
- models.go
- persistence.go
- provider.go
- store.go
- store_setup.go
- tags.go