Documentation ¶
Index ¶
- func CheckDuplicates(models []Model) error
- func Checksum(files, ignore []string) ([]byte, error)
- func CollectSource(dir string, ignore []string) ([]string, error)
- func Compress(files []string) (io.Reader, error)
- func Upload(data io.Reader, url string) error
- func Walk(dir string, ignoreDirs []string) ([]string, error)
- type Deployment
- type DeploymentSpec
- type Function
- type FunctionAWSSpec
- type FunctionSpec
- type Meta
- type Model
- type ModelType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDuplicates ¶
CheckDuplicates checks that the list of models doesn't have one or more models with the same type and name
func Checksum ¶
Checksum calculates the sha1 checksum of a the contents of a list of files. The files are processed in the order of the input so sort the files to ensure consistent hashing. Returns an error in case no files were provided or all files were filtered by the ignore.
func CollectSource ¶
CollectSource collects source files belonging to a function. Directories and files that match the ignore patterns are excluded.
Types ¶
type Deployment ¶
type Deployment interface {
Deployment() *DeploymentSpec
}
Deployment is the configuration for a deployment on disk.
type DeploymentSpec ¶
type DeploymentSpec struct { // EnvironmentLabels is the label seletor for which environment(s) should be // the destination of the deployment. The environment must have every label // assigned to be included. EnvironmentLabels map[string]string `json:"environment"` // FunctionLabels is the label selector for which function(s) should be part // of the deployment. Every label must match for the function to be included. FunctionLabels map[string]string `json:"function"` }
DeploymentSpec represents a deployment.
type Function ¶
type Function interface {
Function() *FunctionSpec
}
Function is the configuration for a function on disk.
type FunctionAWSSpec ¶
type FunctionAWSSpec struct { // Timeout is the timeout in seconds for the function Timeout int64 `json:"timeout,omitempty"` // Memory is the memory in mb for the function Memory int64 `json:"memory,omitempty"` }
FunctionAWSSpec contains AWS function (Lambda) specific configuration info.
type FunctionSpec ¶
type FunctionSpec struct { // Runtime is the function runtime. Runtime string `json:"runtime"` // AWS is the Amazon Web Services specific configuration for the function. AWS *FunctionAWSSpec `json:"aws,omitempty"` }
FunctionSpec represents a function specification.
type Meta ¶
type Meta struct { // Name is the name for a model. It must be unique among other model of the same type. Name string `json:"name"` // Labels are used to identify a model. Labels map[string]string `json:"labels"` }
Meta contains metadata for a model.
type Model ¶
type Model interface { // File is the configuration file the model definition was parsed from. File() string // Meta contains metadata for a model. Meta() *Meta // Type defines what type of model this is. Type() ModelType // contains filtered or unexported methods }
Model is a generic model on disk. It can represent any model type.