Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
samugi committed Aug 16, 2024
1 parent 97c42fe commit 0f80744
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kong/api/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,5 @@ do
end

return app

-- run tests
20 changes: 20 additions & 0 deletions kong/plugins/sample-changer/handler.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local kong_meta = require "kong.meta"



local SampleChangerHandler = {
VERSION = kong_meta.version,
PRIORITY = 9000,
}
function SampleChangerHandler:access(conf)
if math.random() < 0.5 then
ngx.ctx.KONG_SPANS = { nil };
ngx.ctx.KONG_SPANS[0] = 1;
-- kong.tracing = kong.tracing("off", { noop = true });

else
ngx.log(ngx.ERR, "THIS WAS REPORTED")
end
end

return SampleChangerHandler
16 changes: 16 additions & 0 deletions kong/plugins/sample-changer/schema.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local typedefs = require "kong.db.schema.typedefs"

return {
name = "sample-changer",
fields = {
{ protocols = typedefs.protocols_http }, -- TODO: support stream mode
{ config = {
type = "record",
fields = {
{ foo = {
description = "The foo ss.",
type = "integer"
} },
} },
}, },
}

0 comments on commit 0f80744

Please sign in to comment.