Documentation ¶
Index ¶
- Variables
- func Clone(url string) (string, error)
- func Download(url string) (string, error)
- func IsBuildTemplate(path string) bool
- func IsDir(path string) bool
- func IsGit(path string) bool
- func IsGitFile(path string) (string, string)
- func IsLocal(path string) bool
- func IsRegistry(path string) bool
- func IsRemote(path string) bool
- func MakeDir(path string) error
- func RandString(n int) string
- func RandStringDNS(n int) string
- func Write(filename, data string) error
- type Copy
- type Definition
- type Function
- type Schedule
- type TriggermeshProvider
Constants ¶
This section is empty.
Variables ¶
var Aos = afero.NewOsFs()
Aos returns filesystem object with standard set of os methods implemented by afero package
Functions ¶
func Clone ¶
Clone runs `git clone` operation for specified URL and returns local path to repository root directory
func IsBuildTemplate ¶ added in v0.0.12
IsBuildTemplate reads file located in provided path and returns true if file contains BuildTemplate knative object
func IsGitFile ¶ added in v0.0.10
IsGitFile accepts string and, if this string is git repsotiry, returns URL to clone and relative file path inside cloned repository directory Otherwise it returns empty strings
func IsRegistry ¶
IsRegistry return true if path "behaves" like URL to docker registry
func RandString ¶ added in v0.0.12
RandString accepts integer value N and returns random string with length of N
func RandStringDNS ¶ added in v0.0.12
RandStringDNS accepts integer value N and returns "DNS-friendly" random string with length of N
Types ¶
type Copy ¶
Copy contains information to copy local path to remote destination
type Definition ¶ added in v0.0.8
type Definition struct { Service string `yaml:"service,omitempty"` Description string `yaml:"description,omitempty"` Provider TriggermeshProvider `yaml:"provider,omitempty"` Repository string `yaml:"repository,omitempty"` Functions map[string]Function `yaml:"functions,omitempty"` Include []string `yaml:"include,omitempty"` }
Definition represents serverless.yaml file structure
func ParseManifest ¶ added in v0.0.11
func ParseManifest(path string) (Definition, error)
ParseManifest accepts serverless yaml file path and returns decoded structure
func (Definition) Validate ¶ added in v0.0.11
func (definition Definition) Validate() error
Validate function verifies that provided service Definition object contains required set of keys and values
type Function ¶
type Function struct { Handler string `yaml:"handler,omitempty"` Source string `yaml:"source,omitempty"` Revision string `yaml:"revision,omitempty"` Runtime string `yaml:"runtime,omitempty"` Concurrency int `yaml:"concurrency,omitempty"` Buildargs []string `yaml:"buildargs,omitempty"` Description string `yaml:"description,omitempty"` Labels []string `yaml:"labels,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` EnvSecrets []string `yaml:"env-secrets,omitempty"` Annotations map[string]string `yaml:"annotations,omitempty"` Events []map[string]interface{} `yaml:"events,omitempty"` }
Function describes function definition in serverless format
type Schedule ¶ added in v0.0.10
Schedule represents simple structure of event schedule with cronjob-style rate string and data to use in event. Deprecated.
type TriggermeshProvider ¶ added in v0.0.12
type TriggermeshProvider struct { Name string `yaml:"name,omitempty"` Registry string `yaml:"registry,omitempty"` RegistrySecret string `yaml:"registry-secret,omitempty"` PullPolicy string `yaml:"pull-policy,omitempty"` Namespace string `yaml:"namespace,omitempty"` Runtime string `yaml:"runtime,omitempty"` Buildtimeout string `yaml:"buildtimeout,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` EnvSecrets []string `yaml:"env-secrets,omitempty"` Annotations map[string]string `yaml:"annotations,omitempty"` }
TriggermeshProvider structure contains serverless provider parameters specific to triggermesh