Documentation ¶
Overview ¶
Package response contains utilities for working with RunFunctionResponses.
Index ¶
- Constants
- func Fatal(rsp *v1beta1.RunFunctionResponse, err error)
- func Normal(rsp *v1beta1.RunFunctionResponse, message string)
- func Normalf(rsp *v1beta1.RunFunctionResponse, format string, a ...any)
- func SetContextKey(rsp *v1beta1.RunFunctionResponse, key string, v *structpb.Value)
- func SetDesiredComposedResources(rsp *v1beta1.RunFunctionResponse, ...) error
- func SetDesiredCompositeResource(rsp *v1beta1.RunFunctionResponse, xr *resource.Composite) error
- func To(req *v1beta1.RunFunctionRequest, ttl time.Duration) *v1beta1.RunFunctionResponse
- func Warning(rsp *v1beta1.RunFunctionResponse, err error)
Constants ¶
const DefaultTTL = 1 * time.Minute
DefaultTTL is the default TTL for which a response can be cached.
Variables ¶
This section is empty.
Functions ¶
func Fatal ¶
func Fatal(rsp *v1beta1.RunFunctionResponse, err error)
Fatal adds a fatal result to the supplied RunFunctionResponse.
func Normal ¶
func Normal(rsp *v1beta1.RunFunctionResponse, message string)
Normal adds a normal result to the supplied RunFunctionResponse.
func Normalf ¶
func Normalf(rsp *v1beta1.RunFunctionResponse, format string, a ...any)
Normalf adds a normal result to the supplied RunFunctionResponse.
func SetContextKey ¶
func SetContextKey(rsp *v1beta1.RunFunctionResponse, key string, v *structpb.Value)
SetContextKey sets context to the supplied key.
func SetDesiredComposedResources ¶
func SetDesiredComposedResources(rsp *v1beta1.RunFunctionResponse, dcds map[resource.Name]*resource.DesiredComposed) error
SetDesiredComposedResources sets the desired composed resources in the supplied response. The caller must be sure to avoid overwriting the desired state that may have been accumulated by previous Functions in the pipeline, unless they intend to.
func SetDesiredCompositeResource ¶
func SetDesiredCompositeResource(rsp *v1beta1.RunFunctionResponse, xr *resource.Composite) error
SetDesiredCompositeResource sets the desired composite resource in the supplied response. The caller must be sure to avoid overwriting the desired state that may have been accumulated by previous Functions in the pipeline, unless they intend to.
func To ¶
func To(req *v1beta1.RunFunctionRequest, ttl time.Duration) *v1beta1.RunFunctionResponse
To bootstraps a response to the supplied request. It automatically copies the desired state from the request.
func Warning ¶
func Warning(rsp *v1beta1.RunFunctionResponse, err error)
Warning adds a warning result to the supplied RunFunctionResponse.
Types ¶
This section is empty.