scaffolding

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFilesystemRequired = ScaffoldingError{"filesystem required", nil}
View Source
var ErrScaffoldingNotFound = ScaffoldingError{"scaffolding not found", nil}
View Source
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

type ErrRuntimeNotRecognized

type ErrRuntimeNotRecognized struct {
	Runtime string
}

func (ErrRuntimeNotRecognized) Error

func (e ErrRuntimeNotRecognized) Error() string

type ScaffoldingError

type ScaffoldingError struct {
	Msg string
	Err error
}

func (ScaffoldingError) Error

func (e ScaffoldingError) Error() string

func (ScaffoldingError) Unwrap

func (e ScaffoldingError) Unwrap() error

type Signature

type Signature int
const (
	UnknownSignature Signature = iota
	InstancedHTTP
	InstancedCloudevents
	StaticHTTP
	StaticCloudevents
)

func (Signature) String

func (s Signature) String() string

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

Jump to

Keyboard shortcuts

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