Version: v0.18.0 Latest Latest

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

Go to latest
Published: Jul 22, 2019 License: MIT Imports: 12 Imported by: 0




This section is empty.


View Source
var ResourceNotFound = errors.New("Resource not found")


This section is empty.


type Config

type Config struct {
	Root          string `toml:"-"`
	Path          string `toml:"-"`
	FunctionPath  string `toml:"-"`
	LibPath       string `toml:"-"`
	StoragePath   string `toml:"-"`
	StagePath     string `toml:"-"`
	SchedulerPath string `toml:"-"`

	RestApiId         string             `toml:"rest_api_id"`
	ProjectName       string             `toml:"project_name"`
	Profile           string             `toml:"profile"`
	Region            string             `toml:"region"`
	DefaultLambdaRole string             `toml:"default_lambda_role"`
	S3BucketName      string             `toml:"s3_bucket_name"`
	DeployHookCommand string             `toml:"deploy_hook_command"`
	Resources         []*entity.Resource `toml:"resources"`
	LocalPackages     []string           `toml:"local_packages"`

	Queue map[string]*entity.Function `toml:"-"`
	// contains filtered or unexported fields

Config is the struct which maps configuration file into this. Ensure call Write() to update configuration.

func Load

func Load() *Config

Load loads configuration and map to Config struct. this function always returns although the config file didn't exist. Then you can confirm as Exists() on config file exists or not.

func (*Config) ChooseFunction

func (c *Config) ChooseFunction() string

func (*Config) ChooseResource

func (c *Config) ChooseResource() string

func (*Config) ChooseScheduler

func (c *Config) ChooseScheduler() string

func (*Config) DeleteFunction

func (c *Config) DeleteFunction(name string) error

func (*Config) DeleteResource

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

func (*Config) DeleteScheduler

func (c *Config) DeleteScheduler(name string) error

func (*Config) DeleteStage

func (c *Config) DeleteStage(name string) error

func (*Config) Exists

func (c *Config) Exists() bool

Exists() returns bool which config file exists or not.

func (*Config) FindSubResources

func (c *Config) FindSubResources(prefix string) []*entity.Resource

func (*Config) LoadAllFunctions

func (c *Config) LoadAllFunctions() ([]*entity.Function, error)

func (*Config) LoadAllSchedulers

func (c *Config) LoadAllSchedulers() ([]*entity.Scheduler, error)

func (*Config) LoadAllStages

func (c *Config) LoadAllStages() ([]*entity.Stage, error)

func (*Config) LoadFunction

func (c *Config) LoadFunction(name string) (*entity.Function, error)

func (*Config) LoadResource

func (c *Config) LoadResource(path string) (*entity.Resource, error)

func (*Config) LoadScheduler

func (c *Config) LoadScheduler(name string) (*entity.Scheduler, error)

func (*Config) LoadStage

func (c *Config) LoadStage(name string) (*entity.Stage, error)

func (*Config) SortResources

func (c *Config) SortResources()

Sort resources by shorter path to access by shorter resource

func (*Config) Write

func (c *Config) Write()

Write() writes configuration to file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL