Skip to content

Package for writing nFlex modules as GoLang plugins

Notifications You must be signed in to change notification settings

ntt-nflex/goflexer

Repository files navigation

goflexer

Go Flexer logo

Goflexer is a package used for writing nFlex modules as GoLang plugins

Example

package main

import (
        "fmt"

        "github.com/ntt-nflex/goflexer"
)

// Test is a test handler
func Test(event goflexer.Event, context goflexer.Context) goflexer.Result {
        fmt.Println("This is a log message")
        return map[string]interface{}{
                "foo": "bar",
        }
}

Build

You must create a plugin.go file with you code. Then build it as a Go plugin and zip it.

$ go get "github.com/ntt-nflex/goflexer"
$ go build -buildmode=plugin plugin.go
$ zip module.zip plugin.so

Test

Create a ~/.flexer.yaml file if you don't already have one

regions:
  default:
    cmp_api_key: *****
    cmp_api_secret: ***********
    cmp_url: https://localhost/cmp/basic/api
verify_ssl: false
goflexer --handler TestMethod --event '{"foo": "bar"}'

Upload

Once you have the zip file, you can upload it to nFlex. The easiest way to do that is with flexer

About

Package for writing nFlex modules as GoLang plugins

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages