• Stars
    star
    3
  • Rank 3,963,521 (Top 79 %)
  • Language
    Go
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Template project for a RoadRunner plugin

RoadRunner Plugin Template

Total alerts All releases

This repo can be used to scaffold a RoadRunner Plugin. Follow these steps to get started:
  1. Update the module name in go.mod

    module github.com/peterfox/roadrunner-plugin-template
    
  2. Ideally you should rename the package in all the .go files from plugin to something else.

    package plugin
  3. Rename the plugin to whatever is appropriate, this should be kept to snake case:

    const PluginName = "plugin"
  4. Update the LICENSE.md file

  5. If your plugin is not going to be public on GitHub then you should remove .github/workflows/codeql-analysis.yml. You may also need to enable code scanning for the repository

  6. Update the contributors in the README.md.

  7. Update the README.md references to the plugin, installation and usage.

  8. Update the badges at the top of README.md to point to your own repository.

  9. Update the .github/FUNDING.yml file.

  10. Remove the todo section from your README.md

Installation

To use this plugin with RoadRunner you will need to fork or clone your own copy of the RoadRunner binary.

You can import the plugin via go modules:

go get github.com/peterfox/roadrunner-plugin-demo

From there you can edit the plugins.go file to import the plugin.

package container

import (
    // ...
    demoPlugin "github.com/peterfox/roadrunner-plugin-template"
    // ...
)

// Plugins returns active plugins for the endure container. Feel free to add or remove any plugins.
func Plugins() []interface{} {
	return []interface{}{
        // ...
        &demoPlugin.Plugin{},
        // ...
    }
}

By importing this plugin and registering it the plugin will be compiled into the final binary.

The plugin will require that the .rr.yaml config has the key plugin for the plugin won't initialise with roadrunner.

plugin:
  value: foobar

Usage

To make use of this plugin via PHP you must install the Spiral Goridge library.

You can use the following code as an example in php:

<?php

use Spiral\Goridge\RPC\RPC;
use Spiral\RoadRunner\Environment;

$rpc = RPC::create(Environment::fromGlobals()->getRPCAddress());

// returns ['message' => 'test']
$output = $rpc->call('plugin.Message', ['message' => 'test']);

Testing

You may download the project and test the plugin using the following command.

go test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

More Repositories

1

laravel-webhook-demo

The example code for the article https://medium.com/@SlyFireFox/laravel-innovations-making-your-own-webhook-mechanism-through-notifications-96e75e99a2b1
PHP
17
star
2

laravel-elixir-mjml

A task plugin for running MJML templates in Laravel Elixir
JavaScript
11
star
3

hexavel

A modified version of the Laravel Framework
PHP
7
star
4

openai-laravel-demo

A demo app for using OpenAI with Laravel
PHP
7
star
5

macros-demo

A Demo for Macros
PHP
7
star
6

nova-social-login-demo

A demo for how to implement Social Logins for Laravel Nova
PHP
5
star
7

laravel-runscope

A PHP library for making it easy to use Runscope with your web hooks and external API calls
PHP
5
star
8

notifications-demo

The code in this project is an example of how to create a simple streamlined email unsubscribe mechanism for Laravel's notification system
PHP
5
star
9

hieroglyph

A package to simplify changing between different icon sets
PHP
3
star
10

bitpayclient

An OOP PHP client for interacting with the BitPay API
PHP
2
star
11

validation-rule-demo

The example code for the article https://medium.com/@SlyFireFox/test-driven-development-for-custom-laravel-validation-rules-669d01e34a65
PHP
2
star
12

seo-demo

The code in this project is an example of how to create root level URLs for dynamic content without causing wildcard clashes
PHP
2
star
13

make-command-demo

A demo for making new Make commands in Laravel
PHP
2
star
14

laravel-incident-logs-demo

The example code for the article https://medium.com/@SlyFireFox/laravel-how-to-make-incident-logs-d7fa88e48490
PHP
2
star
15

hexavel-spark

A library for making installs of Spark compatible with Laravel Spark
PHP
1
star
16

torino

An example of a simple Onion address generator
JavaScript
1
star
17

graphaware-reco-client-php

A configurable PHP library for fetching recommendations from a GraphAware Recommendation setup
PHP
1
star
18

waitformysql

A mini golang util for waiting for a mysql database to be up
Go
1
star
19

laravel-casts-examples

A demo for Laravel Custom Casts with common examples for Money, Location/Address and Date Intervals
PHP
1
star
20

testing-trait-hooks-demo

Demo for Trait hooks to use in Test Cases
PHP
1
star
21

custom-make-model-command

A demo for customising the Laravel make model command to use singular table names.
PHP
1
star