You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/09/22 01:55:04 UTC

[GitHub] [apisix] membphis commented on a change in pull request #2268: feat: support storing metadata for plugins

membphis commented on a change in pull request #2268:
URL: https://github.com/apache/apisix/pull/2268#discussion_r492435682



##########
File path: apisix/admin/init.lua
##########
@@ -108,6 +109,11 @@ local function run()
         seg_sub_path = core.table.concat(uri_segs, "/", 7)
     end
 
+    -- plugin metadata

Review comment:
       I do not like this process, I accept `plugin_metadata` as key.

##########
File path: apisix/admin/plugin_metadata.lua
##########
@@ -0,0 +1,118 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+local pcall   = pcall
+local require = require
+local core    = require("apisix.core")
+
+local _M = {
+    version = 0.1,

Review comment:
       this version is useless, let us drop it

##########
File path: apisix/schema_def.lua
##########
@@ -602,6 +602,11 @@ _M.stream_route = {
     }
 }
 
+_M.plugin_metadata = {

Review comment:
       I think we can move this to `plugin`.
   
   Here is an example:
   
   ```
   local _M = {
       version = 0.1,
       priority = 100,
       name = plugin_name,
       schema = schema,
       schema_metadata = {
           -- ... ...
       }
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org