doc.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package aroz // import "imuslab.com/arozos/demo/aroz"
  2. TYPES
  3. type ArozHandler struct {
  4. Port string
  5. // Has unexported fields.
  6. }
  7. func HandleFlagParse(info ServiceInfo) *ArozHandler
  8. This function will request the required flag from the startup paramters and
  9. parse it to the need of the arozos.
  10. func (a *ArozHandler) GetUserInfoFromRequest(w http.ResponseWriter, r *http.Request) (string, string)
  11. Get the username and resources access token from the request, return
  12. username, token
  13. func (a *ArozHandler) RequestGatewayInterface(token string, script string) (*http.Response, error)
  14. type ServiceInfo struct {
  15. Name string //Name of this module. e.g. "Audio"
  16. Desc string //Description for this module
  17. Group string //Group of the module, e.g. "system" / "media" etc
  18. IconPath string //Module icon image path e.g. "Audio/img/function_icon.png"
  19. Version string //Version of the module. Format: [0-9]*.[0-9][0-9].[0-9]
  20. StartDir string //Default starting dir, e.g. "Audio/index.html"
  21. SupportFW bool //Support floatWindow. If yes, floatWindow dir will be loaded
  22. LaunchFWDir string //This link will be launched instead of 'StartDir' if fw mode
  23. SupportEmb bool //Support embedded mode
  24. LaunchEmb string //This link will be launched instead of StartDir / Fw if a file is opened with this module
  25. InitFWSize []int //Floatwindow init size. [0] => Width, [1] => Height
  26. InitEmbSize []int //Embedded mode init size. [0] => Width, [1] => Height
  27. SupportedExt []string //Supported File Extensions. e.g. ".mp3", ".flac", ".wav"
  28. }
  29. Information required for registering this subservice to arozos