entity

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Function

type Function struct {
	Name       string  `toml:"name"`
	Arn        string  `toml:"arn"`
	MemorySize int64   `toml:"memory_size"`
	Timeout    int64   `toml:"timeout"`
	Role       string  `toml:"role"`
	Schedule   *string `toml:"schedule"`
}

Function is the entity struct which maps from configuration.

type Integration

type Integration struct {
	Id              string  `toml:"resource_id"`
	IntegrationType string  `toml:"type"`
	LambdaFunction  *string `toml:"lambda_function"`
	Path            string  `toml:"path"`
	BucketPath      *string `toml:"bucket_path"`
	ProxyResourceId *string `toml:"proxy_resource_id"`
}

Integration is the struct which maps api.resources.integration field. Integration type accepts on "lambda" or "s3":

If IntegrationType is "s3", Bucket field must not be empty.
If IntegrationType is "lambda", LambdaFunction must not be empty.

func NewIntegration

func NewIntegration(iType, value, path string) *Integration

func (*Integration) String

func (i *Integration) String() string

type Resource

type Resource struct {
	Id           string                  `toml:"id"`
	Path         string                  `toml:"path"`
	Integrations map[string]*Integration `toml:"integrations"`
	UserDefined  bool                    `toml:"user_defined"`
}

Resource is the entity struct which maps 'api.resources' slice in configuration.

func NewResource

func NewResource(id, path string) *Resource

func (*Resource) AddIntegration

func (r *Resource) AddIntegration(method string, ig *Integration)

func (*Resource) DeleteIntegration

func (r *Resource) DeleteIntegration(method string)

func (*Resource) GetIntegration

func (r *Resource) GetIntegration(method string) *Integration

func (*Resource) GetIntegrations

func (r *Resource) GetIntegrations() map[string]*Integration

type Scheduler

type Scheduler struct {
	Name       string   `toml:"name"`
	Arn        string   `toml:"arn"`
	Enable     bool     `toml:"enable"`
	Expression string   `toml:"expression"`
	Functions  []string `toml:"functions"`
}

Scheduler is the entity struct which maps from configuration.

type Stage

type Stage struct {
	Name      string            `toml:"name"`
	Variables map[string]string `toml:"variables"`
}

type StorageObject

type StorageObject struct {
	Data     []byte
	Key      string
	MimeType string
	Info     os.FileInfo
}

func NewStorageObject

func NewStorageObject(key string, info os.FileInfo) *StorageObject

func (*StorageObject) Load

func (s *StorageObject) Load(path string) (err error)

Jump to

Keyboard shortcuts

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