AppParams

Table of contents

Defines parameters of the app

type AppParams struct {
    AutoCertDomain string
    CertFile string
    Icon string
    KeyFile string
    NoSocket bool
    Redirect80 bool
    SocketAutoClose int
    Title string
    TitleColor Color
}
Member Type Description
AutoCertDomain string Domain name used to retrive LetsEncrypt certificates for
CertFile string Path of a certificate for the server must be provided if neither the Server's TLSConfig.Certificates nor TLSConfig.GetCertificate are populated. If the certificate is signed by a certificate authority, the certFile should be the concatenation of the server's certificate, any intermediates, and the CA's certificate.
Icon string App icon file name
KeyFile string Path of a private key for the server must be provided if neither the Server's TLSConfig.Certificates nor TLSConfig.GetCertificate are populated.
NoSocket bool If true then WebSockets will not be used and information exchange between the client and the server will be carried out only via http.
Redirect80 bool If true then the function of redirect from port 80 to 443 is created
SocketAutoClose int Time in seconds after which the socket is automatically closed for an inactive session. The countdown begins after the OnPause event arrives. If the value of this property is less than or equal to 0 then the socket is not closed.
Title string Title of the app window/tab
TitleColor Color Background color of the app window/tab (applied only for Safari and Chrome for Android)
func StartApp(addr string, createContentFunc func(Session) SessionContent, params AppParams)

Create a new application, start it and runs its main loop