github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/protocol/storages.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package protocol
     4  
     5  // StoragesDistributed is the interface that can implement by any Application to provide distributed storage mechanism.
     6  type StoragesDistributed interface {
     7  	Objects() StorageObjects
     8  	Files() FileDirectory
     9  	Records() StorageRecords
    10  	KeyValues() StorageKeyValue
    11  }
    12  
    13  // StoragesLocal is the interface that can implement by any Application to provide local storage mechanism.
    14  type StoragesLocal interface {
    15  	LocalObjects() StorageObjects
    16  	LocalFiles() FileDirectory
    17  	LocalRecords() StorageRecords
    18  	LocalKeyValues() StorageKeyValue
    19  
    20  	// It is like old kernels file systems that shared between all applications.
    21  	// It serve by the GUI app that run on the OS as default user interface.
    22  	LocalSharedFiles() FileDirectory
    23  }
    24  
    25  // StoragesCache is the interface that can implement by any Application to provide cache storage mechanism.
    26  // Keep them on volatile memories and just save very common on non-volatile storages.
    27  // All GUI & edge nodes of any software must use cache in many cases to improve performance.
    28  type StoragesCache interface {
    29  	ObjectsCache() StorageObjects
    30  	FilesCache() FileDirectory
    31  	RecordsCache() StorageRecords
    32  	KeyValuesCache() StorageKeyValue
    33  }