- run
make all
to generate all binary and plugins - run
make clean
to clean all binary and plugins
$ ./example -h
Usage of ./example:
-mode string
load which kind [adder|greet] of plugin (default "adder")
-path string
path to plugin file
$ ./example -mode greet -path plugs/greeter/greeter.so
======= main =======
Greeting Mr. guesslin
- simple adder, implement
a + b
$ ./example -mode adder -path plugs/adder/simple/simple.so
======= main =======
Adder 100 + 20 = 120 result
- mod adder, implement
(a + b) * 10 * alpha(0.5)
$ ./example -mode adder -path plugs/adder/mod/mod.so
======= main =======
Adder 100 + 20 = 600 result
- average adder, implement
(a + b) / 2
$ ./example -mode adder -path plugs/adder/average/average.so
======= main =======
Adder 100 + 20 = 60 result