Documentation
¶
Overview ¶
Package appsync emulates AWS AppSync GraphQL APIs: the REST-JSON control plane (APIs, API keys, schemas, data sources, functions, resolvers), the GraphQL endpoint on <apiId>.appsync-api.localhost that runs VTL and APPSYNC_JS resolvers against Lambda, DynamoDB, HTTP, RDS and NONE data sources, and real-time subscriptions on <apiId>.appsync-realtime-api.localhost.
Index ¶
- type API
- type APIKey
- type DataSource
- type Function
- type Resolver
- type Service
- func (s *Service) Close() error
- func (s *Service) Info() core.Info
- func (s *Service) Inspect(table, id string) any
- func (s *Service) Load(b []byte) error
- func (s *Service) Reset()
- func (s *Service) Resources() []core.Table
- func (s *Service) Save() ([]byte, error)
- func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
ID string `json:"id"`
Account string `json:"account"`
Region string `json:"region"`
Config apiConfig `json:"config"`
Tags map[string]string `json:"tags,omitempty"`
SDL string `json:"sdl,omitempty"`
Status string `json:"status,omitempty"` // schema creation: SUCCESS or FAILED
Details string `json:"details,omitempty"`
Keys map[string]*APIKey `json:"keys"`
Sources map[string]*DataSource `json:"sources"`
Functions map[string]*Function `json:"functions"`
Resolvers map[string]*Resolver `json:"resolvers"` // by Type.field
// contains filtered or unexported fields
}
API is a GraphQL API and everything attached to it. Its nested values are replaced, never changed in place, so a request can run on a snapshot.
type APIKey ¶
type APIKey struct {
ID string `json:"id"`
Description string `json:"description,omitempty"`
Expires int64 `json:"expires"`
Deletes int64 `json:"deletes"`
}
APIKey is an API key; its id is the key.
type DataSource ¶
type DataSource struct {
DataSourceArn string `json:"dataSourceArn"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Type string `json:"type"`
ServiceRoleArn string `json:"serviceRoleArn,omitempty"`
DynamodbConfig json.RawMessage `json:"dynamodbConfig,omitempty"`
LambdaConfig json.RawMessage `json:"lambdaConfig,omitempty"`
ElasticsearchConfig json.RawMessage `json:"elasticsearchConfig,omitempty"`
OpenSearchServiceConfig json.RawMessage `json:"openSearchServiceConfig,omitempty"`
HttpConfig json.RawMessage `json:"httpConfig,omitempty"`
RelationalDatabaseConfig json.RawMessage `json:"relationalDatabaseConfig,omitempty"`
EventBridgeConfig json.RawMessage `json:"eventBridgeConfig,omitempty"`
MetricsConfig string `json:"metricsConfig,omitempty"`
}
DataSource is a data source; its configs are kept as sent.
type Function ¶
type Function struct {
FunctionId string `json:"functionId"`
FunctionArn string `json:"functionArn"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
DataSourceName string `json:"dataSourceName"`
RequestMappingTemplate string `json:"requestMappingTemplate,omitempty"`
ResponseMappingTemplate string `json:"responseMappingTemplate,omitempty"`
FunctionVersion string `json:"functionVersion,omitempty"`
SyncConfig json.RawMessage `json:"syncConfig,omitempty"`
MaxBatchSize int `json:"maxBatchSize,omitempty"`
Runtime *runtime `json:"runtime,omitempty"`
Code string `json:"code,omitempty"`
}
Function is a pipeline function.
type Resolver ¶
type Resolver struct {
TypeName string `json:"typeName"`
FieldName string `json:"fieldName"`
DataSourceName string `json:"dataSourceName,omitempty"`
ResolverArn string `json:"resolverArn"`
RequestMappingTemplate string `json:"requestMappingTemplate,omitempty"`
ResponseMappingTemplate string `json:"responseMappingTemplate,omitempty"`
Kind string `json:"kind"`
PipelineConfig *pipeline `json:"pipelineConfig,omitempty"`
SyncConfig json.RawMessage `json:"syncConfig,omitempty"`
CachingConfig json.RawMessage `json:"cachingConfig,omitempty"`
MaxBatchSize int `json:"maxBatchSize,omitempty"`
Runtime *runtime `json:"runtime,omitempty"`
Code string `json:"code,omitempty"`
MetricsConfig string `json:"metricsConfig,omitempty"`
}
Resolver attaches a data source (UNIT) or functions (PIPELINE) to a field.