net

Types from the Go package net (a library PocketBase builds on), as JavaScript sees them: they turn up as values of PocketBase's types and of hook events.

net.Addr

Addr represents a network end point address.

The two methods Addr.network and Addr.string conventionally return strings that can be passed as the arguments to Dial, but the exact form and meaning of the strings is up to the implementation.

Member Type
network() (): string // name of the network (for example, "tcp", "udp")
string() (): string // string form of address (for example, "192.0.2.1:25", "[2001:db8::1]:80")

net.Conn

Conn is a generic stream-oriented network connection.

Multiple goroutines may invoke methods on a Conn simultaneously.

Member Type
read() (b: string|Array<number>): number Read reads data from the connection. Read can be made to time out and return an error after a fixed time limit; see SetDeadline and SetReadDeadline.
write() (b: string|Array<number>): number Write writes data to the connection. Write can be made to time out and return an error after a fixed time limit; see SetDeadline and SetWriteDeadline.
close() (): void Close closes the connection. Any blocked Read or Write operations will be unblocked and return errors. Close may or may not block until any buffered data is sent; for TCP connections see [*TCPConn.SetLinger].
localAddr() (): Addr LocalAddr returns the local network address, if known.
remoteAddr() (): Addr RemoteAddr returns the remote network address, if known.
setDeadline() (t: time.Time): void SetDeadline sets the read and write deadlines associated with the connection. It is equivalent to calling both SetReadDeadline and SetWriteDeadline.
setReadDeadline() (t: time.Time): void SetReadDeadline sets the deadline for future Read calls and any currently-blocked Read call. A zero value for t means Read will not time out.
setWriteDeadline() (t: time.Time): void SetWriteDeadline sets the deadline for future Write calls and any currently-blocked Write call. Even if write times out, it may return n > 0, indicating that some of the data was successfully written. A zero value for t means Write will not time out.

net.Listener

A Listener is a generic network listener for stream-oriented protocols.

Multiple goroutines may invoke methods on a Listener simultaneously.

Member Type
accept() (): Conn Accept waits for and returns the next connection to the listener.
close() (): void Close closes the listener. Any blocked Accept operations will be unblocked and return errors.
addr() (): Addr Addr returns the listener's network address.