Skip to content

Commit

Permalink
Merge pull request #154 from solarwinds/feature/G1-4178_snap-plugin-l…
Browse files Browse the repository at this point in the history
…ib-migration

[G1-4178] snap plugin lib migration
  • Loading branch information
shanas-swi authored Jul 3, 2024
2 parents 33805aa + ebb86fe commit 895bc31
Show file tree
Hide file tree
Showing 25 changed files with 374 additions and 324 deletions.
23 changes: 17 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,24 @@ jobs:
command: >
TEST_TYPE="lint" make check 2>&1
- run:
name: Install .NET SDK and dependencies
command: |
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --channel 6.0 --install-dir ~/dotnet
sudo apt-get update
sudo apt-get install -y gcc-multilib gcc-mingw-w64 apt-transport-https
echo "export PATH=$PATH:~/dotnet" >> $BASH_ENV
echo "export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu" >> $BASH_ENV
echo "export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt" >> $BASH_ENV
- run:
name: "Verify .NET installation"
command: >
dotnet --info
- run:
name: "Run build"
command: >
wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb &&
sudo dpkg -i packages-microsoft-prod.deb &&
sudo apt-get update &&
sudo apt-get install -y gcc-multilib gcc-mingw-w64 apt-transport-https dotnet-sdk-3.1 dotnet-runtime-3.1 &&
make build 2>&1
make build 2>&1
- run:
name: "Run small test"
command: >
Expand All @@ -56,4 +67,4 @@ workflows:
- test:
matrix:
parameters:
version: ["1.18.2"]
version: ["1.22.4"]
6 changes: 3 additions & 3 deletions examples/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Here you will find example plugins that cover the basics for writing collector,

To get these example plugins to build properly and work with Snap you will need to have [glide](https://glide.sh/) installed in your $PATH. You should also add snaptel and snapteld in your $PATH.

To test these plugins with Snap, you will need to have [Snap](https://github.com/librato/snap) installed, check out these docs for [Snap setup details](https://github.com/librato/snap/blob/master/docs/BUILD_AND_TEST.md#getting-started).
To test these plugins with Snap, you will need to have [Snap](https://github.com/solarwinds-cloud/snap) installed, check out these docs for [Snap setup details](https://github.com/solarwinds-cloud/snap/blob/master/docs/BUILD_AND_TEST.md#getting-started).

### 1. Get the plugin library repo:
`go get github.com/solarwinds/snap-plugin-lib/...` will add the repo to your $GOPATH
Expand Down Expand Up @@ -58,7 +58,7 @@ $ go build -o example-streaming-collector examples/snap-plugin-collector-rand-st
```

### 4. Run Snap, Load Plugins, and Run Tasks
You can now try [running Snap](https://github.com/librato/snap#running-snap), [loading plugins](https://github.com/librato/snap#load-plugins), and [running tasks](https://github.com/librato/snap#running-tasks). You'll find a sample task.yml file for these examples at the bottom of this README.md.
You can now try [running Snap](https://github.com/solarwinds-cloud/snap#running-snap), [loading plugins](https://github.com/solarwinds-cloud/snap#load-plugins), and [running tasks](https://github.com/solarwinds-cloud/snap#running-tasks). You'll find a sample task.yml file for these examples at the bottom of this README.md.

Below are some sample commands to try:

Expand Down Expand Up @@ -107,7 +107,7 @@ test-file-publisher 1 publisher false loaded Fri, 23 Sep 2016 17:44:

### Create a task.
You can create a task.yml file for these examples using the following code.
Discover [how tasks work](https://github.com/librato/snap/blob/master/docs/TASKS.md).
Discover [how tasks work](https://github.com/solarwinds-cloud/snap/blob/master/docs/TASKS.md).

task.yml

Expand Down
37 changes: 29 additions & 8 deletions examples/v1/go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,41 @@
module github.com/solarwinds/snap-plugin-lib/examples/v1

go 1.13
go 1.22.5

require (
github.com/josephspurrier/goversioninfo v1.4.0
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/securego/gosec/v2 v2.9.5
github.com/smartystreets/goconvey v1.7.2
github.com/solarwinds/snap-plugin-lib v1.0.0
github.com/urfave/cli v1.22.5
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d // indirect
golang.org/x/sys v0.0.0-20220111092808-5a964db01320 // indirect
golang.org/x/tools v0.1.8
google.golang.org/genproto v0.0.0-20220112215332-a9c7c0acf9f2 // indirect
google.golang.org/grpc v1.43.0
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
golang.org/x/tools v0.6.0
google.golang.org/grpc v1.56.3
honnef.co/go/tools v0.2.2
)

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/akavel/rsrc v0.10.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gookit/color v1.5.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/julienschmidt/httprouter v1.3.0 // indirect
github.com/magefile/mage v1.10.0 // indirect
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.8.0 // indirect
github.com/smartystreets/assertions v1.2.0 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
)
Loading

0 comments on commit 895bc31

Please sign in to comment.