Semantic types

Technical reference of Tipos semánticos.

This API is used in Pages, Actions, Components, WebSocket.


Symbols

SymbolClassDescription
PagetypeMark the return value of a GOX page.
ComponenttypeIt marks a redeemable temperate fragment.
ActiontypeMark the return value of an Action.
WebSockettypeMark the entry point of a WebSocket module.
EventReplytypeIt represents the value returned in response to a WebSocket event.

Page

Declaration:

gox
type Page interface{}

Mark the return value of a GOX page.

Usage syntax

gox
func GET(ctx *gox.Context) gox.Page {
    return <main></main>
}

Component

Declaration:

gox
type Component interface{}

It marks a redeemable temperate fragment.

Usage syntax

gox
func Card() gox.Component {
    return <article></article>
}

Action

Declaration:

gox
type Action interface{}

Mark the return value of an Action.

Usage syntax

gox
func Greeting(ctx *gox.Context, name string) gox.Action {
    return name
}

WebSocket

Declaration:

gox
type WebSocket interface{}

Mark the entry point of a WebSocket module.

Usage syntax

gox
func Socket(socket *gox.Socket) gox.WebSocket {
    return nil
}

EventReply

Declaration:

gox
type EventReply = any

It represents the value returned in response to a WebSocket event.

Usage syntax

gox
func Greeting(name string) gox.EventReply {
    return name
}

See also

Next step

Continue with gox package and the types available during an execution.

gox package