Documentation
¶
Index ¶
- Constants
- Variables
- func APICommands() map[protocol.Command]reflect.Type
- func Call(ctx context.Context, c *protocol.Conn, payload any) (protocol.Command, string, any, error)
- func Read(ctx context.Context, c protocol.APIConn) (protocol.Command, string, any, error)
- func ReadConn(ctx context.Context, c *protocol.Conn) (protocol.Command, string, any, error)
- func Write(ctx context.Context, c protocol.APIConn, id string, payload any) error
- func WriteConn(ctx context.Context, c *protocol.Conn, id string, payload any) error
- type L2KeystoneNotfication
- type PingRequest
- type PingResponse
Constants ¶
View Source
const ( APIVersion = 1 CmdPingRequest = "popapi-ping-request" CmdPingResponse = "popapi-ping-response" CmdL2KeystoneNotification = "popapi-notification" )
Variables ¶
View Source
var ( APIVersionRoute = fmt.Sprintf("v%d", APIVersion) RouteWebsocket = fmt.Sprintf("/%s/ws", APIVersionRoute) DefaultListen = "localhost:31337" DefaultURL = fmt.Sprintf("ws://%s/%s", DefaultListen, RouteWebsocket) )
Functions ¶
func Call ¶
func Call(ctx context.Context, c *protocol.Conn, payload any) (protocol.Command, string, any, error)
Call is a blocking call. One should use ReadConn when using Call or else the completion will end up in the Read instead of being completed as expected.
func Read ¶
Read is the low level primitive of a protocol Read. One should generally not use this function and use ReadConn instead.
func ReadConn ¶
ReadConn reads from Conn and performs callbacks. One should use ReadConn over Read when mixing Write, WriteConn and Call.
Types ¶
type L2KeystoneNotfication ¶
type L2KeystoneNotfication struct{}
type PingRequest ¶
type PingRequest protocol.PingRequest
type PingResponse ¶
type PingResponse protocol.PingResponse
Click to show internal directories.
Click to hide internal directories.