Skip to content

Instantly share code, notes, and snippets.

@changtimwu
Last active August 29, 2015 14:05
Show Gist options
  • Save changtimwu/5ecf33e7f60b63e48ae5 to your computer and use it in GitHub Desktop.
Save changtimwu/5ecf33e7f60b63e48ae5 to your computer and use it in GitHub Desktop.
swixweb to go plan

base functions

  • static file server for assets and views
    • routes -- done
  • simple views rendering/templating via string replace -- done
  • view rendering
    • header, footer, layout and @body -- done
    • @partial -- done
    • variable translation(ex._initdata) -- done
  • cookie & session
    • session timeout -- no timeout but session & cookie work__
  • login
    • auto redirect when no session data -- done(need integration)
  • require('./utils')
  • sockjs -- done
  • sockjs/smith gateway -- done
  • smith/sockjs event gateway
    • event for sockjs -- done
    • callback can be handled one to many clients -- done
  • auto reconnect to swixcore
    • this must be done because even a simple argument mismatch between server and client can cause disconnection.
  • block non-existed api calls -- done
  • block or auto adjust wrong arguments calls -- need core modification
#browser
ss.emit 'system::get_sys_cfg', "useless arg", (f)->

#core
apidefs:
  get_sys_cfg: (f)->
  • controller
    • controller concept -- done
    • common functions for controllers
      • gethookh -- done
      • withcore -- done
      • coreat -- done

controllers

  • A controller is the pair of an event and its handler(in websocket)
  • A controller mostly carries related http handlers for common function -- done
  • Only of thems also defines socket.io event handlers(aka @on)
    • implement the same thing in sockjs -- done
  • check if the GO can reply http get with header -- done
  { 'Content-Type': 'application/x-yaml'}, 200
  { 'Content-Type': 'application/x-json'}, 200
  • implement @withcore()
  • list of controllers
    • ip_conf ( with @on)
      • get_ipcfg -- not need
      • save_ipcfg -- not need
    • login
      • check @redirect -- done
      • need @session -- done
    • maintain_cfgfile
      • import -- done
      • export -- done
      • export local logs -- done
    • maintain_reboot ( with @on) -- done
      • get_mpart_cfg
      • set_mpart_cfg
    • maintain_upgrade -- done
    • ping ( with @on) -- done
      • run_ping -- done
      • check_ping_msg -- done

help routines

  • search all controllers to include
    • findfns -- not need. GO is static. All controlers will be compiled/linked.
  • determine_core_at -- done
  • process.env.TMP -- done
  • do_loadmenu
    • fliterout_menuitems -- done
    • menu_kill -- done
  • model determination -- done
  • specify route handler and render the page with variables -- done
  • https certificates
  • http port
    • determine_coreat -- done
@changtimwu
Copy link
Author

@changtimwu
Copy link
Author

help not accessible

@changtimwu
Copy link
Author

7221 kernel doesn't turn on EPOLL. GO runtime netpoll init would fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment