Documentation
¶
Index ¶
- func EvalFile(inputFile *File, prompt bool, env conf.Configuration, artHome string) error
- func EvalSecret(inputSecret *Secret, prompt bool, env conf.Configuration) error
- func EvalVar(inputVar *Var, prompt bool, env conf.Configuration) error
- func NormInputName(name string) string
- type Access
- type BuildFile
- func (b *BuildFile) DefaultProfile() *Profile
- func (b *BuildFile) ExportFxs() bool
- func (b *BuildFile) Fx(name string) *Function
- func (b *BuildFile) GetEnv() map[string]string
- func (b *BuildFile) GetXEnv() *merge.Envar
- func (b *BuildFile) Profile(name string) *Profile
- func (b *BuildFile) Validate() (bool, error)
- type File
- type Files
- type Function
- type FxInfo
- type Group
- type GroupInfo
- type GroupsInfo
- type Input
- func SurveyInputFromBuildFile(fxName string, buildFile *BuildFile, prompt, defOnly bool, ...) (*Input, error)
- func SurveyInputFromManifest(flowName, stepName, packageSource, domain string, fxName string, ...) (*Input, error)
- func SurveyInputFromURI(uri string, prompt, defOnly bool, env conf.Configuration, artHome string) (*Input, error)
- func (i *Input) Env() *merge.Envar
- func (i *Input) HasSecret(name string) bool
- func (i *Input) HasSecretBinding(binding string) bool
- func (i *Input) HasVar(name string) bool
- func (i *Input) HasVarBinding(binding string) bool
- func (i *Input) Merge(in *Input)
- func (i *Input) SecretExist(name string) bool
- func (i *Input) SurveyRegistryCreds(flowName, stepName, packageSource, domain string, prompt, defOnly bool, ...) error
- func (i *Input) ToEnvFile() []byte
- func (i *Input) VarExist(name string) bool
- type InputBinding
- type Manifest
- type Network
- type Profile
- type Role
- type RunHandler
- type Seal
- func (seal *Seal) DSha256(path string) (string, error)
- func (seal *Seal) NoAuthority() bool
- func (seal *Seal) PackageId() (string, error)
- func (seal *Seal) SealFile(registryRoot string) string
- func (seal *Seal) Valid(path string) (valid bool, err error)
- func (seal *Seal) ZipFile(registryRoot string) string
- type Secret
- type Secrets
- type Tag
- type Var
- type Vars
- type VerifyHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvalSecret ¶
func EvalSecret(inputSecret *Secret, prompt bool, env conf.Configuration) error
func NormInputName ¶
NormInputName ensure the passed in name is formatted as a valid environment variable name
Types ¶
type BuildFile ¶
type BuildFile struct {
// the URI of the Git repo
GitURI string `yaml:"git_uri,omitempty"`
// the runtime to use to run functions
Runtime string `yaml:"runtime,omitempty"`
// the environment variables that apply to the build
// any variables defined at this level will be available to all build profiles
// in addition, the defined variables are added on top of the existing environment
Env map[string]string `yaml:"env,omitempty"`
// a list of labels to be added to the package seal
// they should be used to document key aspects of the package in a generic way
Labels map[string]string `yaml:"labels,omitempty"`
// any input required by functions
Input *Input `yaml:"input,omitempty"`
// a list of build configurations in the form of labels, commands to run and environment variables
Profiles []*Profile `yaml:"profiles,omitempty"`
// a list of functions containing a list of commands to execute
Functions []*Function `yaml:"functions"`
// include other build files
Includes []interface{} `yaml:"includes"`
SKU string `yaml:"sku"`
X map[string]string `json:"x,omitempty"`
// contains filtered or unexported fields
}
BuildFile structure of build.yaml file
func LoadBuildFile ¶
func LoadBuildFileWithEnv ¶
func (*BuildFile) DefaultProfile ¶
DefaultProfile return the default profile if exists
type Function ¶
type Function struct {
// the name of the function
Name string `yaml:"name"`
// the description for the function
Description string `yaml:"description,omitempty"`
// a set of environment variables required by the run commands
Env map[string]string `yaml:"env,omitempty"`
// the commands to be executed by the function
Run []string `yaml:"run,omitempty"`
// is this function to be available in the manifest
Export *bool `yaml:"export,omitempty"`
// defines any bindings to inputs required to run this function
Input *InputBinding `yaml:"input,omitempty"`
// the runtime to run this function
Runtime string `yaml:"runtime,omitempty"`
Credits int `yaml:"credits,omitempty"`
Network *Network `json:"network,omitempty"`
}
func (*Function) Survey ¶
func (f *Function) Survey(env conf.Configuration) conf.Configuration
Survey all missing variables in the function pass in any available environment variables so that they are not surveyed
type FxInfo ¶
type FxInfo struct {
Name string `json:"name"`
Description string `json:"description"`
Input *Input `json:"input,omitempty"`
Credits int `json:"credits,omitempty"`
Runtime string `json:"runtime,omitempty"` // runtime image that should be used to execute functions in the package
Network *Network `json:"network,omitempty"`
}
FxInfo exported function list
type GroupsInfo ¶
type GroupsInfo []GroupInfo
func (*GroupsInfo) GroupIx ¶
func (gs *GroupsInfo) GroupIx(name string) int
type Input ¶
type Input struct {
// required by configuration files
File Files `yaml:"file,omitempty" json:"file,omitempty"`
// required string value secrets
Secret Secrets `yaml:"secret,omitempty" json:"secret,omitempty"`
// required variables
Var Vars `yaml:"var,omitempty" json:"var,omitempty"`
}
Input describes exported input information required by functions or runtimes
func SurveyInputFromBuildFile ¶
func SurveyInputFromBuildFile(fxName string, buildFile *BuildFile, prompt, defOnly bool, env conf.Configuration, artHome string) (*Input, error)
SurveyInputFromBuildFile extracts the build file Input that is relevant to a function (using its bindings)
func SurveyInputFromManifest ¶
func SurveyInputFromManifest(flowName, stepName, packageSource, domain string, fxName string, manifest *Manifest, prompt, defOnly bool, env conf.Configuration, artHome string) (*Input, error)
SurveyInputFromManifest extracts the package manifest Input in an exported function
func SurveyInputFromURI ¶
func (*Input) HasSecretBinding ¶
func (*Input) HasVarBinding ¶
func (*Input) SecretExist ¶
func (*Input) SurveyRegistryCreds ¶
type InputBinding ¶
type InputBinding struct {
Var []string `yaml:"var"`
Secret []string `yaml:"secret"`
Key []string `yaml:"key"`
File []string `yaml:"file"`
}
InputBinding list the names of the inputs required by a function
type Manifest ¶
type Manifest struct {
// the author of the package
Author string `json:"author,omitempty"`
// the signing and verification authority for the package
Authority []string `json:"authority,omitempty"`
// the package type
Type string `json:"type,omitempty"`
// the license associated to the package
License string `json:"license,omitempty"`
// the target OS for the package
OS string `json:"os"`
// the name of the package file
Ref string `json:"ref"`
// the build profile used
Profile string `json:"profile"`
// runtime image that should be used to execute exported functions in the package
Runtime string `json:"runtime,omitempty"`
// the labels assigned to the package
Labels map[string]string `json:"labels,omitempty"`
// the URI of the package source
Source string `json:"source,omitempty"`
// the path within the source where the project is (for uber repos)
SourcePath string `json:"source_path,omitempty"`
// the commit hash
Commit string `json:"commit,omitempty"`
// repo branch
Branch string `json:"branch,omitempty"`
// the name of the file or folder that has been packaged
Target string `json:"target,omitempty"`
// the timestamp
Time string `json:"time"`
// the size of the package
Size string `json:"size"`
// the Stock Keeping Unit code
SKU string `json:"SKU,omitempty"`
// what functions are available to call?
Functions []*FxInfo `json:"functions,omitempty"`
OpenPolicy string `json:"open_policy,omitempty"`
RunPolicy string `json:"run_policy,omitempty"`
SignPolicy string `json:"sign_policy,omitempty"`
}
func (*Manifest) ToMarkDownBytes ¶
type Network ¶
func (*Network) AllocateIPs ¶
func (n *Network) AllocateIPs(ipList ...string) (GroupsInfo, error)
type Profile ¶
type Profile struct {
// the name of the profile
Name string `yaml:"name"`
// whether this is the default profile
Default bool `yaml:"default"`
// the name of the application
Application string `yaml:"application"`
// the type of license used by the application
// if not empty, it is added to the package seal
License string `yaml:"license"`
// the type of technology used by the application that can be used to determine the tool chain to use
// e.g. java, nodejs, golang, python, php, etc
Type string `yaml:"type"`
// the pipeline Icon
Icon string `yaml:"icon"`
// a set of labels associated with the profile
Labels map[string]string `yaml:"labels"`
// a set of environment variables required by the run commands
Env map[string]string `yaml:"env"`
// the commands to be executed to build the application
Run []string `yaml:"run"`
// the output of the build process, namely either a file or a folder, that has to be compressed
// as part of the packaging process
Target string `yaml:"target"`
// merged target if existed, internal use only
MergedTarget string
}
type RunHandler ¶
type RunHandler func(name *core.PackageName, fx string, seal *Seal) error
type Seal ¶
type Seal struct {
// the package metadata
Manifest *Manifest `json:"manifest"`
// the combined checksum of the package and its metadata
Digest string `json:"digest"`
// the map of digital seals for this package
Seal map[string]string `json:"seal,omitempty"`
}
Seal the digital Seal for a package the Seal contains information to determine if the package or its metadata has been compromised and therefore the Seal is broken
func (*Seal) DSha256 ¶
DSha256 calculates the package SHA-256 digest by taking the combined checksum of the Seal information and the compressed file
func (*Seal) NoAuthority ¶
NoAuthority returns true if the seal does not have an authority
func (*Seal) PackageId ¶
PackageId the package id calculated as the hex encoded SHA-256 digest of the artefact Seal
type Secret ¶
type Secret struct {
// the unique reference for the secret
Name string `yaml:"name" json:"name"`
// a description of the intended use or meaning of this secret
Description string `yaml:"description" json:"description"`
// the value of the secret
Value string `yaml:"value,omitempty" json:"value,omitempty"`
// the value is required
Required bool `yaml:"required,omitempty" json:"required,omitempty"`
}
Secret describes the secrets required by functions
type Var ¶
type Var struct {
Name string `yaml:"name" json:"name"`
Description string `yaml:"description" json:"description"`
Required bool `yaml:"required" json:"required"`
Type string `yaml:"type" json:"type"`
Value string `yaml:"value,omitempty" json:"value,omitempty"`
Default string `yaml:"default,omitempty" json:"default,omitempty"`
}