scaffolding

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrScaffoldingNotFound = ScaffoldingError{"scaffolding not found", nil}
View Source
var ErrSignatureNotFound = ScaffoldingError{"supported signature not found", nil}

Functions

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: Scaffoding 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 invocatin hint (default "http")
fs:      filesytem 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

Jump to

Keyboard shortcuts

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