domain

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package domain provides core mantil domain model. This package is distilled domain knowledge. It should use shared language that allows developers and domain experts to collaborate effectively.

This is the place where all domain decisions are made. It should not depend on other packages, except for the standard library, and project kit package.

Current dependencies: $ run list-packages domain crypto/rand encoding/base32 encoding/json fmt github.com/json-iterator/go github.com/mantil-io/mantil/kit/gz github.com/mantil-io/mantil/kit/schema github.com/mantil-io/mantil/kit/token github.com/pkg/errors gopkg.in/yaml.v2 io io/ioutil os os/user path path/filepath reflect regexp strings time

Index

Constants

View Source
const (
	AccessTokenHeader    = "Authorization"
	EnvPublicKey         = "MANTIL_PUBLIC_KEY"
	ContextUserClaimsKey = "mantilUserClaims"
)
View Source
const (
	AWSCredentialsByArguments = 1
	AWSCredentialsByEnv       = 2
	AWSCredentialsByProfile   = 3
)
View Source
const (
	StateBucketPrefix         = "state"
	FunctionsBucketPrefix     = "functions"
	FunctionsBucketExpireDays = 7
)
View Source
const (
	AwsResourceLambda     = "Lambda Function"
	AwsResourceAPIGateway = "API Gateway"
	AwsResourceS3Bucket   = "S3 Bucket"
	AwsResourceDynamoDB   = "DynamoDB Table"
	AwsResourceStack      = "CloudFormation Stack"
)
View Source
const (
	DefaultNodeName  = "dev"
	DefaultStageName = "dev"

	EnvWorkspace     = "MANTIL_WORKSPACE"
	EnvKey           = "MANTIL_KEY"
	EnvProjectName   = "MANTIL_PROJECT"
	EnvStageName     = "MANTIL_STAGE"
	EnvApiURL        = "MANTIL_API_URL"
	EnvSSMPathPrefix = "MANTIL_SSM_PATH_PREFIX"
	EnvKVTable       = "MANTIL_KV_TABLE"

	SSMPublicKey     = "public_key"
	SSMPrivateKey    = "private_key"
	SSMGithubUserKey = "github_user"

	NodeConfigKey = "config"

	TagWorkspace   = EnvWorkspace
	TagKey         = EnvKey
	TagProjectName = EnvProjectName
	TagStageName   = EnvStageName

	// set to non empty to disable sending events from cli
	EnvNoEvents = "MANTIL_NO_EVENTS"
)
View Source
const (
	EnvMantilConfig = "MANTIL_CONFIG"
)
View Source
const (
	EnvSDKConfig = "MANTIL_GO_CONFIG"
)
View Source
const EnvWorkspacePath = "MANTIL_WORKSPACE_PATH"

enables setting workspace path outside of default can be used in test to don't mess with the default user workspace

View Source
const PublicEnvKey = "mantil_env.js"

Variables

View Source
var (
	ErrNotAuthorized = fmt.Errorf("not authorized")
)
View Source
var (
	ErrWorkspaceNotFound = fmt.Errorf("workspace not found")
)

Functions

func AppConfigDir

func AppConfigDir() (string, error)

func Factory

func Factory(w *Workspace, p *Project, e *EnvironmentConfig) error

Factory proper object model

func FindProjectRoot

func FindProjectRoot(initialPath string) (string, error)

func IsAdmin added in v0.2.11

func IsAdmin(ctx context.Context) (bool, error)

func MachineID

func MachineID() string

func NowMS

func NowMS() int64

func RemoveAWSCredentials

func RemoveAWSCredentials(args []string) []string

func SSMParameterPath added in v0.2.9

func SSMParameterPath(key string) (string, error)

func StoreUserClaims

func StoreUserClaims(claims *AccessTokenClaims, context map[string]interface{})

func UID

func UID() string

16 byte (guid) base64 encoded

func ValidateAWSCron

func ValidateAWSCron(cron string) bool

func Version

func Version() string

current deployment version description

func WorkspacePathAndName

func WorkspacePathAndName() (string, string, error)

Types

type AccessTokenClaims

type AccessTokenClaims struct {
	Workspace string `json:"w,omitempty"`
	Project   string `json:"p,omitempty"`
	Stage     string `json:"s,omitempty"`
	Runtime   string `json:"r,omitempty"`
	Username  string `json:"u,omitempty"`
	Role      Role   `json:"o,omitempty"`
	Node      *Node  `json:"n,omitempty"`
}

func ClaimsFromContext added in v0.2.9

func ClaimsFromContext(ctx context.Context) (*AccessTokenClaims, error)

func ReadAccessToken

func ReadAccessToken(headers map[string]string, publicKey string) (*AccessTokenClaims, error)

type AwsResource

type AwsResource struct {
	Name    string
	AWSName string
	Type    string
}

func (AwsResource) LogGroup

func (r AwsResource) LogGroup() string

type CliCommand

type CliCommand struct {
	Timestamp int64    `short:"t,omitempty" json:"timestamp"`
	Duration  int64    `short:"d,omitempty" json:"duration"`
	Version   string   `short:"v,omitempty" json:"version"`
	Args      []string `short:"a,omitempty" json:"args"`
	Device    struct {
		OS   string `short:"o,omitempty" json:"os"`
		ARCH string `short:"h,omitempty" json:"arch"`
	} `short:"m,omitempty" json:"device,omitempty"`
	Workspace *CliWorkspace `short:"w,omitempty" json:"workspace,omitempty"`
	Project   *CliProject   `short:"p,omitempty" json:"project,omitempty"`
	Stage     *CliStage     `short:"s,omitempty" json:"stage,omitempty"`
	Errors    []CliError    `short:"r,omitempty" json:"errors,omitempty"`
	Events    []Event       `short:"e,omitempty" json:"events,omitempty"`
}

event raised after execution of a cli command

func NewCliCommand

func NewCliCommand(buf []byte) (*CliCommand, error)

func (*CliCommand) Add

func (c *CliCommand) Add(e Event)

func (*CliCommand) AddError

func (c *CliCommand) AddError(e CliError)

func (*CliCommand) Clear

func (c *CliCommand) Clear()

func (*CliCommand) End

func (c *CliCommand) End()

func (*CliCommand) JSON

func (c *CliCommand) JSON() ([]byte, error)

func (*CliCommand) Marshal

func (c *CliCommand) Marshal() ([]byte, error)

func (*CliCommand) Pretty

func (c *CliCommand) Pretty() ([]byte, error)

func (*CliCommand) Start

func (c *CliCommand) Start()

func (*CliCommand) Unmarshal

func (c *CliCommand) Unmarshal(buf []byte) error

type CliError

type CliError struct {
	Error        string `short:"e,omitempty" json:"error"`
	Type         string `short:"t,omitempty" json:"type"`
	SourceFile   string `short:"s,omitempty" json:"sourceFile"`
	FunctionName string `short:"f,omitempty" json:"functionName"`
}

type CliProject

type CliProject struct {
	Name        string `short:"n,omitempty" json:"name"`
	Stages      int    `short:"s,omitempty" json:"stages"`
	Nodes       int    `short:"o,omitempty" json:"nodes"`
	AWSAccounts int    `short:"a,omitempty" json:"awsAccounts"`
	AWSRegions  int    `short:"r,omitempty" json:"awsRegions"`
}

type CliStage

type CliStage struct {
	Name      string `short:"n,omitempty" json:"name"`
	Node      string `short:"o,omitempty" json:"node"`
	Functions int    `short:"f,omitempty" json:"functions"`
}

type CliWorkspace

type CliWorkspace struct {
	ID          string `short:"i,omitempty" json:"id"`
	Nodes       int    `short:"o,omitempty" json:"nodes"`
	Projects    int    `short:"p,omitempty" json:"projects"`
	Stages      int    `short:"s,omitempty" json:"stages"`
	Functions   int    `short:"f,omitempty" json:"functions"`
	AWSAccounts int    `short:"a,omitempty" json:"awsAccounts"`
	AWSRegions  int    `short:"r,omitempty" json:"awsRegions"`
}

type CustomDomain

type CustomDomain struct {
	DomainName       string `yaml:"domain_name"`
	CertDomain       string `yaml:"cert_domain,omitempty"`
	HostedZoneDomain string `yaml:"hosted_zone_domain,omitempty"`
	HttpSubdomain    string `yaml:"http_subdomain,omitempty"`
	WsSubdomain      string `yaml:"ws_subdomain,omitempty"`
}

type Deploy

type Deploy struct {
	Functions struct {
		Added   int `short:"a,omitempty" json:"added"`
		Updated int `short:"u,omitempty" json:"updated"`
		Removed int `short:"r,omitempty" json:"removed"`
	} `short:"f,omitempty" json:"functions,omitempty"`
	InfrastructureChanged bool `short:"i,omitempty" json:"infrastructureChanged"`
	BuildDuration         int  `short:"b,omitempty" json:"buildDuration"`
	UploadDuration        int  `short:"u,omitempty" json:"uploadDuration"`
	UploadBytes           int  `short:"m,omitempty" json:"uploadbytes"`
	UpdateDuration        int  `short:"d,omitempty" json:"updateDuration"`
}

type DeployInfo

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

Collects build time information. Decides where is the deployment location; s3 bucket and key for lambda function pacakges. That information is used in script/deploy.sh to put build artifacts in the right place.

func Deployment

func Deployment() DeployInfo

deployment information where to put/get deployment artifacts (lambda function packages)

func (DeployInfo) GetPath

func (d DeployInfo) GetPath(region string) (string, string)

GetPath returns bucket and key in the bucket for reading deployed functions

func (DeployInfo) LatestBucket

func (d DeployInfo) LatestBucket() string

func (DeployInfo) PutPath

func (d DeployInfo) PutPath() string

PutPath s3 path where we deploy releases it is always in releaseBucket we are replicating this bucket to other regional buckets

func (DeployInfo) Release

func (d DeployInfo) Release() bool

is this release or development deployment

func (DeployInfo) String

func (d DeployInfo) String() string

current deployment description

type EnvironmentConfig

type EnvironmentConfig struct {
	Project ProjectEnvironmentConfig `yaml:"project" jsonschema:"nullable,default={}"`
}

func ValidateEnvironmentConfig

func ValidateEnvironmentConfig(buf []byte) (*EnvironmentConfig, error)

type EnvironmentConfigValidationError

type EnvironmentConfigValidationError struct {
	Err error
}

func (*EnvironmentConfigValidationError) Error

type Event

type Event struct {
	Timestamp   int64       `short:"t,omitempty" json:"timestamp"`
	GoBuild     *GoBuild    `short:"g,omitempty" json:"goBuild,omitempty"`
	Deploy      *Deploy     `short:"d,omitempty" json:"deploy,omitempty"`
	Signal      *Signal     `short:"s,omitempty" json:"signal,omitempty"`
	NodeCreate  *NodeEvent  `short:"nc,omitempty" json:"nodeCreate,omitempty"`
	NodeUpgrade *NodeEvent  `short:"nu,omitempty" json:"nodeUpgrade,omitempty"`
	NodeDelete  *NodeEvent  `short:"nd,omitempty" json:"nodeDelete,omitempty"`
	ProjectNew  *ProjectNew `short:"n,omitempty" json:"projectNew,omitempty"`
	WatchCycle  *WatchCycle `short:"wc,omitempty" json:"watchCycle,omitempty"`
	WatchDone   *WatchDone  `short:"wd,omitempty" json:"watchDone,omitempty"`
}

placeholder for all events only one attribute is not nil

type FileStore

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

func NewSingleDeveloperProjectStore

func NewSingleDeveloperProjectStore() (*FileStore, error)

NewSingleDeveloperProject loads workspace and project config files

func NewSingleDeveloperWorkspaceStore

func NewSingleDeveloperWorkspaceStore() (*FileStore, error)

NewSingleDeveloperWorkspaceStore loads workspace allows to be outside of project

func (*FileStore) AsCliWorkspace

func (s *FileStore) AsCliWorkspace() *CliWorkspace

func (*FileStore) DefaultStage

func (s *FileStore) DefaultStage() *Stage

func (*FileStore) NewProject

func (s *FileStore) NewProject(name, projectRoot string) error

func (*FileStore) Project

func (s *FileStore) Project() *Project

func (*FileStore) ProjectRoot

func (s *FileStore) ProjectRoot() string

func (*FileStore) Stage

func (s *FileStore) Stage(name string) *Stage

func (*FileStore) Store

func (s *FileStore) Store() error

func (*FileStore) Workspace

func (s *FileStore) Workspace() *Workspace

type Function

type Function struct {
	Name                  string `yaml:"name"`
	Hash                  string `yaml:"hash"`
	S3Key                 string `yaml:"s3_key"`
	FunctionConfiguration `yaml:",inline"`
	// contains filtered or unexported fields
}

func (*Function) LambdaName

func (f *Function) LambdaName() string

func (*Function) SetHash

func (f *Function) SetHash(hash string)

type FunctionConfiguration

type FunctionConfiguration struct {
	MemorySize int               `yaml:"memory_size,omitempty" jsonschema:"minimum=128,maximum=10240"`
	Timeout    int               `yaml:"timeout,omitempty" jsonschema:"minimum=1,maximum=900"`
	Env        map[string]string `yaml:"env,omitempty" jsonschema:"nullable"`
	Cron       string            `yaml:"cron,omitempty"`
	Private    bool              `yaml:"private,omitempty"`
}

type FunctionEnvironmentConfig

type FunctionEnvironmentConfig struct {
	Name                  string `yaml:"name"`
	FunctionConfiguration `yaml:",inline"`
}

type GoBuild

type GoBuild struct {
	Name     string `short:"n,omitempty" json:"name"`
	Duration int    `short:"d,omitempty" json:"duration"`
	Size     int    `short:"s,omitempty" json:"size"`
}

type LastDeployment

type LastDeployment struct {
	Version   string `yaml:"version"`
	Timestamp int64  `yaml:"timestamp"`
}

type Node

type Node struct {
	Name    string `yaml:"name,omitempty"`
	ID      string `yaml:"id"`
	Version string `yaml:"version"`
	// AWS related attributes
	AccountID string `yaml:"accountID"` // AWS account id
	Region    string `yaml:"region"`    // AWS region
	Bucket    string `yaml:"bucket"`    // bucket name created on AWS
	CliRole   string `yaml:"cli_role"`  // role name for security node lambda function

	Keys      NodeKeys      `yaml:"keys,omitempty"`
	Endpoints NodeEndpoints `yaml:"endpoints"`
	Functions NodeFunctions `yaml:"functions"`
	Stages    []*NodeStage  `yaml:"stages,omitempty"`

	GithubUser string `yaml:"github_user,omitempty"`
	// contains filtered or unexported fields
}

func (*Node) AddStage

func (n *Node) AddStage(name, projectName, path string)

func (*Node) AuthEnv

func (n *Node) AuthEnv() map[string]string

func (*Node) AuthToken

func (n *Node) AuthToken() (string, error)

func (*Node) GithubAuthEnabled added in v0.2.11

func (n *Node) GithubAuthEnabled() bool

func (*Node) KVTableName added in v0.2.9

func (n *Node) KVTableName() string

func (*Node) RemoveStage

func (n *Node) RemoveStage(name string)

func (*Node) ResourceNamingTemplate

func (n *Node) ResourceNamingTemplate() string

func (*Node) ResourceSuffix

func (n *Node) ResourceSuffix() string

func (*Node) ResourceTags

func (n *Node) ResourceTags() map[string]string

func (*Node) Resources

func (n *Node) Resources() []AwsResource

func (*Node) SetupEnv added in v0.2.9

func (n *Node) SetupEnv() map[string]string

func (*Node) SetupLambdaName

func (n *Node) SetupLambdaName() string

func (*Node) SetupStackName

func (n *Node) SetupStackName() string

func (*Node) UpdateToken added in v0.2.11

func (n *Node) UpdateToken(token string)

func (*Node) UpgradeVersion

func (n *Node) UpgradeVersion(version, functionsBbucket, functionsPath string)

type NodeAlreadyUpToDateError

type NodeAlreadyUpToDateError struct {
	Name    string
	Version string
}

func (*NodeAlreadyUpToDateError) Error

func (e *NodeAlreadyUpToDateError) Error() string

type NodeEndpoints

type NodeEndpoints struct {
	Rest string `yaml:"rest"`
}

type NodeEvent

type NodeEvent struct {
	AWSCredentialsProvider int    `short:"c,omitempty" json:"awsCredentialsProvider"`
	StackDuration          int    `short:"s,omitempty" json:"stackDuration"`
	InfrastructureDuration int    `short:"i,omitempty" json:"infrastructureDuration"`
	AWSRegion              string `short:"r,omitempty" json:"region"`
}

type NodeExistsError

type NodeExistsError struct {
	Name string
}

func (*NodeExistsError) Error

func (e *NodeExistsError) Error() string

type NodeFunctions

type NodeFunctions struct {
	Bucket string `yaml:"bucket"`
	Path   string `yaml:"key"`
}

type NodeKeys

type NodeKeys struct {
	Public  string `yaml:"public"`
	Private string `yaml:"private"`
}

type NodeNotFoundError

type NodeNotFoundError struct {
	Name string
}

func (*NodeNotFoundError) Error

func (e *NodeNotFoundError) Error() string

type NodeStage

type NodeStage struct {
	Name        string `yaml:"name"`
	ProjectName string `yaml:"project_name"`
}

type NodeStore added in v0.2.11

type NodeStore struct {
	Nodes []*NodeStoreEntry `yaml:"nodes"`
	// contains filtered or unexported fields
}

func (*NodeStore) FindNode added in v0.2.11

func (s *NodeStore) FindNode(name string) (*Node, error)

func (*NodeStore) Node added in v0.2.11

func (s *NodeStore) Node(name string) (*Node, error)

func (*NodeStore) RemoveNode added in v0.2.11

func (s *NodeStore) RemoveNode(name string)

func (*NodeStore) Token added in v0.2.11

func (s *NodeStore) Token(nodeName string) string

func (*NodeStore) UpsertNodeToken added in v0.2.11

func (s *NodeStore) UpsertNodeToken(token string) error

type NodeStoreEntry added in v0.2.11

type NodeStoreEntry struct {
	Name  string `yaml:"name"`
	Token string `yaml:"token"`
	// contains filtered or unexported fields
}

type Project

type Project struct {
	Name   string   `yaml:"name"`
	Stages []*Stage `yaml:"stages,omitempty"`
	// contains filtered or unexported fields
}

func (*Project) AsCliProject

func (p *Project) AsCliProject() *CliProject

func (*Project) DefaultStage

func (p *Project) DefaultStage() *Stage

func (*Project) FunctionsBucketPrefix

func (p *Project) FunctionsBucketPrefix() string

func (*Project) NewStage

func (p *Project) NewStage(stageName, nodeName, path string) (*Stage, error)

func (*Project) NumberOfStages

func (p *Project) NumberOfStages() int

func (*Project) RemoveStage

func (p *Project) RemoveStage(stageName string)

func (*Project) SetDefaultStage

func (p *Project) SetDefaultStage(name string)

func (*Project) Stage

func (p *Project) Stage(name string) *Stage

func (*Project) StateBucketPrefix

func (p *Project) StateBucketPrefix() string

type ProjectEnvironmentConfig

type ProjectEnvironmentConfig struct {
	Stages                []StageEnvironmentConfig `yaml:"stages,omitempty" jsonschema:"nullable,default=[]"`
	FunctionConfiguration `yaml:",inline"`
}

func (ProjectEnvironmentConfig) StageEnvConfig

type ProjectNew

type ProjectNew struct {
	Name string `short:"n,omitempty" json:"name"`
	From string `short:"f,omitempty" json:"from"`
	Repo string `short:"r,omitempty" json:"repo"`
}

type ProjectNoStagesError

type ProjectNoStagesError struct{}

func (*ProjectNoStagesError) Error

func (e *ProjectNoStagesError) Error() string

type ProjectNotFoundError

type ProjectNotFoundError struct{}

func (*ProjectNotFoundError) Error

func (e *ProjectNotFoundError) Error() string

type Public

type Public struct {
	Bucket string `yaml:"bucket"`
	Hash   string `yaml:"hash,omitempty"`
}

type Resource

type Resource struct {
	Name string
	Hash string
}

type Role

type Role int
const (
	Admin Role = iota
	User
)

type SDKConfig

type SDKConfig struct {
	ResourceTags    map[string]string
	WsForwarderName string
	NamingTemplate  string
}

this is a copy of the Config struct in mantil.go

func (*SDKConfig) Encode

func (c *SDKConfig) Encode() string

type SSMPathNotFoundError added in v0.2.9

type SSMPathNotFoundError struct{}

func (*SSMPathNotFoundError) Error added in v0.2.9

func (e *SSMPathNotFoundError) Error() string

type Signal

type Signal struct {
	Name  string `short:"n,omitempty" json:"name"`
	Stack string `short:"s,omitempty" json:"stack"`
}

type Stage

type Stage struct {
	Name           string          `yaml:"name"`
	Default        bool            `yaml:"default,omitempty"`
	NodeName       string          `yaml:"node"`
	Keys           StageKeys       `yaml:"keys"`
	Endpoints      *StageEndpoints `yaml:"endpoints,omitempty"`
	LastDeployment *LastDeployment `yaml:"last_deployment,omitempty"`
	Functions      []*Function     `yaml:"functions,omitempty"`
	Public         *Public         `yaml:"public,omitempty"`
	CustomDomain   CustomDomain    `yaml:"custom_domain,omitempty"`
	// contains filtered or unexported fields
}

func (*Stage) AddFunctions

func (s *Stage) AddFunctions(names []string) error

func (*Stage) ApplyChanges

func (s *Stage) ApplyChanges(funcs []Resource, publicHash string) (*StageDiff, error)

func (*Stage) AsCliStage

func (s *Stage) AsCliStage() *CliStage

func (*Stage) AuthEnv

func (s *Stage) AuthEnv() map[string]string

func (*Stage) AuthToken

func (s *Stage) AuthToken() (string, error)

func (*Stage) BucketPrefixes

func (s *Stage) BucketPrefixes() []string

func (*Stage) FindFunction

func (s *Stage) FindFunction(name string) *Function

func (*Stage) FunctionNames

func (s *Stage) FunctionNames() []string

func (*Stage) FunctionsBucketPrefix

func (s *Stage) FunctionsBucketPrefix() string

func (*Stage) HasPublic

func (s *Stage) HasPublic() bool

func (*Stage) LogGroupsPrefix

func (s *Stage) LogGroupsPrefix() string

func (*Stage) Node

func (s *Stage) Node() *Node

func (*Stage) Project

func (s *Stage) Project() *Project

func (*Stage) PublicBucketName

func (s *Stage) PublicBucketName() string

func (*Stage) PublicEnv

func (s *Stage) PublicEnv() ([]byte, error)

func (*Stage) RemoveFunctions

func (s *Stage) RemoveFunctions(removed []string)

func (*Stage) ResourceNamingTemplate

func (s *Stage) ResourceNamingTemplate() string

func (*Stage) ResourceTags

func (s *Stage) ResourceTags() map[string]string

func (*Stage) Resources

func (s *Stage) Resources() []AwsResource

Resources list of resources created for the stage

func (*Stage) RestEndpoint

func (s *Stage) RestEndpoint() string

func (*Stage) SetEndpoints

func (s *Stage) SetEndpoints(rest, ws string)

func (*Stage) SetLastDeployment

func (s *Stage) SetLastDeployment()

func (*Stage) SetPublicBucket

func (s *Stage) SetPublicBucket(bucket string)

func (*Stage) StateBucketPrefix

func (s *Stage) StateBucketPrefix() string

func (*Stage) WsConfig

func (s *Stage) WsConfig() WsConfig

func (*Stage) WsEndpoint

func (s *Stage) WsEndpoint() string

func (*Stage) WsEnv

func (s *Stage) WsEnv() map[string]string

func (*Stage) WsForwarderLambdaName

func (s *Stage) WsForwarderLambdaName() string

type StageDiff

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

func (*StageDiff) FunctionsAddedUpdatedRemoved

func (d *StageDiff) FunctionsAddedUpdatedRemoved() (int, int, int)

func (*StageDiff) HasFunctionUpdates

func (d *StageDiff) HasFunctionUpdates() bool

func (*StageDiff) HasPublicUpdates

func (d *StageDiff) HasPublicUpdates() bool

func (*StageDiff) HasUpdates

func (d *StageDiff) HasUpdates() bool

func (*StageDiff) InfrastructureChanged

func (d *StageDiff) InfrastructureChanged() bool

func (*StageDiff) UpdatedFunctions

func (d *StageDiff) UpdatedFunctions() []string

type StageEndpoints

type StageEndpoints struct {
	Rest string `yaml:"rest"`
	Ws   string `yaml:"ws"`
}

type StageEnvironmentConfig

type StageEnvironmentConfig struct {
	Name                  string                      `yaml:"name"`
	Functions             []FunctionEnvironmentConfig `yaml:"functions,omitempty"`
	FunctionConfiguration `yaml:",inline"`
	CustomDomain          CustomDomain `yaml:"custom_domain,omitempty" jsonschema:"nullable,default={}"`
}

func (StageEnvironmentConfig) FunctionEnvConfig

func (c StageEnvironmentConfig) FunctionEnvConfig(name string) FunctionEnvironmentConfig

type StageExistsError

type StageExistsError struct {
	Name string
}

func (*StageExistsError) Error

func (e *StageExistsError) Error() string

type StageKeys

type StageKeys struct {
	Public  string `yaml:"public"`
	Private string `yaml:"private"`
}

type TokenExpiredError added in v0.2.9

type TokenExpiredError struct{}

func (*TokenExpiredError) Error added in v0.2.9

func (e *TokenExpiredError) Error() string

type ValidationError

type ValidationError struct {
	Name string
}

func ValidateName

func ValidateName(name string) *ValidationError

func (*ValidationError) Error

func (e *ValidationError) Error() string

type WatchCycle

type WatchCycle struct {
	Duration   int  `short:"d,omitempty" json:"duration"`
	CycleNo    int  `short:"c,omitempty" json:"cycleNo"`
	HasUpdates bool `short:"b,omitempty" json:"hasUpdates"`
	Invoke     bool `short:"i,omitempty" json:"invoke"`
	Test       bool `short:"t,omitempty" json:"test"`
}

type WatchDone

type WatchDone struct {
	Cycles int `short:"c,omitempty" json:"cycles"`
}

type Workspace

type Workspace struct {
	ID        string              `yaml:"id"`
	Version   string              `yaml:"version"`
	CreatedAt int64               `yaml:"created_at"`
	Projects  []*WorkspaceProject `yaml:"projects,omitempty"`
	Nodes     []*Node             `yaml:"nodes"`
	NodeStore NodeStore           `yaml:"node_store,omitempty"`
}

func (*Workspace) AddNode added in v0.2.9

func (w *Workspace) AddNode(n *Node)

func (*Workspace) AddNodeToken added in v0.2.11

func (w *Workspace) AddNodeToken(token string) error

func (*Workspace) AddProject

func (w *Workspace) AddProject(name, path string)

func (*Workspace) FindNode

func (w *Workspace) FindNode(name string) *Node

func (*Workspace) NewNode

func (w *Workspace) NewNode(name, awsAccountID, awsRegion, functionsBucket, functionsPath, version string, githubUser string) (*Node, error)

func (*Workspace) Node

func (w *Workspace) Node(name string) *Node

func (*Workspace) NodeList added in v0.2.11

func (w *Workspace) NodeList() ([]*Node, error)

func (*Workspace) NodeNames

func (w *Workspace) NodeNames() []string

func (*Workspace) RemoveNode

func (w *Workspace) RemoveNode(name string)

func (*Workspace) RemoveProject

func (w *Workspace) RemoveProject(name string)

type WorkspaceNoNodesError

type WorkspaceNoNodesError struct{}

func (*WorkspaceNoNodesError) Error

func (e *WorkspaceNoNodesError) Error() string

type WorkspaceProject

type WorkspaceProject struct {
	Name string `yaml:"name"`
	Path string `yaml:"path"`
}

type WsConfig

type WsConfig struct {
	ApiToFn map[string]string `json:"apiToFn"`
}

func (WsConfig) Encode

func (c WsConfig) Encode() string

Jump to

Keyboard shortcuts

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