Git Product home page Git Product logo

plugin_example's Introduction

How to build this example

  • run make all to generate all binary and plugins
  • run make clean to clean all binary and plugins

How to run this example

Usage

$ ./example -h
Usage of ./example:
  -mode string
        load which kind [adder|greet] of plugin (default "adder")
  -path string
        path to plugin file

Load Greeting

$ ./example -mode greet -path plugs/greeter/greeter.so
======= main =======
Greeting Mr. guesslin

Load different Adder

  • 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

plugin_example's People

Contributors

guesslin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.