github.com/GeniusesGroup/libgo@v0.0.0-20220929090155-5ff932cb408e/os/persiaos/os.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package persiaos
     4  
     5  import (
     6  	"../../gp"
     7  	"../../mediatype"
     8  	"../../protocol"
     9  )
    10  
    11  // OS implements protocol.OperatingSystem
    12  var OS os
    13  
    14  type os struct {
    15  	Manifest     Manifest
    16  	State        protocol.ApplicationState
    17  	StateChannel chan protocol.ApplicationState
    18  
    19  	// localFileDirectory        FileDirectory   // Local file storage
    20  	// localObjectDirectory      ObjectDirectory // Local object storage
    21  	// localCacheObjectDirectory ObjectDirectory // Local object storage
    22  
    23  	gp gp.OSMultiplexer
    24  	ipv4 ip.OSMultiplexerIPv4
    25  
    26  	mediatype.MediaTypes
    27  }
    28  
    29  func (os *os) AppManifest() protocol.ApplicationManifest { return &os.Manifest }
    30  
    31  // func (os *os) ObjectDirectory() protocol.ObjectDirectory      { return &os.localObjectDirectory }
    32  // func (os *os) CacheObjectDirectory() protocol.ObjectDirectory { return &os.localCacheObjectDirectory }
    33  // func (os *os) FileDirectory() protocol.FileDirectory          { return &os.localFileDirectory }
    34  
    35  // Init method use to auto initialize App object with default data.
    36  func init() {
    37  	protocol.App.LogInfo("Application Run on PersiaOS")
    38  
    39  	OS.gp.Init()
    40  }
    41  
    42  // Shutdown use to graceful stop os
    43  func (os *os) Shutdown() {
    44  	// os.localFileDirectory.Save()
    45  }