appsync

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	Id          string
	ApiId       string
	Description string
	Expires     int64
	Deletes     int64
}

ApiKey represents an AppSync API key.

type AppSyncService

type AppSyncService struct {
	// contains filtered or unexported fields
}

AppSyncService is the cloudmock implementation of the AWS AppSync API.

func New

func New(accountID, region string) *AppSyncService

New returns a new AppSyncService for the given AWS account ID and region.

func (*AppSyncService) Actions

func (s *AppSyncService) Actions() []service.Action

Actions returns the list of AppSync API actions supported by this service.

func (*AppSyncService) HandleRequest

func (s *AppSyncService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes an incoming AppSync request to the appropriate handler.

func (*AppSyncService) HealthCheck

func (s *AppSyncService) HealthCheck() error

HealthCheck always returns nil (no external dependencies).

func (*AppSyncService) Name

func (s *AppSyncService) Name() string

Name returns the AWS service name used for routing.

type DataSource

type DataSource struct {
	DataSourceArn       string
	ApiId               string
	Name                string
	Type                string
	Description         string
	ServiceRoleArn      string
	DynamodbConfig      map[string]any
	LambdaConfig        map[string]any
	HttpConfig          map[string]any
	ElasticsearchConfig map[string]any
}

DataSource represents an AppSync data source.

type Function

type Function struct {
	FunctionId              string
	ApiId                   string
	Name                    string
	Description             string
	DataSourceName          string
	RequestMappingTemplate  string
	ResponseMappingTemplate string
	FunctionVersion         string
	Runtime                 map[string]any
	Code                    string
}

Function represents an AppSync function.

type GraphqlApi

type GraphqlApi struct {
	ApiId               string
	Name                string
	ARN                 string
	AuthenticationType  string
	LogConfig           map[string]any
	UserPoolConfig      map[string]any
	OpenIDConnectConfig map[string]any
	AdditionalAuth      []map[string]any
	XrayEnabled         bool
	Uris                map[string]string
	Tags                map[string]string
	CreatedAt           time.Time
}

GraphqlApi represents an AppSync GraphQL API.

type Resolver

type Resolver struct {
	ApiId                   string
	TypeName                string
	FieldName               string
	DataSourceName          string
	RequestMappingTemplate  string
	ResponseMappingTemplate string
	Kind                    string
	PipelineConfig          map[string]any
	CachingConfig           map[string]any
	Runtime                 map[string]any
	Code                    string
}

Resolver represents an AppSync resolver.

type SchemaCreation

type SchemaCreation struct {
	Status  string // PROCESSING | ACTIVE | FAILED | DELETING
	Details string
}

SchemaCreation tracks schema creation state.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store manages all AppSync state in memory.

func NewStore

func NewStore(accountID, region string) *Store

NewStore returns a new Store for the given account and region.

func (*Store) CreateApiKey

func (s *Store) CreateApiKey(apiID, description string, expires int64) (*ApiKey, bool)

CreateApiKey creates a new API key.

func (*Store) CreateDataSource

func (s *Store) CreateDataSource(apiID, name, dsType, description, serviceRoleArn string, dynamodb, lambda, httpConf, es map[string]any) (*DataSource, bool)

CreateDataSource creates a new data source.

func (*Store) CreateFunction

func (s *Store) CreateFunction(apiID, name, description, dataSourceName, requestTemplate, responseTemplate, functionVersion, code string, runtime map[string]any) (*Function, bool)

CreateFunction creates a new function.

func (*Store) CreateGraphqlApi

func (s *Store) CreateGraphqlApi(name, authType string, tags map[string]string, xrayEnabled bool) *GraphqlApi

CreateGraphqlApi creates a new GraphQL API.

func (*Store) CreateResolver

func (s *Store) CreateResolver(apiID, typeName, fieldName, dataSourceName, requestTemplate, responseTemplate, kind, code string, pipelineConfig, cachingConfig, runtime map[string]any) (*Resolver, bool)

CreateResolver creates a new resolver.

func (*Store) CreateType

func (s *Store) CreateType(apiID, name, format, definition, description string) (*TypeDef, bool)

CreateType creates a new type definition for an API.

func (*Store) DeleteApiKey

func (s *Store) DeleteApiKey(apiID, keyID string) bool

DeleteApiKey removes an API key.

func (*Store) DeleteDataSource

func (s *Store) DeleteDataSource(apiID, name string) bool

DeleteDataSource removes a data source.

func (*Store) DeleteFunction

func (s *Store) DeleteFunction(apiID, functionID string) bool

DeleteFunction removes a function.

func (*Store) DeleteGraphqlApi

func (s *Store) DeleteGraphqlApi(apiID string) bool

DeleteGraphqlApi removes a GraphQL API.

func (*Store) DeleteResolver

func (s *Store) DeleteResolver(apiID, typeName, fieldName string) bool

DeleteResolver removes a resolver.

func (*Store) DeleteType

func (s *Store) DeleteType(apiID, typeName string) bool

DeleteType removes a type definition.

func (*Store) GetDataSource

func (s *Store) GetDataSource(apiID, name string) (*DataSource, bool)

GetDataSource returns a data source.

func (*Store) GetFunction

func (s *Store) GetFunction(apiID, functionID string) (*Function, bool)

GetFunction returns a function by ID.

func (*Store) GetGraphqlApi

func (s *Store) GetGraphqlApi(apiID string) (*GraphqlApi, bool)

GetGraphqlApi returns a GraphQL API by ID.

func (*Store) GetResolver

func (s *Store) GetResolver(apiID, typeName, fieldName string) (*Resolver, bool)

GetResolver returns a resolver.

func (*Store) GetSchemaCreationStatus

func (s *Store) GetSchemaCreationStatus(apiID string) (*SchemaCreation, bool)

GetSchemaCreationStatus returns the schema creation status for an API.

func (*Store) GetType

func (s *Store) GetType(apiID, typeName, format string) (*TypeDef, bool)

GetType returns a type definition.

func (*Store) ListApiKeys

func (s *Store) ListApiKeys(apiID string) ([]*ApiKey, bool)

ListApiKeys returns all API keys for an API.

func (*Store) ListDataSources

func (s *Store) ListDataSources(apiID string) ([]*DataSource, bool)

ListDataSources returns all data sources for an API.

func (*Store) ListFunctions

func (s *Store) ListFunctions(apiID string) ([]*Function, bool)

ListFunctions returns all functions for an API.

func (*Store) ListGraphqlApis

func (s *Store) ListGraphqlApis() []*GraphqlApi

ListGraphqlApis returns all GraphQL APIs.

func (*Store) ListResolvers

func (s *Store) ListResolvers(apiID, typeName string) ([]*Resolver, bool)

ListResolvers returns all resolvers for a type.

func (*Store) ListTagsForResource

func (s *Store) ListTagsForResource(arn string) (map[string]string, bool)

ListTagsForResource returns tags for an API by ARN.

func (*Store) ListTypes

func (s *Store) ListTypes(apiID, format string) []*TypeDef

ListTypes returns all types for an API.

func (*Store) StartSchemaCreation

func (s *Store) StartSchemaCreation(apiID, definition string) bool

StartSchemaCreation begins schema creation for an API.

func (*Store) TagResource

func (s *Store) TagResource(arn string, tags map[string]string) bool

TagResource applies tags to an API by ARN.

func (*Store) UntagResource

func (s *Store) UntagResource(arn string, keys []string) bool

UntagResource removes tags from an API by ARN.

func (*Store) UpdateApiKey

func (s *Store) UpdateApiKey(apiID, keyID, description string, expires int64) (*ApiKey, bool)

UpdateApiKey updates an API key.

func (*Store) UpdateDataSource

func (s *Store) UpdateDataSource(apiID, name, dsType, description, serviceRoleArn string) (*DataSource, bool)

UpdateDataSource updates a data source.

func (*Store) UpdateFunction

func (s *Store) UpdateFunction(apiID, functionID, name, description, dataSourceName, requestTemplate, responseTemplate, code string) (*Function, bool)

UpdateFunction updates a function.

func (*Store) UpdateGraphqlApi

func (s *Store) UpdateGraphqlApi(apiID, name, authType string, xrayEnabled *bool) (*GraphqlApi, bool)

UpdateGraphqlApi updates a GraphQL API.

func (*Store) UpdateResolver

func (s *Store) UpdateResolver(apiID, typeName, fieldName, dataSourceName, requestTemplate, responseTemplate, kind, code string) (*Resolver, bool)

UpdateResolver updates a resolver.

func (*Store) UpdateType

func (s *Store) UpdateType(apiID, typeName, format, definition, description string) (*TypeDef, bool)

UpdateType updates a type definition.

type TypeDef

type TypeDef struct {
	ApiId       string
	Name        string
	Format      string
	Definition  string
	Description string
	ARN         string
}

TypeDef represents an AppSync type definition.

Jump to

Keyboard shortcuts

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