Skip to content
Snippets Groups Projects
Select Git revision
  • af182caa8c569d11af0d176ed5663b3ac2791fd6
  • without_tipselection default
  • develop protected
  • fix/grafana-local-dashboard
  • wasp
  • fix/dashboard-explorer-freeze
  • master
  • feat/timerqueue
  • test/sync_debug_and_650
  • feat/sync_revamp_inv
  • wip/sync
  • tool/db-recovery
  • portcheck/fix
  • fix/synchronization
  • feat/new-dashboard-analysis
  • feat/refactored-analysis-dashboard
  • feat/new-analysis-dashboard
  • test/demo-prometheus-fpc
  • prometheus_metrics
  • wip/analysis-server
  • merge/fpc-test-value-transfer
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.3
  • v0.1.2
  • v0.1.1
  • v0.1.0
28 results

plugin.go

Blame
  • user avatar
    Wolfgang Welz authored and GitHub committed
    c133ef18
    History
    plugin.go 1.20 KiB
    package banner
    
    import (
    	"fmt"
    	"sync"
    
    	"github.com/iotaledger/hive.go/node"
    )
    
    // PluginName is the name of the banner plugin.
    const PluginName = "Banner"
    
    var (
    	// plugin is the plugin instance of the banner plugin.
    	plugin *node.Plugin
    	once   sync.Once
    )
    
    const (
    	// AppVersion version number
    	AppVersion = "v0.2.0"
    
    	// AppName app code name
    	AppName = "GoShimmer"
    )
    
    // Plugin gets the plugin instance.
    func Plugin() *node.Plugin {
    	once.Do(func() {
    		plugin = node.NewPlugin(PluginName, node.Disabled, configure, run)
    	})
    	return plugin
    }
    
    func configure(ctx *node.Plugin) {
    	fmt.Printf(`
       _____  ____   _____ _    _ _____ __  __ __  __ ______ _____  
      / ____|/ __ \ / ____| |  | |_   _|  \/  |  \/  |  ____|  __ \ 
     | |  __| |  | | (___ | |__| | | | | \  / | \  / | |__  | |__) |
     | | |_ | |  | |\___ \|  __  | | | | |\/| | |\/| |  __| |  _  / 
     | |__| | |__| |____) | |  | |_| |_| |  | | |  | | |____| | \ \ 
      \_____|\____/|_____/|_|  |_|_____|_|  |_|_|  |_|______|_|  \_\
                                 %s                                     
    `, AppVersion)
    	fmt.Println()
    
    	ctx.Node.Logger.Infof("GoShimmer version %s ...", AppVersion)
    	ctx.Node.Logger.Info("Loading plugins ...")
    }
    
    func run(ctx *node.Plugin) {}