asifdxtreme closed pull request #259: SCB-295 Add plug-in mechanism doc
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/259
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/server/plugin/README.md b/server/plugin/README.md
new file mode 100644
index 00000000..89ff610d
--- /dev/null
+++ b/server/plugin/README.md
@@ -0,0 +1,50 @@
+# Plug-in mechanism
+## Required
+1. Go version 1.8(+)
+1. Compile service-center with GO_EXTLINK_ENABLED=1 and CGO_ENABLED=1
+1. The plugin file name must has suffix '_plugin.so'
+
+## Plug-in names
+1. auth, Customize authentication of service-center.
+1. uuid, Customize micro-service/instance id format.
+1. auditlog, Customize audit log for any change done to the service-center.
+1. cipher, Customize encryption and decryption of TLS certificate private key 
password.
+1. quota, Customize quota for instance registry.
+
+## Example: an authentication plug-in
+
+### Step 1: code auth.go
+
+```go
+package main
+
+import (
+    "fmt"
+    "net/http"
+)
+
+func Identify(*http.Request) error {
+       // do something
+       return nil
+}
+```
+
+### Step 2: compile auth.go
+
+```bash
+GOPATH=$(pwd) go build -o auth_plugin.so -buildmode=plugin auth.go
+```
+
+### Step 3: move the plug-in in plugins directory
+
+```bash
+mkdir ${service-center}/plugins
+mv auth_plugin.so ${service-center}/plugins
+```
+
+### Step 4: run service-center
+
+```bash
+cd ${service-center}
+./servicecenter
+```
\ No newline at end of file


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to