Response runtime
Technical reference of Runtime de respuestas.
This API is used in Communication.
Symbols
| Symbol | Class | Description |
|---|---|---|
| WriteActionFile | func | Write WriteActionFile. |
| WriteActionFiles | func | Write WriteActionFiles. |
| WritePageFile | func | Write WritePageFile. |
| WritePageFiles | func | Write WritePageFiles. |
| FlowControlKind | type | FlowControlKind defines a public type of API. |
| FlowDoneWith | const | FlowDoneWith defines a constant value of the API. |
| FlowRedirect | const | FlowRedirect defines a constant value of the API. |
| FlowInvalid | const | FlowInvalid defines a constant value of the API. |
| FlowControl | type | FlowControl defines a public type of API. |
| SetRuntimeResponseState | func | Sets SetRuntimeResponseState. |
| RuntimeResponseState | func | It gets the private state of Response. |
| ResetRuntimeResponse | func | Reboot ResetRuntimeResponse. |
| SetRuntimeFlowCallsiteResolver | func | Sets SetRuntimeFlowCallsiteResolver. |
| SetRuntimeResponseMutationGuard | func | Sets SetRuntimeResponseMutationGuard. |
| ResponseImportMapRuntime | type | ResponseImportMapRuntime defines a public type of API. |
| ResponseImportMap.Runtime | func | He gets the reserved view of the runtime. |
| ResponseImportMapRuntime.ApplyCSP | func | Apply the source of the import map to the CSP policy. |
| ResponseImportMapRuntime.WriteCompiled | func | Write the compiled import map. |
| ResponseImportMapRuntime.SecuritySource | func | Returns the calculated CSP source. |
WriteActionFile
Declaration:
func WriteActionFile(ctx *Context, file File) error Write WriteActionFile.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | *Context | Context of execution. |
file | File | Type value File required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
err | error | nil if the operation ends correctly; otherwise, the error produced. |
Behavior
The operation returns an error when it cannot complete the above contract.
Errors
WriteActionFile returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.
WriteActionFiles
Declaration:
func WriteActionFiles(ctx *Context, files []File) error Write WriteActionFiles.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | *Context | Context of execution. |
files | []File | Type value []File required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
err | error | nil if the operation ends correctly; otherwise, the error produced. |
Behavior
The operation returns an error when it cannot complete the above contract.
Errors
WriteActionFiles returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.
WritePageFile
Declaration:
func WritePageFile(ctx *Context, file File) error Write WritePageFile.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | *Context | Context of execution. |
file | File | Type value File required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
err | error | nil if the operation ends correctly; otherwise, the error produced. |
Behavior
The operation returns an error when it cannot complete the above contract.
Errors
WritePageFile returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.
WritePageFiles
Declaration:
func WritePageFiles(ctx *Context, files []File) error Write WritePageFiles.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | *Context | Context of execution. |
files | []File | Type value []File required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
err | error | nil if the operation ends correctly; otherwise, the error produced. |
Behavior
The operation returns an error when it cannot complete the above contract.
Errors
WritePageFiles returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.
FlowControlKind
Declaration:
type FlowControlKind string FlowControlKind defines a public type of API.
FlowDoneWith
Declaration:
FlowDoneWith FlowControlKind = "doneWith" FlowDoneWith defines a constant value of the API.
FlowRedirect
Declaration:
FlowRedirect FlowControlKind = "redirect" FlowRedirect defines a constant value of the API.
FlowInvalid
Declaration:
FlowInvalid FlowControlKind = "invalid" FlowInvalid defines a constant value of the API.
FlowControl
Declaration:
type FlowControl struct {
Kind FlowControlKind
StatusCode int
Component Component
Location string
Message string
ErrorKind string
File string
Line int
} FlowControl defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Kind | FlowControlKind | Event or state class. |
StatusCode | int | HTTP status code. |
Component | Component | Component associated with flow control. |
Location | string | Destination of a redirection. |
Message | string | A descriptive message. |
ErrorKind | string | Associated error. |
File | string | Associated file. |
Line | int | Associated code line. |
SetRuntimeResponseState
Declaration:
func SetRuntimeResponseState(response *Response, state any) Sets SetRuntimeResponseState.
Parameters
| Parameter | Type | Description |
|---|---|---|
response | *Response | Type value *Response required by the operation. |
state | any | Type value any required by the operation. |
RuntimeResponseState
Declaration:
func RuntimeResponseState(response *Response) any It gets the private state of Response.
Parameters
| Parameter | Type | Description |
|---|---|---|
response | *Response | Type value *Response required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
value | any | Type value any produced by the operation. |
ResetRuntimeResponse
Declaration:
func ResetRuntimeResponse(response *Response) Reboot ResetRuntimeResponse.
Parameters
| Parameter | Type | Description |
|---|---|---|
response | *Response | Type value *Response required by the operation. |
SetRuntimeFlowCallsiteResolver
Declaration:
func SetRuntimeFlowCallsiteResolver(resolver func() (file string, line int)) Sets SetRuntimeFlowCallsiteResolver.
Parameters
| Parameter | Type | Description |
|---|---|---|
resolver func() (file string | int) | Type value int) required by the operation. |
line | int) | Type value int) required by the operation. |
SetRuntimeResponseMutationGuard
Declaration:
func SetRuntimeResponseMutationGuard(guard func(*Response) bool) Sets SetRuntimeResponseMutationGuard.
Parameters
| Parameter | Type | Description |
|---|---|---|
guard func(*Response) | bool | Type value bool required by the operation. |
ResponseImportMapRuntime
Declaration:
type ResponseImportMapRuntime struct {
// contiene campos internos
} ResponseImportMapRuntime defines a public type of API.
ResponseImportMap.Runtime
Declaration:
func (m *ResponseImportMap) Runtime() ResponseImportMapRuntime He gets the reserved view of the runtime.
Returns
| Return | Type | Description |
|---|---|---|
value | ResponseImportMapRuntime | Type value ResponseImportMapRuntime produced by the operation. |
ResponseImportMapRuntime.ApplyCSP
Declaration:
func (r ResponseImportMapRuntime) ApplyCSP(staticHash string) Apply the source of the import map to the CSP policy.
Parameters
| Parameter | Type | Description |
|---|---|---|
staticHash | string | Type value string required by the operation. |
Usage syntax
responseImportMapRuntime.ApplyCSP(value) ResponseImportMapRuntime.WriteCompiled
Declaration:
func (r ResponseImportMapRuntime) WriteCompiled(w Writer, staticEntries [][2]string, staticScript []byte, staticHash string) Write the compiled import map.
Parameters
| Parameter | Type | Description |
|---|---|---|
w | Writer | Type value Writer required by the operation. |
staticEntries | [][2]string | Type value [][2]string required by the operation. |
staticScript | []byte | Type value []byte required by the operation. |
staticHash | string | Type value string required by the operation. |
Usage syntax
responseImportMapRuntime.WriteCompiled(value, value, value, value) ResponseImportMapRuntime.SecuritySource
Declaration:
func (r ResponseImportMapRuntime) SecuritySource() string Returns the calculated CSP source.
Returns
| Return | Type | Description |
|---|---|---|
value | string | Textual value produced by the operation; its zero value is an empty string. |
Usage syntax
value := responseImportMapRuntime.SecuritySource()