Documentation ¶
Index ¶
- Constants
- func Dir(useLocal bool, name string) http.FileSystem
- func FS(useLocal bool) http.FileSystem
- func FSByte(useLocal bool, name string) ([]byte, error)
- func FSMustByte(useLocal bool, name string) []byte
- func FSMustString(useLocal bool, name string) string
- func FSString(useLocal bool, name string) (string, error)
- func IP6(n *ugate.DMNode) net.IP
- func NodeID(n *ugate.DMNode) string
- func QuitHandler(writer http.ResponseWriter, request *http.Request)
- func Since(n time.Time) string
- func ToJson(n interface{}) string
- type DMUI
Constants ¶
const EV_BUFFER = 200
TODO: circular buffer, poll event, for debug
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
func Dir(useLocal bool, name string) http.FileSystem
Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.
func FS ¶
func FS(useLocal bool) http.FileSystem
FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSByte ¶
FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSMustByte ¶
FSMustByte is the same as FSByte, but panics if name is not present.
func FSMustString ¶
FSMustString is the string version of FSMustByte.
func QuitHandler ¶
func QuitHandler(writer http.ResponseWriter, request *http.Request)
Types ¶
type DMUI ¶
type DMUI struct {
// contains filtered or unexported fields
}
UI and admin interface. Exposed via localhost only. TODO: add a random password and cookie
func (*DMUI) DebugEventsHandler ¶
func (lm *DMUI) DebugEventsHandler(w http.ResponseWriter, req *http.Request)
Return the sticky and recent events.
func (*DMUI) HttpRefreshAndRegister ¶
func (lm *DMUI) HttpRefreshAndRegister(w http.ResponseWriter, r *http.Request)
HttpRefreshAndRegister (/dmesh/rd) will initiate a multicast UDP, asking for local masters. After a small wait it'll return the list of peers. Debugging only.
func (*DMUI) ServeHTTP ¶
func (dm *DMUI) ServeHTTP(w http.ResponseWriter, r *http.Request)
Default handler - operating as main admin handlers, on localhost
Host headers: - NODEID.dm -> forwarded to node, using connected client or parent. - configured host -> forwarded via HTTP/1.1 or H2, local named hosts