Documentation
¶
Index ¶
- Variables
- func MiddlewareVersion(src, runtime, invoke string, fs filesystem.Filesystem) (string, error)
- func MiddlewareVersions(fs filesystem.Filesystem) (map[string]map[string]string, error)
- func Write(out, src, runtime, invoke string, fs filesystem.Filesystem) (err error)
- type ErrDetectorNotImplemented
- type ErrRuntimeNotRecognized
- type ScaffoldingError
- type Signature
- type SignatureError
Constants ¶
This section is empty.
Variables ¶
var ErrFilesystemRequired = ScaffoldingError{"filesystem required", nil}
var ErrScaffoldingNotFound = ScaffoldingError{"scaffolding not found", nil}
var ErrSignatureNotFound = ScaffoldingError{"supported signature not found", nil}
Functions ¶
func MiddlewareVersion ¶ added in v0.48.0
func MiddlewareVersion(src, runtime, invoke string, fs filesystem.Filesystem) (string, error)
MiddlewareVersion returns the middleware version for the given function
src: the path to the source code of the function
runtime: the expected runtime of the target source code "go", "node" etc.
invoke: the optional invocation hint (default "http")
fs: filesystem which contains scaffolding at '[runtime]/scaffolding'
(exclusive with 'repo')
func MiddlewareVersions ¶ added in v0.48.0
func MiddlewareVersions(fs filesystem.Filesystem) (map[string]map[string]string, error)
MiddlewareVersions returns the middleware versions for all the runtimes and invoke types for the given filesystem (which must contain the scaffolding at 'runtime/scaffolding')
func Write ¶
func Write(out, src, runtime, invoke string, fs filesystem.Filesystem) (err error)
Write scaffolding to a given path
Scaffolding is a language-level operation which first detects the method signature used by the function's source code and then writes the appropriate scaffolding.
NOTE: Scaffolding is not per-template, because a template is merely an example starting point for a Function implementation and should have no bearing on the shape that function can eventually take. The language, and optionally invocation hint (For cloudevents) are used for this. For example, there can be multiple templates which exemplify a given method signature, and the implementation can be switched at any time by the author. Language, by contrast, is fixed at time of initialization.
out: the path to output scaffolding
src: the path to the source code to scaffold
runtime: the expected runtime of the target source code "go", "node" etc.
invoke: the optional invocation hint (default "http")
fs: filesystem which contains scaffolding at '[runtime]/scaffolding'
(exclusive with 'repo')
Types ¶
type ErrDetectorNotImplemented ¶
type ErrDetectorNotImplemented struct {
Runtime string
}
func (ErrDetectorNotImplemented) Error ¶
func (e ErrDetectorNotImplemented) Error() string
type ErrRuntimeNotRecognized ¶
type ErrRuntimeNotRecognized struct {
Runtime string
}
func (ErrRuntimeNotRecognized) Error ¶
func (e ErrRuntimeNotRecognized) Error() string
type ScaffoldingError ¶
func (ScaffoldingError) Error ¶
func (e ScaffoldingError) Error() string
func (ScaffoldingError) Unwrap ¶
func (e ScaffoldingError) Unwrap() error
type SignatureError ¶ added in v0.47.0
type SignatureError struct {
Msg string
}
func (*SignatureError) Error ¶ added in v0.47.0
func (e *SignatureError) Error() string