Semantic types
Technical reference of Tipos semánticos.
This API is used in Pages, Actions, Components, WebSocket.
Symbols
| Symbol | Class | Description |
|---|---|---|
| Page | type | Mark the return value of a GOX page. |
| Component | type | It marks a redeemable temperate fragment. |
| Action | type | Mark the return value of an Action. |
| WebSocket | type | Mark the entry point of a WebSocket module. |
| EventReply | type | It represents the value returned in response to a WebSocket event. |
Page
Declaration:
type Page interface{} Mark the return value of a GOX page.
Usage syntax
func GET(ctx *gox.Context) gox.Page {
return <main></main>
} Component
Declaration:
type Component interface{} It marks a redeemable temperate fragment.
Usage syntax
func Card() gox.Component {
return <article></article>
} Action
Declaration:
type Action interface{} Mark the return value of an Action.
Usage syntax
func Greeting(ctx *gox.Context, name string) gox.Action {
return name
} WebSocket
Declaration:
type WebSocket interface{} Mark the entry point of a WebSocket module.
Usage syntax
func Socket(socket *gox.Socket) gox.WebSocket {
return nil
} EventReply
Declaration:
type EventReply = any It represents the value returned in response to a WebSocket event.
Usage syntax
func Greeting(name string) gox.EventReply {
return name
}