Skip to content

dReam-dApps/dImports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dImports

Package for importing and running Go dApps.

  1. About
  2. StartApp
  3. Importing
  4. Build
  5. Donations
  6. Licensing

About

goModgoReportgoDoc The idea behind dImports is to be able to import and run Go dApps or code that is external to the executing program. Primarily designed for use with Dero dApps, dImports aims to give users easy access to libraries of powerful dApps.

Currently the dimport package is using gore to import a Go package from any given path and run its StartApp(). It includes a Fyne widget import for GUI use which is demonstrated in cmd/dImporter-gui.

View latest release

windowsOSmacOSlinuxOS

StartApp

Simply put, StartApp() is a exportable version of a main(). It contains the overall logic and control flow of a application. To build a StartApp() that can be dimported, write a function called StartApp in a Go package and publish it.

package mydapp

func StartApp() {
    // Your logic
}
  • mydapp must not be in top level of repo

Importing

To run a external StartApp() from your code.

package main

import "github.com/dReam-dApps/dImports/dimport"

func main() {
	path := "github.com/user/repo/mydapp"

	err := dimport.ImportAndStartApp(path)
	if err != nil {
		// handle error
	}
}

Build

dImports contains a CLI and GUI app which can be built from source.

  • Install latest Go version
  • Install Fyne dependencies (this step is only required for GUI build)
  • Clone repo and build using:
git clone https://github.com/dReam-dApps/dImports.git
cd dImports/cmd/dImporter-gui
go build .
./dImporter-gui

Donations

  • Dero Address: dero1qyr8yjnu6cl2c5yqkls0hmxe6rry77kn24nmc5fje6hm9jltyvdd5qq4hn5pn

DeroDonations


Licensing

dImports is free and open source.
The source code is published under the MIT License.
Copyright © 2023 dReam dApps