Documentation ¶
Index ¶
- type ALBEvent
- type AlexaEvent
- type Attribute
- type AttributeDef
- type AttributeDefinition
- type Authorizer
- type CognitoEvent
- type DQLConfig
- func (c *DQLConfig) AddSchema(schemaName, path string) error
- func (c DQLConfig) CreateResourceTables(overwrite bool) error
- func (c DQLConfig) MakeBuild(test bool)
- func (c DQLConfig) MakeDebug()
- func (c DQLConfig) ReadServerlessConfig() (*ServerlessConfig, error)
- func (c *DQLConfig) Remove(name string) error
- func (c DQLConfig) RemoveFiles(name string) error
- func (c *DQLConfig) RemoveResource(resourceName string, deleteTable bool) error
- func (c DQLConfig) RemoveResourceFiles(schemaName, resourceName string) error
- func (c DQLConfig) Write() error
- type DeploymentBucket
- type Events
- type FnEnvironment
- type GlobalConfig
- type GlobalIndex
- type HTTPEvent
- type IOTEvent
- type KeySchema
- type Layer
- type LocalIndex
- type LogConfig
- type Model
- type Package
- type Projection
- type Properties
- type Provider
- type ProvisionedThroughput
- type Reference
- type Resource
- type ResourceDefinition
- type Resources
- type RoleStatement
- type S3Event
- type SAMEvent
- type SAMFnProp
- type SAMFunction
- type SAMProp
- type SNSEvent
- type SQSEvent
- type ScheduleEvent
- type Schema
- type ServerlessConfig
- func (s *ServerlessConfig) AddAuth(excludes string)
- func (s *ServerlessConfig) AddFunction(name, path, method string) *ServerlessConfig
- func (s *ServerlessConfig) AddPoolEnv(ms ServerlessConfig, rName, pool string) error
- func (s *ServerlessConfig) AddSchema(schemaName, path string) *ServerlessConfig
- func (s *ServerlessConfig) RemoveAuth()
- func (s *ServerlessConfig) RemoveFunction(n string) *ServerlessConfig
- func (s *ServerlessConfig) SetResourceWithModel(c *DQLConfig, m *Model)
- func (s *ServerlessConfig) Write() error
- type ServerlessFunction
- type Service
- type StreamEvent
- type TTLSpecification
- type TemplateConfig
- type TracingConfig
- type WebSocketEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ALBEvent ¶
type ALBEvent struct { ListenerARN string `yaml:"listenerArn"` Priority int `yaml:",omitempty"` Conditions map[string]string `yaml:",omitempty"` }
ALBEvent ...
type AlexaEvent ¶
AlexaEvent ...
type Attribute ¶
type Attribute struct { Name string `json:"name"` Ident flect.Ident `json:"ident"` GoType string `json:"go_type"` AwsType string `json:"aws_type"` }
Attribute represents a resource model's attribute
type AttributeDef ¶
type AttributeDef struct { AttributeName string `yaml:"AttributeName"` AttributeType string `yaml:"AttributeType"` }
AttributeDef ...
type AttributeDefinition ¶
type AttributeDefinition struct { Ident flect.Ident `json:"ident"` AwsType string `json:"aws_type"` }
AttributeDefinition represents the definition of a resource's attribute
type Authorizer ¶
type Authorizer struct { ARN string Name string `yaml:",omitempty"` ResultTTL int `yaml:"resultTtlInSeconds,omitempty"` IdentitySource string `yaml:"identitySource,omitempty"` IdentityValidationExpression string `yaml:"identityValidationExpression,omitempty"` Type string `yaml:",omitempty"` }
Authorizer ...
type CognitoEvent ¶
CognitoEvent ...
type DQLConfig ¶
type DQLConfig struct { ProjectName string ProjectPath string Region string Schemas map[string]*Schema Resources map[string]*Resource }
DQLConfig ...
func (DQLConfig) CreateResourceTables ¶
CreateResourceTables creates the tables in the local DynamoDB named by the given mode
func (DQLConfig) MakeDebug ¶
func (c DQLConfig) MakeDebug()
MakeDebug renders the Makefile and builds the debug binaries
func (DQLConfig) ReadServerlessConfig ¶
func (c DQLConfig) ReadServerlessConfig() (*ServerlessConfig, error)
ReadServerlessConfig reads the ServerlessConfig from serverless.yml in the resource or function group directory. If a serverless.yml file does not exist, a new default ServerlessConfig is returned
func (*DQLConfig) RemoveResource ¶
RemoveResource removes a given resource from the DQLConfig and ServerlessConfig
func (DQLConfig) RemoveResourceFiles ¶
RemoveResourceFiles ...
type DeploymentBucket ¶
type DeploymentBucket struct { Name string SSE string `yaml:"serverSideEncryption,omitempty"` Tags map[string]string `yaml:",omitempty"` }
DeploymentBucket ...
type Events ¶
type Events struct { HTTP *HTTPEvent `yaml:"http,omitempty"` WebSocket *WebSocketEvent `yaml:"websocket,omitempty"` S3 *S3Event `yaml:"s3,omitempty"` Schedule *ScheduleEvent `yaml:"schedule,omitempty"` SNS *SNSEvent `yaml:"sns,omitempty"` SQS *SQSEvent `yaml:"sqs,omitempty"` Stream *StreamEvent `yaml:"stream,omitempty"` AlexaSkill *AlexaEvent `yaml:"alexaSkill,omitempty"` AlexaSmartHome *AlexaEvent `yaml:"alexaSmartHome,omitempty"` IOT *IOTEvent `yaml:"iot,omitempty"` CognitoUserPool *CognitoEvent `yaml:"cognitoUserPool,omitempty"` ALB *ALBEvent `yaml:"alb,omitempty"` }
Events ...
type FnEnvironment ¶
FnEnvironment ...
type GlobalConfig ¶
type GlobalConfig struct {
Function SAMFnProp `yaml:"Function"`
}
GlobalConfig ...
type GlobalIndex ¶
type GlobalIndex struct { IndexName string `yaml:"IndexName"` KeySchema []KeySchema `yaml:"KeySchema"` Projection Projection `yaml:"Projection"` ProvisionedThroughput *ProvisionedThroughput `yaml:"ProvisionedTroughput,omitempty"` }
GlobalIndex ...
type HTTPEvent ¶
type HTTPEvent struct { Path string Method string CORS bool `yaml:",omitempty"` Private bool `yaml:",omitempty"` Authorizer *Authorizer `yaml:",omitempty"` Scopes []string `yaml:",omitempty"` }
HTTPEvent ...
type IOTEvent ¶
type IOTEvent struct { Name string `yaml:",omitempty"` Description string `yaml:",omitempty"` Enabled bool `yaml:",omitempty"` SQL string `yaml:"sql,omitempty"` SQLVersion string `yaml:"sqlVersion,omitempty"` }
IOTEvent ...
type KeySchema ¶
type KeySchema struct { AttributeName string `yaml:"AttributeName"` KeyType string `yaml:"KeyType"` }
KeySchema ...
type Layer ¶
type Layer struct { Path string Name string `yaml:",omitempty"` Description string `yaml:",omitempty"` CompatibleRuntimes []string `yaml:"compatibleRuntimes,omitempty"` License string `yaml:"licenseInfo,omitempty"` AllowedAccounts []string `yaml:"allowedAccounts,omitempty"` Retain bool `yaml:",omitempty"` }
Layer ...
type LocalIndex ¶
type LocalIndex struct { IndexName string `yaml:"IndexName"` KeySchema []KeySchema `yaml:"KeySchema"` Projection Projection `yaml:"Projection"` }
LocalIndex ...
type LogConfig ¶
type LogConfig struct { RESTAPI bool `yaml:"restApi,omitempty"` WebSocket bool `yaml:"websocket,omitempty"` }
LogConfig ...
type Model ¶
type Model struct { Name string `json:"name"` Type string `json:"type"` Ident flect.Ident `json:"ident"` Attributes map[string]Attribute `json:"attributes"` Nested []*Model `json:"nested"` Imports []string `json:"imports"` KeySchema map[string]string `json:"key_schema"` GeneratedID bool `json:"generated_id"` CompositeKey bool `json:"composite_key"` BillingMode string `json:"billing_mode"` CapacityUnits map[string]int64 `json:"capacity_units"` }
Model represents a resource model object
func New ¶
func New(name string, slice bool, attributes string, options map[string]interface{}) (*Model, error)
New returns a new model object
func (Model) GetConfig ¶
GetConfig returns the updated DQLConfig with the information from this Model
func (*Model) GetImports ¶
GetImports recursively iterates through all import slices and adds the import to the root model
type Package ¶
type Package struct { Excludes []string `yaml:"exclude,omitempty"` Includes []string `yaml:"include,omitempty"` Individually bool `yaml:",omitempty"` }
Package ...
type Projection ¶
type Projection struct { NonKeyAttributes []string `yaml:"NonKeyAttributes,omitempty"` ProjectionType string `yaml:"ProjectionType,omitempty"` }
Projection ...
type Properties ¶
type Properties struct { // Properties for Resources AttributeDefinitions []AttributeDef `yaml:"AttributeDefinitions,omitempty"` KeySchema []KeySchema `yaml:"KeySchema,omitempty"` ProvisionedThroughput *ProvisionedThroughput `yaml:"ProvisionedThroughput,omitempty"` BillingMode string `yaml:"BillingMode,omitempty"` TableName string `yaml:"TableName,omitempty"` LocalSecondaryIndexes []LocalIndex `yaml:"LocalSecondaryIndexes,omitempty"` GlobalSecondaryIndexes []GlobalIndex `yaml:"GlobalSecondaryIndexes,omitempty"` TTLSpecification TTLSpecification `yaml:"TimeToLiveSpecification,omitempty"` //Properties for Authorizer Name string `yaml:"Name,omitempty"` IdentitySource string `yaml:"IdentitySource,omitempty"` RestAPIID Reference `yaml:"RestApiId,omitempty"` Type string `yaml:"Type,omitempty"` ProviderARNs []string `yaml:"ProviderARNs,omitempty"` }
Properties ...
type Provider ¶
type Provider struct { Name string Runtime string Region string Stage string StackName string `yaml:"stackName,omitempty"` APIName string `yaml:"apiName,omitempty"` Profile string `yaml:",omitempty"` MemSize string `yaml:"memorySize,omitempty"` ReservedConcurrency int `yaml:"reservedConcurrency,omitempty"` Timeout int `yaml:"timeout,omitempty"` DeyploymentBucket DeploymentBucket `yaml:"deploymendBucket,omitempty"` DeploymentPrefix string `yaml:"deploymentPrefix,omitempty"` Environments map[string]string `yaml:"environment,omitempty"` RoleStatements []RoleStatement `yaml:"iamRoleStatements,omitempty"` EndpointType string `yaml:"endpointType,omitempty"` NotificationARNs []string `yaml:"notificationArns,omitempty"` Tags map[string]string `yaml:",omitempty"` Tracing TracingConfig `yaml:",omitempty"` Logs LogConfig `yaml:",omitempty"` // contains filtered or unexported fields }
Provider ...
type ProvisionedThroughput ¶
type ProvisionedThroughput struct { ReadCapacityUnits int64 `yaml:"ReadCapacityUnits"` WriteCapacityUnits int64 `yaml:"WriteCapacityUnits"` }
ProvisionedThroughput ...
type Resource ¶
type Resource struct { Ident flect.Ident Attributes map[string]AttributeDefinition }
Resource ...
type ResourceDefinition ¶
type ResourceDefinition struct { DependsOn []string `yaml:"DependsOn,omitempty"` Type string `yaml:"Type"` DeletionPolicy string `yaml:"DeletionPolicy,omitempty"` Properties Properties `yaml:"Properties"` }
ResourceDefinition ...
type Resources ¶
type Resources struct {
Resources map[string]*ResourceDefinition `yaml:"Resources"`
}
Resources ...
type RoleStatement ¶
type RoleStatement struct { Effect string `yaml:"Effect"` Actions []string `yaml:"Action"` Resource string `yaml:"Resource"` }
RoleStatement ...
type SAMFnProp ¶
type SAMFnProp struct { Runtime string `yaml:"Runtime,omitempty"` Handler string `yaml:"Handler,omitempty"` CodeURI string `yaml:"CodeUri,omitempty"` Events map[string]SAMEvent `yaml:"Events,omitempty"` Environment FnEnvironment `yaml:"Environment,omitempty"` }
SAMFnProp ...
type SAMFunction ¶
SAMFunction ...
type SNSEvent ¶
type SNSEvent struct { TopicName string `yaml:"topicName"` DisplayName string `yaml:"displayName,omitempty"` }
SNSEvent ...
type ScheduleEvent ¶
type ScheduleEvent struct { Name string Description string `yaml:",omitempty"` Rate string Enabled bool `yaml:",omitempty"` InputPath string `yaml:"inputPath,omitempty"` }
ScheduleEvent ...
type ServerlessConfig ¶
type ServerlessConfig struct { ProjectPath string `yaml:"-"` Service Service Provider Provider Package Package Functions map[string]*ServerlessFunction `yaml:",omitempty"` Layers map[string]Layer `yaml:",omitempty"` Resources Resources `yaml:",omitempty"` }
ServerlessConfig ...
func (*ServerlessConfig) AddAuth ¶
func (s *ServerlessConfig) AddAuth(excludes string)
AddAuth adds Authorization to the ServerlessConfig
func (*ServerlessConfig) AddFunction ¶
func (s *ServerlessConfig) AddFunction(name, path, method string) *ServerlessConfig
AddFunction adds a Function with given name, path and method to the ServerlessConfig
func (*ServerlessConfig) AddPoolEnv ¶
func (s *ServerlessConfig) AddPoolEnv(ms ServerlessConfig, rName, pool string) error
AddPoolEnv adds the given cognito user pool arn as environment in .env
func (*ServerlessConfig) AddSchema ¶
func (s *ServerlessConfig) AddSchema(schemaName, path string) *ServerlessConfig
AddSchema adds the Schema to the ServerlessConfig
func (*ServerlessConfig) RemoveAuth ¶
func (s *ServerlessConfig) RemoveAuth()
RemoveAuth removes Authorization from the ServerlessConfig
func (*ServerlessConfig) RemoveFunction ¶
func (s *ServerlessConfig) RemoveFunction(n string) *ServerlessConfig
RemoveFunction removes a function from the ServerlessConfig
func (*ServerlessConfig) SetResourceWithModel ¶
func (s *ServerlessConfig) SetResourceWithModel(c *DQLConfig, m *Model)
SetResourceWithModel sets a Resource to the ServerlessConfig
func (*ServerlessConfig) Write ¶
func (s *ServerlessConfig) Write() error
Write writes the ServerlessConfig to serverless.yml
type ServerlessFunction ¶
type ServerlessFunction struct { Handler string Package Package `yaml:",omitempty"` Name string `yaml:",omitempty"` Description string `yaml:",omitempty"` MemorySize int `yaml:",omitempty"` ReservedConcurrency int `yaml:"reservedConcurrency,omitempty"` RunTime string `yaml:"runtime,omitempty"` Timeout int `yaml:",omitempty"` AWSKMSKeyARN string `yaml:"awsKmsKeyArn,omitempty"` Environments map[string]string `yaml:"environment,omitempty"` Tags map[string]string `yaml:",omitempty"` Layers []string `yaml:",omitempty"` Events []Events }
ServerlessFunction ...
type StreamEvent ¶
type StreamEvent struct { ARN string `yaml:"arn"` BatchSize int `yaml:"batchSize,omitempty"` StartingPosition string `yaml:"startingPosition,omitempty"` Enabled bool `yaml:",omitempty"` }
StreamEvent ...
type TTLSpecification ¶
type TTLSpecification struct { AttributeName string `yaml:"AttributeName"` Enabled bool `yaml:"Enabled"` }
TTLSpecification ...
type TemplateConfig ¶
type TemplateConfig struct { ProjectPath string `yaml:"-"` Transform string `yaml:"Transform"` Globals GlobalConfig `yaml:"Globals"` Resources map[string]SAMFunction `yaml:"Resources"` }
TemplateConfig ...
func NewTemplate ¶
func NewTemplate(c *DQLConfig) (*TemplateConfig, error)
NewTemplate returns a new TemplateConfig
func (*TemplateConfig) Write ¶
func (t *TemplateConfig) Write() error
Write writes the TemplateConfig to template.yml
type TracingConfig ¶
type TracingConfig struct { APIGateway bool `yaml:"apiGateway,omitempty"` Lambda bool `yaml:",omitempty"` }
TracingConfig ...
type WebSocketEvent ¶
type WebSocketEvent struct { Route string Authorizer *Authorizer `yaml:",omitempty"` }
WebSocketEvent ...