config

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Global = Config{}

Global is the object that contains your configuration

Functions

This section is empty.

Types

type Config

type Config struct {
	TemplateFormatVersion string    `yaml:"TemplateFormatVersion"`
	Description           string    `yaml:"Description"`
	Resources             Resources `yaml:"Resources"`
}

func (*Config) FromFile added in v0.1.8

func (c *Config) FromFile(path string) error

carega as configuracoes do arquivo de configuração

func (*Config) Load

func (config *Config) Load(data []byte) error

Load is the function responsible for unmarshaling the configuration YAML file into an object that can be used by the DynamoDBClient.

type DynamoAttributes added in v0.1.8

type DynamoAttributes struct {
	Key                map[string]*dynamodb.AttributeValue
	KeyAttributeValues map[string]*dynamodb.AttributeValue
	KeyAttributeNames  map[string]*string
	AttributeNames     map[string]*string
	AttributeValues    map[string]*dynamodb.AttributeValue
	KeyCondition       string
	UpdateExpression   string
}

type Properties added in v0.1.8

type Properties struct {
	// ApiGateway Receiver
	AllowedMethods []string          `yaml:"AllowedMethods"`
	AllowedPath    map[string]string `yaml:"AllowedPath"`

	// DynamoDB Connector
	TableName     string                 `yaml:"TableName"`
	Keys          map[string]string      `yaml:"Keys"`
	Filter        []string               `yaml:"Filters"`
	FilterValues  map[string]interface{} `yaml:"FilterValues"`
	OutputColumns []string               `yaml:"OutputColumns"`
}

type ResourceItem added in v0.1.8

type ResourceItem struct {
	ObjectPathSchema string `yaml:"ObjectPathSchema"`
	ResourceType     string `yaml:"ResourceType"`

	Properties Properties `yaml:"Properties"`
}

func (*ResourceItem) EncodeJSON added in v0.1.8

func (res *ResourceItem) EncodeJSON(data map[string]interface{}) (interface{}, error)

func (*ResourceItem) GetAllAttributeNames added in v0.1.8

func (res *ResourceItem) GetAllAttributeNames(data interface{}) (map[string]*string, error)

Returns the names of all attributes

func (*ResourceItem) GetAllAttributeValues added in v0.1.8

func (res *ResourceItem) GetAllAttributeValues(data interface{}) (map[string]*dynamodb.AttributeValue, error)

Returns the values of all attributes

func (*ResourceItem) GetAttributeNames added in v0.1.8

func (res *ResourceItem) GetAttributeNames(data interface{}) (map[string]*string, error)

Returns the names of all attributes, except those who make up the primary key

func (*ResourceItem) GetAttributeValues added in v0.1.8

func (res *ResourceItem) GetAttributeValues(data interface{}) (map[string]*dynamodb.AttributeValue, error)

Returns the values of all attributes except those that make up the primary key

func (*ResourceItem) GetKeyAttributeNames added in v0.1.8

func (res *ResourceItem) GetKeyAttributeNames(data interface{}) (map[string]*string, error)

func (*ResourceItem) GetKeyAttributeValues added in v0.1.8

func (res *ResourceItem) GetKeyAttributeValues(data interface{}) (map[string]*dynamodb.AttributeValue, error)

func (*ResourceItem) GetKeyConditions added in v0.1.8

func (res *ResourceItem) GetKeyConditions(data interface{}) (string, error)

func (*ResourceItem) GetPrimaryKeyAttributeValue added in v0.1.8

func (res *ResourceItem) GetPrimaryKeyAttributeValue(data interface{}) (map[string]*dynamodb.AttributeValue, error)

Recovers the primary key from the table

func (*ResourceItem) GetToken added in v0.1.12

func (res *ResourceItem) GetToken() (*string, error)

func (*ResourceItem) GetUpdateExpression added in v0.1.8

func (res *ResourceItem) GetUpdateExpression(data interface{}) (string, error)

func (*ResourceItem) MarshalMap added in v0.1.8

func (res *ResourceItem) MarshalMap(data map[string]interface{}) (map[string]*dynamodb.AttributeValue, error)

Estrutura dados para criação de registro

func (*ResourceItem) UnmarshalSchema added in v0.1.8

func (res *ResourceItem) UnmarshalSchema() (map[string]interface{}, error)

Pega o schema do arquivo json

func (*ResourceItem) Validate added in v0.1.8

func (res *ResourceItem) Validate(data map[string]interface{}) bool

Valida formato do json de acordo com o schema

type Resources

type Resources struct {
	Receiver  ResourceItem `yaml:"Receiver"`
	Connector ResourceItem `yaml:"Connector"`
}

Jump to

Keyboard shortcuts

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