Documentation
¶
Index ¶
- Constants
- Variables
- type API
- type APIAssociation
- type APICache
- type APIKey
- type APIType
- type AdditionalAuthenticationProvider
- type AuthMode
- type AuthProvider
- type AuthenticationType
- type AuthorizationConfig
- type AwsIamConfig
- type CachingConfig
- type ChannelNamespace
- type ChannelNamespaceConfig
- type CognitoConfig
- type CognitoUserPoolConfig
- type DataSource
- type DataSourceIntrospection
- type DataSourceIntrospectionModel
- type DataSourceIntrospectionModelField
- type DataSourceIntrospectionModelFieldType
- type DataSourceIntrospectionModelIndex
- type DataSourceIntrospectionResult
- type DataSourceType
- type DeltaSyncConfig
- type DomainName
- type DynamoDBBackend
- type DynamoDBDataSourceConfig
- type EventBridgeDataSourceConfig
- type EventConfig
- type EventLogConfig
- type Function
- type GraphQLAuth
- type GraphqlAPI
- type GraphqlAPIConfig
- type HTTPDataSourceConfig
- 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) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- func (h *Handler) StartWorker(ctx context.Context) error
- type HandlerConfig
- type HandlerConfigs
- type InMemoryBackend
- func (b *InMemoryBackend) AssociateAPI(domainName, apiID string) (*APIAssociation, error)
- func (b *InMemoryBackend) AssociateMergedGraphqlAPI(sourceAPIIdentifier, mergedAPIIdentifier, description, mergeType string) (*SourceAPIAssociation, error)
- func (b *InMemoryBackend) AssociateSourceGraphqlAPI(mergedAPIIdentifier, sourceAPIIdentifier, description, mergeType string) (*SourceAPIAssociation, error)
- func (b *InMemoryBackend) CreateAPI(name, ownerContact string, tagMap map[string]string, eventConfig *EventConfig) (*API, error)
- func (b *InMemoryBackend) CreateAPICache(apiID string, cache *APICache) (*APICache, error)
- func (b *InMemoryBackend) CreateAPIKey(apiID, description string, expires int64) (*APIKey, error)
- func (b *InMemoryBackend) CreateChannelNamespace(apiID, name string, tagMap map[string]string, cfg *ChannelNamespaceConfig) (*ChannelNamespace, error)
- func (b *InMemoryBackend) CreateDataSource(apiID string, ds *DataSource) (*DataSource, error)
- func (b *InMemoryBackend) CreateDomainName(domainName, certificateARN, description string, tagMap map[string]string) (*DomainName, error)
- func (b *InMemoryBackend) CreateFunction(apiID string, f *Function) (*Function, error)
- func (b *InMemoryBackend) CreateGraphqlAPI(name string, authType AuthenticationType, xrayEnabled bool, apiType string, ...) (*GraphqlAPI, error)
- func (b *InMemoryBackend) CreateResolver(apiID, typeName string, r *Resolver) (*Resolver, error)
- func (b *InMemoryBackend) CreateType(apiID, definition string, format TypeDefinitionFormat) (*APIType, error)
- func (b *InMemoryBackend) DeleteAPI(apiID string) error
- func (b *InMemoryBackend) DeleteAPICache(apiID string) error
- func (b *InMemoryBackend) DeleteAPIKey(apiID, keyID string) error
- func (b *InMemoryBackend) DeleteChannelNamespace(apiID, name string) error
- func (b *InMemoryBackend) DeleteDataSource(apiID, name string) error
- func (b *InMemoryBackend) DeleteDomainName(domainName string) error
- func (b *InMemoryBackend) DeleteFunction(apiID, functionID string) error
- func (b *InMemoryBackend) DeleteGraphqlAPI(apiID string) error
- func (b *InMemoryBackend) DeleteResolver(apiID, typeName, fieldName string) error
- func (b *InMemoryBackend) DeleteType(apiID, typeName string) error
- func (b *InMemoryBackend) DisassociateAPI(domainName string) error
- func (b *InMemoryBackend) DisassociateMergedGraphqlAPI(sourceAPIID, associationID string) error
- func (b *InMemoryBackend) DisassociateSourceGraphqlAPI(mergedAPIID, associationID string) error
- func (b *InMemoryBackend) EvaluateCode(code, contextJSON, function, runtime string) (string, error)
- func (b *InMemoryBackend) EvaluateMappingTemplate(template, contextJSON string) (string, error)
- func (b *InMemoryBackend) ExecuteGraphQL(ctx context.Context, apiID, query, operationName string, ...) (map[string]any, error)
- func (b *InMemoryBackend) FlushAPICache(apiID string) error
- func (b *InMemoryBackend) GetAPI(apiID string) (*API, error)
- func (b *InMemoryBackend) GetAPIAssociation(domainName string) (*APIAssociation, error)
- func (b *InMemoryBackend) GetAPICache(apiID string) (*APICache, error)
- func (b *InMemoryBackend) GetChannelNamespace(apiID, name string) (*ChannelNamespace, error)
- func (b *InMemoryBackend) GetDataSource(apiID, name string) (*DataSource, error)
- func (b *InMemoryBackend) GetDataSourceIntrospection(introspectionID string) (*DataSourceIntrospection, error)
- func (b *InMemoryBackend) GetDomainName(domainName string) (*DomainName, error)
- func (b *InMemoryBackend) GetFunction(apiID, functionID string) (*Function, error)
- func (b *InMemoryBackend) GetGraphqlAPI(apiID string) (*GraphqlAPI, error)
- func (b *InMemoryBackend) GetGraphqlAPIEnvironmentVariables(apiID string) (map[string]string, error)
- func (b *InMemoryBackend) GetIntrospectionSchema(apiID, format string, includeDirectives bool) ([]byte, error)
- func (b *InMemoryBackend) GetResolver(apiID, typeName, fieldName string) (*Resolver, error)
- func (b *InMemoryBackend) GetSchemaCreationStatus(apiID string) (*Schema, error)
- func (b *InMemoryBackend) GetSourceAPIAssociation(mergedAPIID, associationID string) (*SourceAPIAssociation, error)
- func (b *InMemoryBackend) GetType(apiID, typeName string) (*APIType, error)
- func (b *InMemoryBackend) ListAPIKeys(apiID string) ([]*APIKey, error)
- func (b *InMemoryBackend) ListAPIs() ([]*API, error)
- func (b *InMemoryBackend) ListChannelNamespaces(apiID string) ([]*ChannelNamespace, error)
- func (b *InMemoryBackend) ListDataSources(apiID string) ([]*DataSource, error)
- func (b *InMemoryBackend) ListDomainNames() ([]*DomainName, error)
- func (b *InMemoryBackend) ListFunctions(apiID string) ([]*Function, error)
- func (b *InMemoryBackend) ListGraphqlAPIs(apiType string) ([]*GraphqlAPI, error)
- func (b *InMemoryBackend) ListResolvers(apiID, typeName string) ([]*Resolver, error)
- func (b *InMemoryBackend) ListResolversByFunction(apiID, functionID string) ([]*Resolver, error)
- func (b *InMemoryBackend) ListSourceAPIAssociations(mergedAPIID string) ([]*SourceAPIAssociation, error)
- func (b *InMemoryBackend) ListTagsForResource(apiID string) (map[string]string, error)
- func (b *InMemoryBackend) ListTypes(apiID string) ([]*APIType, error)
- func (b *InMemoryBackend) ListTypesByAssociation(mergedAPIID, associationID, _ string) ([]*APIType, error)
- func (b *InMemoryBackend) PutGraphqlAPIEnvironmentVariables(apiID string, envVars map[string]string) (map[string]string, error)
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SetDynamoDBBackend(ddb DynamoDBBackend)
- func (b *InMemoryBackend) SetJWKSProvider(p JWKSProvider)
- func (b *InMemoryBackend) SetLambdaInvoker(fn LambdaInvoker)
- func (b *InMemoryBackend) SetSigV4Secret(secret string)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartDataSourceIntrospection(cfg *RDSDataAPIConfig) (*DataSourceIntrospection, error)
- func (b *InMemoryBackend) StartSchemaCreation(apiID, sdl string) (*Schema, error)
- func (b *InMemoryBackend) StartSchemaMerge(mergedAPIID, associationID string) (string, error)
- func (b *InMemoryBackend) SweepExpiredAPIKeys() int
- func (b *InMemoryBackend) TagResource(apiID string, tagMap map[string]string) error
- func (b *InMemoryBackend) TaggedResources() []TaggedEntry
- func (b *InMemoryBackend) UntagResource(apiID string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateAPI(apiID, name, ownerContact string, eventConfig *EventConfig) (*API, error)
- func (b *InMemoryBackend) UpdateAPICache(apiID string, cache *APICache) (*APICache, error)
- func (b *InMemoryBackend) UpdateAPIKey(apiID, keyID, description string, expires int64) (*APIKey, error)
- func (b *InMemoryBackend) UpdateChannelNamespace(apiID, name string, cfg *ChannelNamespaceConfig) (*ChannelNamespace, error)
- func (b *InMemoryBackend) UpdateDataSource(apiID, name string, ds *DataSource) (*DataSource, error)
- func (b *InMemoryBackend) UpdateDomainName(domainName, description, certificateARN string) (*DomainName, error)
- func (b *InMemoryBackend) UpdateFunction(apiID, functionID string, f *Function) (*Function, error)
- func (b *InMemoryBackend) UpdateGraphqlAPI(apiID, name string, authType AuthenticationType, xrayEnabled *bool, ...) (*GraphqlAPI, error)
- func (b *InMemoryBackend) UpdateResolver(apiID, typeName string, r *Resolver) (*Resolver, error)
- func (b *InMemoryBackend) UpdateSourceAPIAssociation(mergedAPIID, associationID, description string) (*SourceAPIAssociation, error)
- func (b *InMemoryBackend) UpdateType(apiID, typeName, definition string, format TypeDefinitionFormat) (*APIType, error)
- type Integration
- type JWKSProvider
- type Janitor
- type LambdaAuthorizerConfig
- type LambdaConflictHandlerConfig
- type LambdaDataSourceConfig
- type LambdaInvoker
- type LogConfig
- type OpenIDConnectConfig
- type OpenSearchServiceDataSourceConfig
- type Provider
- type RDSDataAPIConfig
- type RDSHTTPEndpointConfig
- type RelationalDatabaseDataSourceConfig
- type Resolver
- type Runtime
- type Schema
- type SchemaStatus
- type SourceAPIAssociation
- type SourceAPIAssociationConfig
- type SourceAPIAssociationSummary
- type StorageBackend
- type SyncConfig
- type TaggedEntry
- type TypeDefinitionFormat
- type UserPoolConfig
Constants ¶
const ( VisibilityGlobal = "GLOBAL" VisibilityPrivate = "PRIVATE" )
GraphqlAPIVisibility values for the Visibility field on a GraphQL API.
const ( IntrospectionConfigEnabled = "ENABLED" IntrospectionConfigDisabled = "DISABLED" )
IntrospectionConfigEnabled and IntrospectionConfigDisabled are the valid values for IntrospectionConfig.
const ( DataSourceIntrospectionStatusProcessing = "PROCESSING" DataSourceIntrospectionStatusFailed = "FAILED" DataSourceIntrospectionStatusSuccess = "SUCCESS" )
DataSourceIntrospectionStatus values for a DataSourceIntrospection job, matching aws-sdk-go-v2/service/appsync/types.DataSourceIntrospectionStatus exactly.
const ( SourceAPIAssociationStatusMergeScheduled = "MERGE_SCHEDULED" SourceAPIAssociationStatusMergeFailed = "MERGE_FAILED" SourceAPIAssociationStatusMergeSuccess = "MERGE_SUCCESS" SourceAPIAssociationStatusMergeInProgress = "MERGE_IN_PROGRESS" SourceAPIAssociationStatusAutoMergeScheduleFailed = "AUTO_MERGE_SCHEDULE_FAILED" SourceAPIAssociationStatusDeletionScheduled = "DELETION_SCHEDULED" SourceAPIAssociationStatusDeletionInProgress = "DELETION_IN_PROGRESS" SourceAPIAssociationStatusDeletionFailed = "DELETION_FAILED" )
SourceAPIAssociationStatus values, matching aws-sdk-go-v2/service/appsync/types.SourceApiAssociationStatus exactly.
Variables ¶
var ( // ErrNotFound is returned when a resource is not found. ErrNotFound = awserr.New("NotFoundException", awserr.ErrNotFound) // ErrAlreadyExists is returned when a resource already exists. ErrAlreadyExists = awserr.New("BadRequestException", awserr.ErrAlreadyExists) // ErrInvalidSchema is returned when the provided schema SDL is invalid. ErrInvalidSchema = errors.New("InvalidSchemaError") // ErrGraphQLSchemaInvalid is returned by GetIntrospectionSchema when the // stored schema has no valid parsed form to introspect. Its declared error // set (appsync@v1.56.4 deserializers.go) has GraphQLSchemaException but no // BadRequestException, unlike StartSchemaCreation's -- do not reuse // ErrInvalidSchema here (gopherstack-w4kf). ErrGraphQLSchemaInvalid = awserr.New("GraphQLSchemaException", awserr.ErrInvalidParameter) // ErrValidation is returned when input validation fails. ErrValidation = awserr.New("BadRequestException", awserr.ErrInvalidParameter) // ErrUnsupportedJSCode is returned when EvaluateCode is given an APPSYNC_JS // construct the emulator's evaluator does not support. The request is // well-formed, but the code uses features beyond the documented patterns the // emulator faithfully evaluates (the emulator does not embed a JS engine). ErrUnsupportedJSCode = awserr.New("BadRequestException", awserr.ErrInvalidParameter) // ErrAPIKeyLimitExceeded is returned by CreateAPIKey when an API already // has the maximum number of API keys (appsync@v1.56.4 types/errors.go:36: // "The API key exceeded a limit. Try your request again."). ErrAPIKeyLimitExceeded = awserr.New("ApiKeyLimitExceededException", awserr.ErrInvalidParameter) // ErrAPIKeyValidityOutOfBounds is returned by Create/UpdateAPIKey when the // requested expiry falls outside AWS's documented bounds (appsync@v1.56.4 // types/errors.go:62-63: "The API key expiration must be set to a value // between 1 and 365 days from creation (for CreateApiKey) or from update // (for UpdateApiKey)."). ErrAPIKeyValidityOutOfBounds = awserr.New("ApiKeyValidityOutOfBoundsException", awserr.ErrInvalidParameter) )
var ( // ErrNoSchema is returned when no schema is defined for an API. ErrNoSchema = errors.New("no schema defined for this API") // ErrQueryParse is returned when the GraphQL query cannot be parsed. ErrQueryParse = errors.New("query parse error") // ErrOperationNotFound is returned when the named operation is not found. ErrOperationNotFound = errors.New("operation not found") // ErrDataSourceNotFound is returned when a data source is not found. ErrDataSourceNotFound = errors.New("data source not found") // ErrFunctionNotFound is returned when a PIPELINE resolver's PipelineConfig // references a function ID that doesn't exist. ErrFunctionNotFound = errors.New("function not found") // ErrUnsupportedDataSource is returned for unsupported data source types. ErrUnsupportedDataSource = errors.New("unsupported data source type") // ErrUnsupportedDynamoDBOp is returned for unsupported DynamoDB operations. ErrUnsupportedDynamoDBOp = errors.New("unsupported DynamoDB operation") // ErrLambdaNotConfigured is returned when no lambda invoker is set. ErrLambdaNotConfigured = errors.New("lambda invoker not configured") // ErrLambdaMissingConfig is returned when a lambda data source has no config. ErrLambdaMissingConfig = errors.New("lambda data source missing lambdaConfig") // ErrDynamoDBNotConfigured is returned when no dynamodb backend is set. ErrDynamoDBNotConfigured = errors.New("dynamodb backend not configured") // ErrDynamoDBMissingConfig is returned when a dynamodb data source has no config. ErrDynamoDBMissingConfig = errors.New("dynamodb data source missing dynamodbConfig") )
ErrUnauthorized is returned when a GraphQL request's credentials don't satisfy the API's AuthenticationType (or any AdditionalAuthenticationProviders). The message matches the exact body real AppSync returns for a transport-level auth failure -- HTTP 401 with {"message":"Unauthorized"} (AWS re:Post "Resolve unauth errors for GraphQL requests in AWS AppSync": a 401 means credentials are missing/invalid for the configured auth mode, as opposed to a 200 with a GraphQL errors[].errorType "Unauthorized" for resolver-level field auth).
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
Tags map[string]string `json:"tags,omitempty"`
DNS map[string]string `json:"dns,omitempty"`
EventConfig *EventConfig `json:"eventConfig,omitempty"`
Name string `json:"name"`
APIID string `json:"apiId"`
// ARN's wire key is "apiArn", not "arn" -- verified against the real
// deserializer (appsync@v1.56.4 deserializers.go:12050), which is the only
// field name real clients recognize to discover an Event API's ARN.
ARN string `json:"apiArn"`
OwnerContact string `json:"ownerContact,omitempty"`
}
API represents an AppSync Event API.
type APIAssociation ¶
type APIAssociation struct {
DomainName string `json:"domainName"`
APIID string `json:"apiId,omitempty"`
AssociationStatus string `json:"associationStatus"`
DeploymentDetail string `json:"deploymentDetail,omitempty"`
}
APIAssociation represents an association between an API and a domain name.
type APICache ¶
type APICache struct {
APIID string `json:"apiId"`
Type string `json:"type"`
Status string `json:"status"`
APICachingBehavior string `json:"apiCachingBehavior"`
HealthMetricsConfig string `json:"healthMetricsConfig,omitempty"`
TTL int64 `json:"ttl"`
TransitEncryption bool `json:"transitEncryptionEnabled,omitempty"`
AtRestEncryption bool `json:"atRestEncryptionEnabled,omitempty"`
}
APICache represents an AppSync API cache configuration.
HealthMetricsConfig is a string enum ("ENABLED"/"DISABLED") in the real wire shape (appsync@v1.60.0 types/types.go:128, types/enums.go:176-181), not a bool -- a bool field here made json.Unmarshal reject every real client's non-empty CacheHealthMetricsConfig value outright.
func (*APICache) UnmarshalJSON ¶
UnmarshalJSON tolerates a snapshot written before HealthMetricsConfig became a string: back when the field was `bool` with the same "healthMetricsConfig" tag, omitempty meant only `true` could ever have been persisted. LANDMINE: do not bump appsyncSnapshotVersion for this.
type APIKey ¶
type APIKey struct {
ID string `json:"id"`
Description string `json:"description,omitempty"`
Expires int64 `json:"expires,omitempty"`
Deletes int64 `json:"deletes,omitempty"`
}
APIKey represents an AppSync API key.
type APIType ¶
type APIType struct {
ARN string `json:"arn"`
Name string `json:"name"`
Definition string `json:"definition,omitempty"`
Description string `json:"description,omitempty"`
Format TypeDefinitionFormat `json:"format"`
APIID string `json:"apiId,omitempty"`
}
APIType represents an AppSync GraphQL type.
type AdditionalAuthenticationProvider ¶
type AdditionalAuthenticationProvider struct {
LambdaAuthorizerConfig *LambdaAuthorizerConfig `json:"lambdaAuthorizerConfig,omitempty"`
OpenIDConnectConfig *OpenIDConnectConfig `json:"openIDConnectConfig,omitempty"`
UserPoolConfig *CognitoUserPoolConfig `json:"userPoolConfig,omitempty"`
AuthenticationType AuthenticationType `json:"authenticationType"`
}
AdditionalAuthenticationProvider holds an additional authentication configuration.
type AuthMode ¶
type AuthMode struct {
AuthType string `json:"authType"` // AuthenticationType value (API_KEY, AWS_IAM, etc.)
}
AuthMode specifies an authorization mode for an Event API.
type AuthProvider ¶
type AuthProvider struct {
CognitoConfig *CognitoConfig `json:"cognitoConfig,omitempty"`
OpenIDConnectConfig *OpenIDConnectConfig `json:"openIDConnectConfig,omitempty"`
LambdaAuthorizerConfig *LambdaAuthorizerConfig `json:"lambdaAuthorizerConfig,omitempty"`
AuthType string `json:"authType"`
}
AuthProvider holds an authorization provider for an Event API.
type AuthenticationType ¶
type AuthenticationType string
AuthenticationType represents the authentication type for a GraphQL API.
const ( // AuthTypeAPIKey uses API key authentication. AuthTypeAPIKey AuthenticationType = "API_KEY" // AuthTypeIAM uses IAM authentication. AuthTypeIAM AuthenticationType = "AWS_IAM" // AuthTypeCognito uses Amazon Cognito user pools authentication. AuthTypeCognito AuthenticationType = "AMAZON_COGNITO_USER_POOLS" // AuthTypeOIDC uses OpenID Connect authentication. AuthTypeOIDC AuthenticationType = "OPENID_CONNECT" // AuthTypeLambda uses Lambda function authentication. AuthTypeLambda AuthenticationType = "AWS_LAMBDA" )
type AuthorizationConfig ¶
type AuthorizationConfig struct {
AwsIamConfig *AwsIamConfig `json:"awsIamConfig,omitempty"`
AuthorizationType string `json:"authorizationType"` // AWS_IAM
}
AuthorizationConfig is the authorization configuration for HTTP endpoint data sources.
type AwsIamConfig ¶
type AwsIamConfig struct {
SigningRegion string `json:"signingRegion,omitempty"`
SigningServiceName string `json:"signingServiceName,omitempty"`
}
AwsIamConfig holds IAM SigV4 signing configuration for HTTP data source authorization.
type CachingConfig ¶
type CachingConfig struct {
CachingKeys []string `json:"cachingKeys,omitempty"`
TTL int64 `json:"ttl"`
}
CachingConfig holds the caching configuration for a resolver.
type ChannelNamespace ¶
type ChannelNamespace struct {
Tags map[string]string `json:"tags,omitempty"`
HandlerConfigs *HandlerConfigs `json:"handlerConfigs,omitempty"`
APIID string `json:"apiId"`
Name string `json:"name"`
ChannelNamespaceARN string `json:"channelNamespaceArn,omitempty"`
CodeHandlers string `json:"codeHandlers,omitempty"`
PublishAuthModes []AuthMode `json:"publishAuthModes,omitempty"`
SubscribeAuthModes []AuthMode `json:"subscribeAuthModes,omitempty"`
Created int64 `json:"created,omitempty"`
LastModified int64 `json:"lastModified,omitempty"`
}
ChannelNamespace represents an AppSync channel namespace.
type ChannelNamespaceConfig ¶
type ChannelNamespaceConfig struct {
HandlerConfigs *HandlerConfigs `json:"handlerConfigs,omitempty"`
CodeHandlers string `json:"codeHandlers,omitempty"`
PublishAuthModes []AuthMode `json:"publishAuthModes,omitempty"`
SubscribeAuthModes []AuthMode `json:"subscribeAuthModes,omitempty"`
}
ChannelNamespaceConfig bundles optional auth/handler config for channel namespace operations. Passing nil preserves existing behaviour.
type CognitoConfig ¶
type CognitoConfig struct {
UserPoolID string `json:"userPoolId"`
AWSRegion string `json:"awsRegion"`
AppIDClientRegex string `json:"appIdClientRegex,omitempty"`
}
CognitoConfig is the Cognito user pool configuration for Event API auth providers.
type CognitoUserPoolConfig ¶
type CognitoUserPoolConfig struct {
UserPoolID string `json:"userPoolId"`
AWSRegion string `json:"awsRegion"`
AppIDClient string `json:"appIdClientRegex,omitempty"`
}
CognitoUserPoolConfig holds the Amazon Cognito user pool configuration for an API.
type DataSource ¶
type DataSource struct {
Tags *tags.Tags `json:"tags,omitempty"`
LambdaConfig *LambdaDataSourceConfig `json:"lambdaConfig,omitempty"`
DynamoDBConfig *DynamoDBDataSourceConfig `json:"dynamodbConfig,omitempty"`
HTTPConfig *HTTPDataSourceConfig `json:"httpConfig,omitempty"`
OpenSearchConfig *OpenSearchServiceDataSourceConfig `json:"openSearchServiceConfig,omitempty"`
EventBridgeConfig *EventBridgeDataSourceConfig `json:"eventBridgeConfig,omitempty"`
RelationalDatabaseConfig *RelationalDatabaseDataSourceConfig `json:"relationalDatabaseConfig,omitempty"`
DataSourceARN string `json:"dataSourceArn"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
ServiceRoleARN string `json:"serviceRoleArn,omitempty"`
APIID string `json:"apiId"`
Type DataSourceType `json:"type"`
MetricsConfig string `json:"metricsConfig,omitempty"`
}
DataSource represents an AppSync data source.
MetricsConfig ("ENABLED"/"DISABLED") is a real, accepted-and-echoed member (types.DataSourceLevelMetricsConfig, verified against deserializers.go:13625 response-side and serializers.go request-side) that was previously unmodeled entirely -- a real client's CreateDataSource/ UpdateDataSource MetricsConfig value was silently dropped.
type DataSourceIntrospection ¶ added in v1.2.0
type DataSourceIntrospection struct {
RDSDataAPIConfig *RDSDataAPIConfig `json:"rdsDataApiConfig,omitempty"`
IntrospectionResult *DataSourceIntrospectionResult `json:"introspectionResult,omitempty"`
IntrospectionID string `json:"introspectionId"`
IntrospectionStatus string `json:"introspectionStatus"`
IntrospectionStatusDetail string `json:"introspectionStatusDetail,omitempty"`
}
DataSourceIntrospection is the persisted record of a StartDataSourceIntrospection job, keyed by IntrospectionID. Unlike the rest of this service's resources, a real introspection job is NOT coupled to any AppSync GraphqlApi/DataSource -- it introspects an RDS Data API-backed database directly from the caller-supplied RDSDataAPIConfig (see StartDataSourceIntrospectionInput in the real SDK, which carries only an optional rdsDataApiConfig, no apiId/dataSourceName). The RDSDataAPIConfig field is internal record-keeping only -- it is never part of either operation's wire response.
type DataSourceIntrospectionModel ¶ added in v1.2.0
type DataSourceIntrospectionModel struct {
PrimaryKey *DataSourceIntrospectionModelIndex `json:"primaryKey,omitempty"`
Name string `json:"name,omitempty"`
SDL string `json:"sdl,omitempty"`
Fields []*DataSourceIntrospectionModelField `json:"fields,omitempty"`
Indexes []*DataSourceIntrospectionModelIndex `json:"indexes,omitempty"`
}
DataSourceIntrospectionModel is the introspected data for a single model (e.g. a database table). Matches aws-sdk-go-v2/service/appsync/types.DataSourceIntrospectionModel.
type DataSourceIntrospectionModelField ¶ added in v1.2.0
type DataSourceIntrospectionModelField struct {
Type *DataSourceIntrospectionModelFieldType `json:"type,omitempty"`
Name string `json:"name,omitempty"`
Length int64 `json:"length,omitempty"`
}
DataSourceIntrospectionModelField represents one field retrieved from introspected data. Matches aws-sdk-go-v2/service/appsync/types.DataSourceIntrospectionModelField.
type DataSourceIntrospectionModelFieldType ¶ added in v1.2.0
type DataSourceIntrospectionModelFieldType struct {
Type *DataSourceIntrospectionModelFieldType `json:"type,omitempty"`
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
Values []string `json:"values,omitempty"`
}
DataSourceIntrospectionModelFieldType represents the type data for one introspected field. Matches aws-sdk-go-v2/service/appsync/types.DataSourceIntrospectionModelFieldType.
type DataSourceIntrospectionModelIndex ¶ added in v1.2.0
type DataSourceIntrospectionModelIndex struct {
Name string `json:"name,omitempty"`
Fields []string `json:"fields,omitempty"`
}
DataSourceIntrospectionModelIndex is an index retrieved from introspected data. Matches aws-sdk-go-v2/service/appsync/types.DataSourceIntrospectionModelIndex.
type DataSourceIntrospectionResult ¶
type DataSourceIntrospectionResult struct {
NextToken string `json:"nextToken,omitempty"`
Models []*DataSourceIntrospectionModel `json:"models,omitempty"`
}
DataSourceIntrospectionResult is the populated result of a completed introspection. Matches aws-sdk-go-v2/service/appsync/types.DataSourceIntrospectionResult.
type DataSourceType ¶
type DataSourceType string
DataSourceType represents the type of a data source.
const ( // DataSourceTypeNone is a no-op data source. DataSourceTypeNone DataSourceType = "NONE" // DataSourceTypeLambda invokes a Lambda function. DataSourceTypeLambda DataSourceType = "AWS_LAMBDA" // DataSourceTypeDynamoDB queries a DynamoDB table. DataSourceTypeDynamoDB DataSourceType = "AMAZON_DYNAMODB" // DataSourceTypeHTTP forwards requests to an HTTP endpoint. DataSourceTypeHTTP DataSourceType = "HTTP" // DataSourceTypeRelational queries an RDS database. DataSourceTypeRelational DataSourceType = "RELATIONAL_DATABASE" // DataSourceTypeOpenSearch queries an OpenSearch domain. DataSourceTypeOpenSearch DataSourceType = "AMAZON_OPENSEARCH_SERVICE" // DataSourceTypeEventBridge sends events to an Amazon EventBridge bus. DataSourceTypeEventBridge DataSourceType = "AMAZON_EVENTBRIDGE" )
type DeltaSyncConfig ¶
type DeltaSyncConfig struct {
DeltaSyncTableName string `json:"deltaSyncTableName,omitempty"`
BaseTableTTL int64 `json:"baseTableTTL,omitempty"`
DeltaSyncTableTTL int64 `json:"deltaSyncTableTTL,omitempty"`
}
DeltaSyncConfig holds the Delta Sync configuration for a versioned DynamoDB data source.
type DomainName ¶
type DomainName struct {
Tags map[string]string `json:"tags,omitempty"`
DomainName string `json:"domainName"`
CertificateARN string `json:"certificateArn"`
Description string `json:"description,omitempty"`
APIID string `json:"apiId,omitempty"`
AppsyncDomain string `json:"appsyncDomainName,omitempty"`
HostedZoneID string `json:"hostedZoneId,omitempty"`
DomainNameARN string `json:"domainNameArn,omitempty"`
}
DomainName represents an AppSync custom domain name.
type DynamoDBBackend ¶
type DynamoDBBackend interface {
// GetItemRaw executes a DynamoDB GetItem and returns raw JSON bytes.
GetItemRaw(ctx context.Context, tableName string, key map[string]any) (map[string]any, error)
// PutItemRaw executes a DynamoDB PutItem with the given item.
PutItemRaw(ctx context.Context, tableName string, item map[string]any) error
}
DynamoDBBackend is the minimal DynamoDB interface needed for DynamoDB resolvers.
type DynamoDBDataSourceConfig ¶
type DynamoDBDataSourceConfig struct {
DeltaSyncConfig *DeltaSyncConfig `json:"deltaSyncConfig,omitempty"`
TableName string `json:"tableName"`
AWSRegion string `json:"awsRegion"`
UseCallerCredentials bool `json:"useCallerCredentials"`
Versioned bool `json:"versioned"`
}
DynamoDBDataSourceConfig holds the configuration for a DynamoDB data source.
type EventBridgeDataSourceConfig ¶
type EventBridgeDataSourceConfig struct {
EventBusARN string `json:"eventBusArn"`
}
EventBridgeDataSourceConfig holds the configuration for an EventBridge data source.
type EventConfig ¶
type EventConfig struct {
LogConfig *EventLogConfig `json:"logConfig,omitempty"`
AuthProviders []AuthProvider `json:"authProviders"`
ConnectionAuthModes []AuthMode `json:"connectionAuthModes"`
DefaultPublishAuthModes []AuthMode `json:"defaultPublishAuthModes"`
DefaultSubscribeAuthModes []AuthMode `json:"defaultSubscribeAuthModes"`
}
EventConfig holds the authorization configuration for an Event API.
LogConfig was previously unmodeled entirely: real CreateApiInput/ UpdateApiInput both accept it nested under eventConfig (serializers.go's awsRestjson1_serializeDocumentEventConfig has a "logConfig" case), and the real Api response type echoes it back, but gopherstack's EventConfig struct had no field for it at all -- json.Unmarshal silently dropped a real client's CreateApi/UpdateApi EventConfig.LogConfig every time.
type EventLogConfig ¶ added in v1.3.1
type EventLogConfig struct {
CloudWatchLogsRoleARN string `json:"cloudWatchLogsRoleArn"`
LogLevel string `json:"logLevel"`
}
EventLogConfig holds the CloudWatch Logs configuration for an Event API. Distinct from GraphqlAPI's LogConfig -- real appsync.types.EventLogConfig has only these two members (verified: appsync@v1.56.4 deserializers.go's awsRestjson1_deserializeDocumentEventLogConfig case list), no excludeVerboseContent field like the GraphqlApi LogConfig has.
type Function ¶
type Function struct {
Runtime *Runtime `json:"runtime,omitempty"`
SyncConfig *SyncConfig `json:"syncConfig,omitempty"`
FunctionARN string `json:"functionArn"`
FunctionID string `json:"functionId"`
APIID string `json:"apiId"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
DataSourceName string `json:"dataSourceName"`
FunctionVersion string `json:"functionVersion,omitempty"`
RequestMappingTemplate string `json:"requestMappingTemplate,omitempty"`
ResponseMappingTemplate string `json:"responseMappingTemplate,omitempty"`
Code string `json:"code,omitempty"`
MaxBatchSize int32 `json:"maxBatchSize,omitempty"`
}
Function represents an AppSync pipeline function.
type GraphQLAuth ¶
type GraphQLAuth struct {
// Request is the full incoming HTTP request. Required only for AWS_IAM
// (SigV4 signature verification needs the whole request to recompute the
// canonical request); nil is fine for every other auth type.
Request *http.Request
APIKey string // x-api-key header
AuthToken string // Authorization header, verbatim
}
GraphQLAuth carries the caller-presented credentials for a GraphQL request, extracted from HTTP headers by the caller (handleGraphQL) before ExecuteGraphQL runs the query. Only the field(s) relevant to the API's configured auth type need be set.
type GraphqlAPI ¶
type GraphqlAPI struct {
URIs map[string]string `json:"uris"`
Tags *tags.Tags `json:"tags,omitempty"`
EnvironmentVariables map[string]string `json:"-"`
UserPoolConfig *UserPoolConfig `json:"userPoolConfig,omitempty"`
OpenIDConnectConfig *OpenIDConnectConfig `json:"openIDConnectConfig,omitempty"`
LambdaAuthorizerConfig *LambdaAuthorizerConfig `json:"lambdaAuthorizerConfig,omitempty"`
LogConfig *LogConfig `json:"logConfig,omitempty"`
AuthenticationType AuthenticationType `json:"authenticationType"`
IntrospectionConfig string `json:"introspectionConfig,omitempty"`
ARN string `json:"arn"`
Name string `json:"name"`
Visibility string `json:"visibility,omitempty"`
Region string `json:"region"`
APIType string `json:"apiType,omitempty"`
APIID string `json:"apiId"`
Owner string `json:"owner,omitempty"`
OwnerContact string `json:"ownerContact,omitempty"`
AdditionalAuthenticationProviders []AdditionalAuthenticationProvider `json:"additionalAuthenticationProviders,omitempty"` //nolint:lll // AWS field name is long
CreatedAt int64 `json:"createdAt,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
QueryDepthLimit int32 `json:"queryDepthLimit,omitempty"`
ResolverCountLimit int32 `json:"resolverCountLimit,omitempty"`
XrayEnabled bool `json:"xrayEnabled,omitempty"`
}
GraphqlAPI represents an AppSync GraphQL API.
EnvironmentVariables is deliberately excluded from the wire (json:"-"): the real GraphqlApi type has no such member (verified against the real deserializer, appsync@v1.56.4 deserializers.go:14999-15185, which has no "environmentVariables" case) -- env vars are exposed only via the dedicated GetGraphqlApiEnvironmentVariables/PutGraphqlApiEnvironmentVariables ops. Before this fix, GetGraphqlApi/ListGraphqlApis/CreateGraphqlApi/ UpdateGraphqlApi all leaked a caller's real environment-variable values into a response AWS never puts them in, once PutGraphqlApiEnvironmentVariables had been called. Region/CreatedAt/UpdatedAt are also fabricated (not on the real type either, appsync v1.60.0 deserializers.go:15221, 22-case list); gopherstack-z887j strips them from the wire too via wireGraphqlAPI below -- see PARITY.md.
type GraphqlAPIConfig ¶
type GraphqlAPIConfig struct {
UserPoolConfig *UserPoolConfig
OpenIDConnectConfig *OpenIDConnectConfig
LambdaAuthorizerConfig *LambdaAuthorizerConfig
LogConfig *LogConfig
IntrospectionConfig string
OwnerContact string
QueryDepthLimit int32
ResolverCountLimit int32
}
GraphqlAPIConfig bundles optional auth/logging config for CreateGraphqlAPI and UpdateGraphqlAPI. Passing nil is equivalent to no config — existing behaviour is preserved.
type HTTPDataSourceConfig ¶
type HTTPDataSourceConfig struct {
AuthorizationConfig *AuthorizationConfig `json:"authorizationConfig,omitempty"`
Endpoint string `json:"endpoint"`
}
HTTPDataSourceConfig holds the configuration for an HTTP endpoint data source.
type Handler ¶
type Handler struct {
Backend StorageBackend
DefaultRegion string
AccountID string
}
Handler is the Echo HTTP handler for AppSync operations.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new AppSync handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this AppSync instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the AppSync operation from the request path.
func (*Handler) ExtractResource ¶
ExtractResource extracts the API ID from the request path.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported AppSync operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for AppSync requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches AppSync management API and GraphQL requests.
The /v2/apis path prefix is shared with API Gateway V2. Both services use the same URL path but send distinct SDK user-agent markers: the AppSync SDK includes "api/appsync/" while the API Gateway V2 SDK includes "api/apigatewayv2/". When the path matches /v2/apis, we only claim the request if the SDK identification indicates AppSync. That identification is checked in both the User-Agent header (set by native SDKs) and the X-Amz-User-Agent header (used by the AWS SDK for JavaScript in a browser, which cannot set User-Agent itself) -- see service.MatchesUserAgentMarker.
"/v1/tags/{arn}" is shared with Batch/CodeArtifact/Kafka/MQ/Pinpoint/Polly, each of which expose the same real AWS SDK tagging endpoint under their own /v1/ namespace, so the tags branch is ARN-scoped via isAppSyncTagPath instead of a bare prefix match -- an unguarded match here claims every other service's tag requests too (see isBatchTagPath in services/batch/handler.go for the mirrored guard on that side).
type HandlerConfig ¶
type HandlerConfig struct {
Integration *Integration `json:"integration,omitempty"`
Behavior string `json:"behavior"` // CODE
}
HandlerConfig is the configuration for a single event handler (OnPublish or OnSubscribe).
type HandlerConfigs ¶
type HandlerConfigs struct {
OnPublish *HandlerConfig `json:"onPublish,omitempty"`
OnSubscribe *HandlerConfig `json:"onSubscribe,omitempty"`
}
HandlerConfigs holds the OnPublish and OnSubscribe handler configurations.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the in-memory implementation of StorageBackend.
Resource collections are backed by *store.Table[T] (see store_setup.go for the registration list and pkgs/store's package doc). Collections nested under a GraphQL/Event API in the original hand-rolled maps (datasources, resolvers, functions, types, channelNamespaces) are now single flat tables keyed by a composite "<apiID>#<localKey>" string, with a secondary store.Index grouping by API ID for the "all children of API X" lookups the nested maps used to answer directly -- see store_setup.go's doc comment for why this is safe (every child value type already carries its own APIID field as a real, wire-serialized identity field, unlike some other services' internal-only parent-ID fields).
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region, endpoint string) *InMemoryBackend
NewInMemoryBackend creates a new in-memory AppSync backend.
func (*InMemoryBackend) AssociateAPI ¶
func (b *InMemoryBackend) AssociateAPI(domainName, apiID string) (*APIAssociation, error)
AssociateAPI associates an API with a custom domain name.
func (*InMemoryBackend) AssociateMergedGraphqlAPI ¶
func (b *InMemoryBackend) AssociateMergedGraphqlAPI( sourceAPIIdentifier, mergedAPIIdentifier, description, mergeType string, ) (*SourceAPIAssociation, error)
AssociateMergedGraphqlAPI creates an association from a source API to a merged API.
func (*InMemoryBackend) AssociateSourceGraphqlAPI ¶
func (b *InMemoryBackend) AssociateSourceGraphqlAPI( mergedAPIIdentifier, sourceAPIIdentifier, description, mergeType string, ) (*SourceAPIAssociation, error)
AssociateSourceGraphqlAPI creates an association from a merged API to a source API.
func (*InMemoryBackend) CreateAPI ¶
func (b *InMemoryBackend) CreateAPI( name, ownerContact string, tagMap map[string]string, eventConfig *EventConfig, ) (*API, error)
CreateAPI creates a new Event API.
func (*InMemoryBackend) CreateAPICache ¶
func (b *InMemoryBackend) CreateAPICache(apiID string, cache *APICache) (*APICache, error)
CreateAPICache creates a cache configuration for a GraphQL API.
func (*InMemoryBackend) CreateAPIKey ¶
func (b *InMemoryBackend) CreateAPIKey(apiID, description string, expires int64) (*APIKey, error)
CreateAPIKey creates an API key for a GraphQL API.
func (*InMemoryBackend) CreateChannelNamespace ¶
func (b *InMemoryBackend) CreateChannelNamespace( apiID, name string, tagMap map[string]string, cfg *ChannelNamespaceConfig, ) (*ChannelNamespace, error)
CreateChannelNamespace creates a channel namespace for an Event API.
func (*InMemoryBackend) CreateDataSource ¶
func (b *InMemoryBackend) CreateDataSource(apiID string, ds *DataSource) (*DataSource, error)
CreateDataSource creates a data source for an API.
func (*InMemoryBackend) CreateDomainName ¶
func (b *InMemoryBackend) CreateDomainName( domainName, certificateARN, description string, tagMap map[string]string, ) (*DomainName, error)
CreateDomainName creates a custom domain name.
func (*InMemoryBackend) CreateFunction ¶
func (b *InMemoryBackend) CreateFunction(apiID string, f *Function) (*Function, error)
CreateFunction creates an AppSync pipeline function.
func (*InMemoryBackend) CreateGraphqlAPI ¶
func (b *InMemoryBackend) CreateGraphqlAPI( name string, authType AuthenticationType, xrayEnabled bool, apiType string, visibility string, additionalAuthProviders []AdditionalAuthenticationProvider, tagMap map[string]string, cfg *GraphqlAPIConfig, ) (*GraphqlAPI, error)
CreateGraphqlAPI creates a new GraphQL API.
func (*InMemoryBackend) CreateResolver ¶
func (b *InMemoryBackend) CreateResolver(apiID, typeName string, r *Resolver) (*Resolver, error)
CreateResolver creates a resolver for an API type field.
func (*InMemoryBackend) CreateType ¶
func (b *InMemoryBackend) CreateType(apiID, definition string, format TypeDefinitionFormat) (*APIType, error)
CreateType creates a GraphQL type for an API.
func (*InMemoryBackend) DeleteAPI ¶
func (b *InMemoryBackend) DeleteAPI(apiID string) error
DeleteAPI deletes an Event API and all its channel namespaces.
func (*InMemoryBackend) DeleteAPICache ¶
func (b *InMemoryBackend) DeleteAPICache(apiID string) error
DeleteAPICache deletes the cache configuration for a GraphQL API.
func (*InMemoryBackend) DeleteAPIKey ¶
func (b *InMemoryBackend) DeleteAPIKey(apiID, keyID string) error
DeleteAPIKey deletes an API key from a GraphQL API.
func (*InMemoryBackend) DeleteChannelNamespace ¶
func (b *InMemoryBackend) DeleteChannelNamespace(apiID, name string) error
DeleteChannelNamespace removes a channel namespace from an Event API.
func (*InMemoryBackend) DeleteDataSource ¶
func (b *InMemoryBackend) DeleteDataSource(apiID, name string) error
DeleteDataSource deletes a data source. Returns an error if any resolver in the API still references this data source.
func (*InMemoryBackend) DeleteDomainName ¶
func (b *InMemoryBackend) DeleteDomainName(domainName string) error
DeleteDomainName deletes a custom domain name configuration and its API association.
func (*InMemoryBackend) DeleteFunction ¶
func (b *InMemoryBackend) DeleteFunction(apiID, functionID string) error
DeleteFunction deletes a pipeline function. Returns an error if any resolver's pipeline config still references this function.
func (*InMemoryBackend) DeleteGraphqlAPI ¶
func (b *InMemoryBackend) DeleteGraphqlAPI(apiID string) error
DeleteGraphqlAPI deletes a GraphQL API by ID.
func (*InMemoryBackend) DeleteResolver ¶
func (b *InMemoryBackend) DeleteResolver(apiID, typeName, fieldName string) error
DeleteResolver deletes a resolver.
func (*InMemoryBackend) DeleteType ¶
func (b *InMemoryBackend) DeleteType(apiID, typeName string) error
DeleteType deletes a GraphQL type.
func (*InMemoryBackend) DisassociateAPI ¶
func (b *InMemoryBackend) DisassociateAPI(domainName string) error
DisassociateAPI removes the API association from a domain name.
func (*InMemoryBackend) DisassociateMergedGraphqlAPI ¶
func (b *InMemoryBackend) DisassociateMergedGraphqlAPI(sourceAPIID, associationID string) error
DisassociateMergedGraphqlAPI removes a merged API association from a source API.
func (*InMemoryBackend) DisassociateSourceGraphqlAPI ¶
func (b *InMemoryBackend) DisassociateSourceGraphqlAPI(mergedAPIID, associationID string) error
DisassociateSourceGraphqlAPI removes a source API association from a merged API.
func (*InMemoryBackend) EvaluateCode ¶
func (b *InMemoryBackend) EvaluateCode(code, contextJSON, function, runtime string) (string, error)
EvaluateCode evaluates an APPSYNC_JS module against the supplied context and returns the JSON-stringified return value of the selected handler.
gopherstack does not embed a JavaScript engine, so this evaluates the documented APPSYNC_JS patterns directly (see appsync_js.go). Constructs beyond that set return ErrUnsupportedJSCode rather than a fabricated result, so callers can distinguish "evaluated" from "not supported by the emulator".
func (*InMemoryBackend) EvaluateMappingTemplate ¶
func (b *InMemoryBackend) EvaluateMappingTemplate(template, contextJSON string) (string, error)
EvaluateMappingTemplate evaluates a VTL mapping template with the provided context JSON. The context is expected to be a JSON object with optional "arguments" and "result" keys.
func (*InMemoryBackend) ExecuteGraphQL ¶
func (b *InMemoryBackend) ExecuteGraphQL( ctx context.Context, apiID, query, operationName string, variables map[string]any, auth GraphQLAuth, ) (map[string]any, error)
ExecuteGraphQL executes a GraphQL query/mutation against the configured resolvers.
func (*InMemoryBackend) FlushAPICache ¶
func (b *InMemoryBackend) FlushAPICache(apiID string) error
FlushAPICache flushes the cache for a GraphQL API.
func (*InMemoryBackend) GetAPI ¶
func (b *InMemoryBackend) GetAPI(apiID string) (*API, error)
GetAPI returns an Event API by ID.
func (*InMemoryBackend) GetAPIAssociation ¶
func (b *InMemoryBackend) GetAPIAssociation(domainName string) (*APIAssociation, error)
GetAPIAssociation returns the API association for a domain name.
func (*InMemoryBackend) GetAPICache ¶
func (b *InMemoryBackend) GetAPICache(apiID string) (*APICache, error)
GetAPICache returns the cache configuration for a GraphQL API.
func (*InMemoryBackend) GetChannelNamespace ¶
func (b *InMemoryBackend) GetChannelNamespace(apiID, name string) (*ChannelNamespace, error)
GetChannelNamespace returns a channel namespace by API ID and name.
func (*InMemoryBackend) GetDataSource ¶
func (b *InMemoryBackend) GetDataSource(apiID, name string) (*DataSource, error)
GetDataSource returns a data source by API ID and name.
func (*InMemoryBackend) GetDataSourceIntrospection ¶
func (b *InMemoryBackend) GetDataSourceIntrospection(introspectionID string) (*DataSourceIntrospection, error)
GetDataSourceIntrospection returns the persisted record of a previously started introspection job.
func (*InMemoryBackend) GetDomainName ¶
func (b *InMemoryBackend) GetDomainName(domainName string) (*DomainName, error)
GetDomainName returns a custom domain name configuration.
func (*InMemoryBackend) GetFunction ¶
func (b *InMemoryBackend) GetFunction(apiID, functionID string) (*Function, error)
GetFunction returns a pipeline function by ID.
func (*InMemoryBackend) GetGraphqlAPI ¶
func (b *InMemoryBackend) GetGraphqlAPI(apiID string) (*GraphqlAPI, error)
GetGraphqlAPI returns a GraphQL API by ID.
func (*InMemoryBackend) GetGraphqlAPIEnvironmentVariables ¶
func (b *InMemoryBackend) GetGraphqlAPIEnvironmentVariables(apiID string) (map[string]string, error)
GetGraphqlAPIEnvironmentVariables returns environment variables for a GraphQL API.
func (*InMemoryBackend) GetIntrospectionSchema ¶
func (b *InMemoryBackend) GetIntrospectionSchema(apiID, format string, includeDirectives bool) ([]byte, error)
GetIntrospectionSchema returns the schema for an API in the requested format. format must be SDL or JSON (types.OutputType, aws-sdk-go-v2 appsync@v1.56.4 types/enums.go:535-541); an empty format defaults to SDL, matching the handler's own default for an omitted query parameter. Any other value is rejected the same way CreateType already rejects an unrecognized TypeDefinitionFormat (isValidTypeFormat).
includeDirectives controls only the JSON output's top-level "directives" list. SDL is always returned as the raw stored text verbatim -- honoring includeDirectives there would mean re-serializing the schema instead of returning what was stored, and is not attempted.
func (*InMemoryBackend) GetResolver ¶
func (b *InMemoryBackend) GetResolver(apiID, typeName, fieldName string) (*Resolver, error)
GetResolver returns a resolver by API ID, type, and field name.
func (*InMemoryBackend) GetSchemaCreationStatus ¶
func (b *InMemoryBackend) GetSchemaCreationStatus(apiID string) (*Schema, error)
GetSchemaCreationStatus returns the current schema creation status for an API.
func (*InMemoryBackend) GetSourceAPIAssociation ¶
func (b *InMemoryBackend) GetSourceAPIAssociation(mergedAPIID, associationID string) (*SourceAPIAssociation, error)
GetSourceAPIAssociation returns a source API association by merged API ID and association ID.
func (*InMemoryBackend) GetType ¶
func (b *InMemoryBackend) GetType(apiID, typeName string) (*APIType, error)
GetType returns a GraphQL type by name.
func (*InMemoryBackend) ListAPIKeys ¶
func (b *InMemoryBackend) ListAPIKeys(apiID string) ([]*APIKey, error)
ListAPIKeys returns all non-expired API keys for a GraphQL API.
func (*InMemoryBackend) ListAPIs ¶
func (b *InMemoryBackend) ListAPIs() ([]*API, error)
ListAPIs returns all Event APIs.
func (*InMemoryBackend) ListChannelNamespaces ¶
func (b *InMemoryBackend) ListChannelNamespaces(apiID string) ([]*ChannelNamespace, error)
ListChannelNamespaces returns all channel namespaces for an Event API.
func (*InMemoryBackend) ListDataSources ¶
func (b *InMemoryBackend) ListDataSources(apiID string) ([]*DataSource, error)
ListDataSources returns all data sources for an API.
func (*InMemoryBackend) ListDomainNames ¶
func (b *InMemoryBackend) ListDomainNames() ([]*DomainName, error)
ListDomainNames returns all custom domain name configurations.
func (*InMemoryBackend) ListFunctions ¶
func (b *InMemoryBackend) ListFunctions(apiID string) ([]*Function, error)
ListFunctions returns all pipeline functions for a GraphQL API.
func (*InMemoryBackend) ListGraphqlAPIs ¶
func (b *InMemoryBackend) ListGraphqlAPIs(apiType string) ([]*GraphqlAPI, error)
ListGraphqlAPIs returns all GraphQL APIs, optionally filtered by apiType (apiTypeGraphQL or "MERGED").
func (*InMemoryBackend) ListResolvers ¶
func (b *InMemoryBackend) ListResolvers(apiID, typeName string) ([]*Resolver, error)
ListResolvers returns all resolvers for an API type.
func (*InMemoryBackend) ListResolversByFunction ¶
func (b *InMemoryBackend) ListResolversByFunction(apiID, functionID string) ([]*Resolver, error)
ListResolversByFunction returns all resolvers that use a given function.
func (*InMemoryBackend) ListSourceAPIAssociations ¶
func (b *InMemoryBackend) ListSourceAPIAssociations(mergedAPIID string) ([]*SourceAPIAssociation, error)
ListSourceAPIAssociations returns all source API associations for a merged API.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(apiID string) (map[string]string, error)
ListTagsForResource returns all tags on a GraphQL API (v1) or Api (v2 Event API).
func (*InMemoryBackend) ListTypes ¶
func (b *InMemoryBackend) ListTypes(apiID string) ([]*APIType, error)
ListTypes returns all GraphQL types for an API.
func (*InMemoryBackend) ListTypesByAssociation ¶
func (b *InMemoryBackend) ListTypesByAssociation(mergedAPIID, associationID, _ string) ([]*APIType, error)
ListTypesByAssociation lists types associated with a given merged API source association. Since types are stored per-API and not per-association in the in-memory backend, this returns types from the merged API.
func (*InMemoryBackend) PutGraphqlAPIEnvironmentVariables ¶
func (b *InMemoryBackend) PutGraphqlAPIEnvironmentVariables( apiID string, envVars map[string]string, ) (map[string]string, error)
PutGraphqlAPIEnvironmentVariables replaces the environment variables for a GraphQL API.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all state from the backend, returning it to a clean initial state. Useful for resetting state between tests.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.
func (*InMemoryBackend) SetDynamoDBBackend ¶
func (b *InMemoryBackend) SetDynamoDBBackend(ddb DynamoDBBackend)
SetDynamoDBBackend configures the DynamoDB backend for DYNAMODB data sources.
func (*InMemoryBackend) SetJWKSProvider ¶
func (b *InMemoryBackend) SetJWKSProvider(p JWKSProvider)
SetJWKSProvider configures the JWKS provider AMAZON_COGNITO_USER_POOLS and OPENID_CONNECT GraphQL auth use to verify JWT signatures. Wired from cli.go (wireAppSyncCognito) to services/cognitoidp's InMemoryBackend, same as services/apigateway and services/apigatewayv2.
Unlike checkLambdaAuth/checkIAMAuth, an unset provider does NOT reject -- checkCognitoAuth/checkOIDCAuth pass the request through instead. The ~150 other services, and most of this package's own tests, construct an InMemoryBackend directly without calling this setter; treating "provider never wired" as a hard rejection would make every such construction unable to serve a Cognito/OIDC-authenticated GraphQL request at all. A real gopherstack server always wires this (see wireAppSyncCognito in cli.go), so production traffic gets full signature verification; the permissive path only matters for callers that build the backend standalone.
func (*InMemoryBackend) SetLambdaInvoker ¶
func (b *InMemoryBackend) SetLambdaInvoker(fn LambdaInvoker)
SetLambdaInvoker configures the Lambda invoker for LAMBDA data sources.
func (*InMemoryBackend) SetSigV4Secret ¶
func (b *InMemoryBackend) SetSigV4Secret(secret string)
SetSigV4Secret configures the secret AWS_IAM GraphQL auth verifies request signatures against. Not wired from cli.go as of this writing: cli.go's global --sigv4-secret flag (default "test", opt-in via --validate-sigv4) is never passed here, so AWS_IAM-authenticated APIs always verify against httputils.SigV4Validator's built-in "test" default regardless of a non-default --sigv4-secret. Harmless under the (extremely common) default configuration; a caller relying on a custom secret would need cli.go updated to call this, e.g. appSyncBk.SetSigV4Secret(cli.SigV4Secret).
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON. It implements persistence.Persistable.
func (*InMemoryBackend) StartDataSourceIntrospection ¶
func (b *InMemoryBackend) StartDataSourceIntrospection(cfg *RDSDataAPIConfig) (*DataSourceIntrospection, error)
StartDataSourceIntrospection starts an RDS Data API introspection job. Unlike every other Create/Start operation in this backend, the real AWS operation is NOT scoped to an existing AppSync API or DataSource -- it introspects the RDS cluster named by cfg directly (see StartDataSourceIntrospectionInput in the real SDK: the only field is an optional rdsDataApiConfig). gopherstack has no real RDS Data API connectivity to introspect against, so every well-formed request completes synchronously with a SUCCESS status and an empty model list -- the wire-accurate shape and error semantics of introspecting a genuine (if schema-less) database, persisted so it can be retrieved again by ID via GetDataSourceIntrospection.
func (*InMemoryBackend) StartSchemaCreation ¶
func (b *InMemoryBackend) StartSchemaCreation(apiID, sdl string) (*Schema, error)
StartSchemaCreation parses and stores the schema SDL for an API.
func (*InMemoryBackend) StartSchemaMerge ¶
func (b *InMemoryBackend) StartSchemaMerge(mergedAPIID, associationID string) (string, error)
StartSchemaMerge merges the schema of one source API association into its merged API, keyed by (mergedAPIID, associationID) -- matching the real StartSchemaMergeInput, which requires BOTH mergedApiIdentifier and associationId (a merge always targets one specific association, never "the merged API" as a whole). Merges in this emulator are synchronous and always succeed (no conflicting-schema detection), returning the association's new sourceApiAssociationStatus.
func (*InMemoryBackend) SweepExpiredAPIKeys ¶
func (b *InMemoryBackend) SweepExpiredAPIKeys() int
SweepExpiredAPIKeys removes all expired API keys across all GraphQL APIs.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(apiID string, tagMap map[string]string) error
TagResource adds or updates tags on a GraphQL API (v1) or Api (v2 Event API) — both resource kinds are addressed via "arn:...:appsync:...:apis/{apiId}" and are valid TagResource targets on the wire.
func (*InMemoryBackend) TaggedResources ¶ added in v1.3.1
func (b *InMemoryBackend) TaggedResources() []TaggedEntry
TaggedResources returns every GraphQL API (v1) and Event API (v2) that carries at least one tag, keyed by ARN -- the two resource kinds taggable through the generic TagResource/UntagResource/ListTagsForResource ops (see TagResource's doc comment).
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(apiID string, tagKeys []string) error
UntagResource removes tags from a GraphQL API (v1) or Api (v2 Event API).
func (*InMemoryBackend) UpdateAPI ¶
func (b *InMemoryBackend) UpdateAPI(apiID, name, ownerContact string, eventConfig *EventConfig) (*API, error)
UpdateAPI updates an Event API's name, owner contact, or event config.
func (*InMemoryBackend) UpdateAPICache ¶
func (b *InMemoryBackend) UpdateAPICache(apiID string, cache *APICache) (*APICache, error)
UpdateAPICache updates the cache configuration for a GraphQL API.
func (*InMemoryBackend) UpdateAPIKey ¶
func (b *InMemoryBackend) UpdateAPIKey(apiID, keyID, description string, expires int64) (*APIKey, error)
UpdateAPIKey updates an existing API key's description and/or expiry.
func (*InMemoryBackend) UpdateChannelNamespace ¶
func (b *InMemoryBackend) UpdateChannelNamespace( apiID, name string, cfg *ChannelNamespaceConfig, ) (*ChannelNamespace, error)
UpdateChannelNamespace updates a channel namespace's code handlers, auth modes, and handler configs.
func (*InMemoryBackend) UpdateDataSource ¶
func (b *InMemoryBackend) UpdateDataSource(apiID, name string, ds *DataSource) (*DataSource, error)
UpdateDataSource updates an existing data source.
func (*InMemoryBackend) UpdateDomainName ¶
func (b *InMemoryBackend) UpdateDomainName(domainName, description, certificateARN string) (*DomainName, error)
UpdateDomainName updates an existing custom domain name configuration.
func (*InMemoryBackend) UpdateFunction ¶
func (b *InMemoryBackend) UpdateFunction(apiID, functionID string, f *Function) (*Function, error)
UpdateFunction updates an existing pipeline function.
func (*InMemoryBackend) UpdateGraphqlAPI ¶
func (b *InMemoryBackend) UpdateGraphqlAPI( apiID, name string, authType AuthenticationType, xrayEnabled *bool, visibility string, additionalAuthProviders []AdditionalAuthenticationProvider, cfg *GraphqlAPIConfig, ) (*GraphqlAPI, error)
UpdateGraphqlAPI updates an existing GraphQL API's name and/or authentication type.
func (*InMemoryBackend) UpdateResolver ¶
func (b *InMemoryBackend) UpdateResolver(apiID, typeName string, r *Resolver) (*Resolver, error)
UpdateResolver updates an existing resolver.
func (*InMemoryBackend) UpdateSourceAPIAssociation ¶
func (b *InMemoryBackend) UpdateSourceAPIAssociation( mergedAPIID, associationID, description string, ) (*SourceAPIAssociation, error)
UpdateSourceAPIAssociation updates the description of a source API association.
func (*InMemoryBackend) UpdateType ¶
func (b *InMemoryBackend) UpdateType( apiID, typeName, definition string, format TypeDefinitionFormat, ) (*APIType, error)
UpdateType updates an existing GraphQL type definition.
type Integration ¶
type Integration struct {
LambdaConfig *LambdaDataSourceConfig `json:"lambdaConfig,omitempty"`
DataSourceName string `json:"dataSourceName"`
}
Integration is the data source integration for an event handler.
type JWKSProvider ¶
JWKSProvider resolves RSA public keys for JWT signature verification. Implementations return an error when the issuer or key is unknown. Same shape as services/apigateway and services/apigatewayv2's JWKSProvider (services/cognitoidp's InMemoryBackend.GetJWTPublicKey implements it for all three), reused rather than duplicated -- see SetJWKSProvider.
type Janitor ¶
type Janitor struct {
Backend *InMemoryBackend
Interval time.Duration
}
Janitor is the background worker for AppSync that prunes expired API keys.
func NewJanitor ¶
func NewJanitor(backend *InMemoryBackend) *Janitor
NewJanitor creates a new AppSync janitor.
type LambdaAuthorizerConfig ¶
type LambdaAuthorizerConfig struct {
AuthorizerURI string `json:"authorizerUri"`
IdentityValidationExpression string `json:"identityValidationExpression,omitempty"`
AuthorizerResultTTLInSeconds int32 `json:"authorizerResultTtlInSeconds,omitempty"`
}
LambdaAuthorizerConfig holds the Lambda authorizer configuration for an API.
type LambdaConflictHandlerConfig ¶
type LambdaConflictHandlerConfig struct {
LambdaConflictHandlerARN string `json:"lambdaConflictHandlerArn,omitempty"`
}
LambdaConflictHandlerConfig holds config for Lambda conflict resolution.
type LambdaDataSourceConfig ¶
type LambdaDataSourceConfig struct {
LambdaFunctionARN string `json:"lambdaFunctionArn"`
}
LambdaDataSourceConfig holds the configuration for a Lambda data source.
type LambdaInvoker ¶
type LambdaInvoker interface {
InvokeFunction(ctx context.Context, name, invocationType string, payload []byte) ([]byte, int, error)
}
LambdaInvoker can invoke a Lambda function by name or ARN.
type LogConfig ¶
type LogConfig struct {
CloudWatchLogsRoleARN string `json:"cloudWatchLogsRoleArn"`
FieldLogLevel string `json:"fieldLogLevel"` // NONE, ERROR, ALL
ExcludeVerboseContent bool `json:"excludeVerboseContent,omitempty"`
}
LogConfig holds the CloudWatch Logs configuration for a GraphQL API.
type OpenIDConnectConfig ¶
type OpenIDConnectConfig struct {
Issuer string `json:"issuer"`
ClientID string `json:"clientId,omitempty"`
IatTTL int64 `json:"iatTTL,omitempty"`
AuthTTL int64 `json:"authTTL,omitempty"`
}
OpenIDConnectConfig holds the OpenID Connect configuration for an API.
type OpenSearchServiceDataSourceConfig ¶
type OpenSearchServiceDataSourceConfig struct {
Endpoint string `json:"endpoint"`
AWSRegion string `json:"awsRegion"`
}
OpenSearchServiceDataSourceConfig holds config for an OpenSearch data source.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the AppSync service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the AppSync service backend and handler.
type RDSDataAPIConfig ¶ added in v1.2.0
type RDSDataAPIConfig struct {
DatabaseName string `json:"databaseName"`
ResourceARN string `json:"resourceArn"`
SecretARN string `json:"secretArn"`
}
RDSDataAPIConfig carries the metadata needed to introspect an RDS cluster via the RDS Data API. Field names match aws-sdk-go-v2/service/appsync/types.RdsDataApiConfig.
type RDSHTTPEndpointConfig ¶
type RDSHTTPEndpointConfig struct {
DatabaseName string `json:"databaseName,omitempty"`
DBClusterIdentifier string `json:"dbClusterIdentifier,omitempty"`
AWSRegion string `json:"awsRegion,omitempty"`
Schema string `json:"schema,omitempty"`
AWSSecretStoreARN string `json:"awsSecretStoreArn,omitempty"`
}
RDSHTTPEndpointConfig holds the RDS HTTP endpoint configuration.
type RelationalDatabaseDataSourceConfig ¶
type RelationalDatabaseDataSourceConfig struct {
RDSHTTPEndpointConfig *RDSHTTPEndpointConfig `json:"rdsHttpEndpointConfig,omitempty"`
RelationalDatabaseSourceType string `json:"relationalDatabaseSourceType,omitempty"`
}
RelationalDatabaseDataSourceConfig holds config for a relational database data source.
type Resolver ¶
type Resolver struct {
CachingConfig *CachingConfig `json:"cachingConfig,omitempty"`
SyncConfig *SyncConfig `json:"syncConfig,omitempty"`
Runtime *Runtime `json:"runtime,omitempty"`
ResolverARN string `json:"resolverArn"`
ResponseMappingTemplate string `json:"responseMappingTemplate,omitempty"`
DataSourceName string `json:"dataSourceName,omitempty"`
RequestMappingTemplate string `json:"requestMappingTemplate,omitempty"`
TypeName string `json:"typeName"`
FieldName string `json:"fieldName"`
APIID string `json:"apiId"`
Code string `json:"code,omitempty"`
Kind string `json:"kind,omitempty"`
MetricsConfig string `json:"metricsConfig,omitempty"`
PipelineConfig []string `json:"-"`
MaxBatchSize int32 `json:"maxBatchSize,omitempty"`
}
Resolver represents an AppSync resolver.
MetricsConfig ("ENABLED"/"DISABLED") is a real, accepted-and-echoed member (types.ResolverLevelMetricsConfig, verified against deserializers.go:16248 response-side and the paired request serializer) that was previously unmodeled entirely -- a real client's CreateResolver/ UpdateResolver MetricsConfig value was silently dropped.
func (Resolver) MarshalJSON ¶ added in v1.5.0
MarshalJSON projects PipelineConfig into its real wire shape while keeping the Go field a plain []string for internal/test use.
func (*Resolver) UnmarshalJSON ¶ added in v1.5.0
UnmarshalJSON is the inverse of Resolver.MarshalJSON, needed so a Resolver round-trips through persistence.go's snapshot/restore path without losing PipelineConfig.
type Runtime ¶
type Runtime struct {
Name string `json:"name"` // APPSYNC_JS
RuntimeVersion string `json:"runtimeVersion"` // 1.0.0
}
Runtime specifies the runtime for APPSYNC_JS resolvers and functions.
type Schema ¶
type Schema struct {
SDL string `json:"sdl"`
Status SchemaStatus `json:"status"`
Details string `json:"details,omitempty"`
APIID string `json:"apiId"`
// contains filtered or unexported fields
}
Schema represents a stored GraphQL schema.
type SchemaStatus ¶
type SchemaStatus string
SchemaStatus represents the schema creation status.
const ( // SchemaStatusProcessing indicates the schema is being processed. SchemaStatusProcessing SchemaStatus = "PROCESSING" // SchemaStatusActive indicates the schema is active. SchemaStatusActive SchemaStatus = "ACTIVE" // SchemaStatusDeleting indicates the schema is being deleted. SchemaStatusDeleting SchemaStatus = "DELETING" // SchemaStatusFailed indicates the schema creation failed. SchemaStatusFailed SchemaStatus = "FAILED" // SchemaStatusNotApplicable indicates schema creation is not applicable. SchemaStatusNotApplicable SchemaStatus = "NOT_APPLICABLE" )
type SourceAPIAssociation ¶
type SourceAPIAssociation struct {
SourceAPIAssociationConfig *SourceAPIAssociationConfig `json:"sourceApiAssociationConfig,omitempty"`
AssociationID string `json:"associationId"`
AssociationARN string `json:"associationArn"`
SourceAPIID string `json:"sourceApiId"`
SourceAPIARN string `json:"sourceApiArn,omitempty"`
MergedAPIID string `json:"mergedApiId"`
MergedAPIARN string `json:"mergedApiArn,omitempty"`
Description string `json:"description,omitempty"`
AssociationStatus string `json:"sourceApiAssociationStatus"`
AssociationStatusDetail string `json:"sourceApiAssociationStatusDetail,omitempty"`
}
SourceAPIAssociation represents an association between a source API and a merged API.
AssociationStatus's wire key is "sourceApiAssociationStatus", NOT "associationStatus" -- verified against the real deserializer (appsync@v1.56.4 deserializers.go:16488). This is a sibling trap: the similarly-named ApiAssociation type (domain-name associations) genuinely does use the plain "associationStatus" key (deserializers.go:12175); a real client's SourceApiAssociation.SourceApiAssociationStatus field was always empty regardless of backend state before this fix.
type SourceAPIAssociationConfig ¶
type SourceAPIAssociationConfig struct {
MergeType string `json:"mergeType,omitempty"` // MANUAL_MERGE or AUTO_MERGE
}
SourceAPIAssociationConfig describes how source API merging is performed.
type SourceAPIAssociationSummary ¶ added in v1.3.3
type SourceAPIAssociationSummary struct {
AssociationID string `json:"associationId"`
AssociationARN string `json:"associationArn"`
SourceAPIID string `json:"sourceApiId"`
SourceAPIARN string `json:"sourceApiArn,omitempty"`
MergedAPIID string `json:"mergedApiId"`
MergedAPIARN string `json:"mergedApiArn,omitempty"`
Description string `json:"description,omitempty"`
}
SourceAPIAssociationSummary is the narrow wire shape for ListSourceApiAssociations items. Matches aws-sdk-go-v2/service/appsync/types.SourceApiAssociationSummary (drops sourceApiAssociationConfig, sourceApiAssociationStatus, and sourceApiAssociationStatusDetail).
type StorageBackend ¶
type StorageBackend interface {
CreateGraphqlAPI(
name string,
authType AuthenticationType,
xrayEnabled bool,
apiType string,
visibility string,
additionalAuthProviders []AdditionalAuthenticationProvider,
tagMap map[string]string,
cfg *GraphqlAPIConfig,
) (*GraphqlAPI, error)
GetGraphqlAPI(apiID string) (*GraphqlAPI, error)
UpdateGraphqlAPI(
apiID, name string,
authType AuthenticationType,
xrayEnabled *bool,
visibility string,
additionalAuthProviders []AdditionalAuthenticationProvider,
cfg *GraphqlAPIConfig,
) (*GraphqlAPI, error)
ListGraphqlAPIs(apiType string) ([]*GraphqlAPI, error)
DeleteGraphqlAPI(apiID string) error
StartSchemaCreation(apiID, sdl string) (*Schema, error)
GetSchemaCreationStatus(apiID string) (*Schema, error)
GetIntrospectionSchema(apiID, format string, includeDirectives bool) ([]byte, error)
CreateDataSource(apiID string, ds *DataSource) (*DataSource, error)
GetDataSource(apiID, name string) (*DataSource, error)
ListDataSources(apiID string) ([]*DataSource, error)
DeleteDataSource(apiID, name string) error
CreateResolver(apiID, typeName string, r *Resolver) (*Resolver, error)
GetResolver(apiID, typeName, fieldName string) (*Resolver, error)
ListResolvers(apiID, typeName string) ([]*Resolver, error)
DeleteResolver(apiID, typeName, fieldName string) error
ExecuteGraphQL(
ctx context.Context,
apiID, query, operationName string,
variables map[string]any,
auth GraphQLAuth,
) (map[string]any, error)
// New Event API operations.
CreateAPI(name, ownerContact string, tagMap map[string]string, eventConfig *EventConfig) (*API, error)
CreateChannelNamespace(
apiID, name string, tagMap map[string]string, cfg *ChannelNamespaceConfig,
) (*ChannelNamespace, error)
// API key operations.
CreateAPIKey(apiID, description string, expires int64) (*APIKey, error)
ListAPIKeys(apiID string) ([]*APIKey, error)
DeleteAPIKey(apiID, keyID string) error
// API cache operations.
CreateAPICache(apiID string, cache *APICache) (*APICache, error)
GetAPICache(apiID string) (*APICache, error)
DeleteAPICache(apiID string) error
// Function operations.
CreateFunction(apiID string, f *Function) (*Function, error)
GetFunction(apiID, functionID string) (*Function, error)
ListFunctions(apiID string) ([]*Function, error)
DeleteFunction(apiID, functionID string) error
// Type operations.
CreateType(apiID, definition string, format TypeDefinitionFormat) (*APIType, error)
GetType(apiID, typeName string) (*APIType, error)
ListTypes(apiID string) ([]*APIType, error)
DeleteType(apiID, typeName string) error
// DataSource update.
UpdateDataSource(apiID, name string, ds *DataSource) (*DataSource, error)
// Resolver update.
UpdateResolver(apiID, typeName string, r *Resolver) (*Resolver, error)
// Function update.
UpdateFunction(apiID, functionID string, f *Function) (*Function, error)
// Type update.
UpdateType(apiID, typeName, definition string, format TypeDefinitionFormat) (*APIType, error)
// API key update.
UpdateAPIKey(apiID, keyID, description string, expires int64) (*APIKey, error)
// API cache update and flush.
UpdateAPICache(apiID string, cache *APICache) (*APICache, error)
FlushAPICache(apiID string) error
// Tag operations (GraphQL APIs).
TagResource(apiID string, tagMap map[string]string) error
UntagResource(apiID string, tagKeys []string) error
ListTagsForResource(apiID string) (map[string]string, error)
// Domain name operations.
CreateDomainName(domainName, certificateARN, description string, tagMap map[string]string) (*DomainName, error)
GetDomainName(domainName string) (*DomainName, error)
UpdateDomainName(domainName, description, certificateARN string) (*DomainName, error)
ListDomainNames() ([]*DomainName, error)
DeleteDomainName(domainName string) error
AssociateAPI(domainName, apiID string) (*APIAssociation, error)
GetAPIAssociation(domainName string) (*APIAssociation, error)
DisassociateAPI(domainName string) error
// Event API (v2) operations.
GetAPI(apiID string) (*API, error)
ListAPIs() ([]*API, error)
UpdateAPI(apiID, name, ownerContact string, eventConfig *EventConfig) (*API, error)
DeleteAPI(apiID string) error
// Channel namespace operations.
GetChannelNamespace(apiID, name string) (*ChannelNamespace, error)
ListChannelNamespaces(apiID string) ([]*ChannelNamespace, error)
UpdateChannelNamespace(apiID, name string, cfg *ChannelNamespaceConfig) (*ChannelNamespace, error)
DeleteChannelNamespace(apiID, name string) error
// Merged/source API association operations.
AssociateMergedGraphqlAPI(
sourceAPIIdentifier, mergedAPIIdentifier, description, mergeType string,
) (*SourceAPIAssociation, error)
AssociateSourceGraphqlAPI(
mergedAPIIdentifier, sourceAPIIdentifier, description, mergeType string,
) (*SourceAPIAssociation, error)
GetSourceAPIAssociation(mergedAPIID, associationID string) (*SourceAPIAssociation, error)
ListSourceAPIAssociations(mergedAPIID string) ([]*SourceAPIAssociation, error)
DisassociateMergedGraphqlAPI(sourceAPIID, associationID string) error
DisassociateSourceGraphqlAPI(mergedAPIID, associationID string) error
// ListResolversByFunction - resolvers attached to a function.
ListResolversByFunction(apiID, functionID string) ([]*Resolver, error)
// Environment variable operations on GraphQL APIs.
GetGraphqlAPIEnvironmentVariables(apiID string) (map[string]string, error)
PutGraphqlAPIEnvironmentVariables(apiID string, envVars map[string]string) (map[string]string, error)
// EvaluateMappingTemplate evaluates a VTL request/response mapping template.
EvaluateMappingTemplate(template, context string) (string, error)
// EvaluateCode evaluates APPSYNC_JS code.
EvaluateCode(code, contextJSON, function, runtime string) (string, error)
// StartDataSourceIntrospection starts an RDS Data API introspection job. Not
// scoped to any existing AppSync API/DataSource -- see DataSourceIntrospection's
// doc comment in models.go.
StartDataSourceIntrospection(cfg *RDSDataAPIConfig) (*DataSourceIntrospection, error)
// GetDataSourceIntrospection returns the persisted record of an introspection job.
GetDataSourceIntrospection(introspectionID string) (*DataSourceIntrospection, error)
// StartSchemaMerge merges one source API association's schema into its merged API.
StartSchemaMerge(mergedAPIID, associationID string) (string, error)
// UpdateSourceAPIAssociation updates a source API association on a merged API.
UpdateSourceAPIAssociation(mergedAPIID, associationID, description string) (*SourceAPIAssociation, error)
// ListTypesByAssociation lists types for a given merged API source association.
ListTypesByAssociation(mergedAPIID, associationID, format string) ([]*APIType, error)
}
StorageBackend defines the interface for AppSync storage operations.
type SyncConfig ¶
type SyncConfig struct {
LambdaConflictHandlerConfig *LambdaConflictHandlerConfig `json:"lambdaConflictHandlerConfig,omitempty"`
ConflictDetection string `json:"conflictDetection,omitempty"`
ConflictHandler string `json:"conflictHandler,omitempty"`
}
SyncConfig holds the conflict detection/resolution configuration for a resolver.
type TaggedEntry ¶ added in v1.3.1
TaggedEntry pairs a resource ARN with its tag set, for the Resource Groups Tagging API's GetResources (see cli.go's wireTaggingAppSync).
type TypeDefinitionFormat ¶
type TypeDefinitionFormat string
TypeDefinitionFormat represents the format of a GraphQL type definition.
const ( // TypeFormatSDL represents SDL format. TypeFormatSDL TypeDefinitionFormat = "SDL" // TypeFormatJSON represents JSON format. TypeFormatJSON TypeDefinitionFormat = "JSON" )
type UserPoolConfig ¶
type UserPoolConfig struct {
UserPoolID string `json:"userPoolId"`
AWSRegion string `json:"awsRegion"`
DefaultAction string `json:"defaultAction"` // ALLOW or DENY
AppIDClientRegex string `json:"appIdClientRegex,omitempty"`
}
UserPoolConfig holds the primary Amazon Cognito user pool configuration for a GraphQL API. Unlike CognitoUserPoolConfig (used in AdditionalAuthProviders), this has DefaultAction.
Source Files
¶
- api_keys.go
- auth.go
- caching.go
- channel_namespaces.go
- data_sources.go
- domain_names.go
- errors.go
- evaluation.go
- events.go
- functions.go
- graphql.go
- graphql_apis.go
- handler.go
- handler_api_keys.go
- handler_caching.go
- handler_channel_namespaces.go
- handler_data_sources.go
- handler_domain_names.go
- handler_errors.go
- handler_evaluation.go
- handler_events.go
- handler_functions.go
- handler_graphql_apis.go
- handler_resolvers.go
- handler_schema.go
- handler_schema_types.go
- handler_source_api_associations.go
- handler_tags.go
- introspection.go
- janitor.go
- jseval.go
- models.go
- persistence.go
- provider.go
- resolvers.go
- schema.go
- schema_types.go
- source_api_associations.go
- store.go
- store_setup.go
- tags.go
- vtl.go