Giter Site home page Giter Site logo

lerna-test's Introduction

Godspeed

Godspeed

Open Source Plugins Development Ecosystem

contributions welcome Open Bounties Discord


Godspeed Plug-in ๐Ÿ”—

Godspeed Plugins are the way to extend the core godspeed framework. Currently we support adding Event Source and Data Source as plugin.

A brief description of how we write new plug-in in godspeed framework.

Steps to create new plug-in in our godspeed framework:

Certainly, here are the provided steps rephrased:

  1. Begin by installing the godspeed-plugin-generator globally using the following commands:

    npm install -g generator-godspeed-plugin
    npm install -g yo
  2. To initiate the creation of your plugin, execute the following command in your terminal:

    yo godspeed-plugin
  3. After running the above command, you'll be prompted to enter your desired plugin name. Proceed by typing it in:

    ? Enter your plugin name: (your-plugin-name)
  4. Select the type of plugin that aligns with your project's requirements. You can choose from the following options:

    ? Select the type of plugin: (Use arrow keys)
    โฏ DataSource 
      EventSource 
      DataSource-As-EventSource 
  5. Depending on your selection, the plugin generator will generate a template with your chosen plugin name, such as "your-plugin-name-as-datasource." The structure of the generated files will be as follows:

    .
    โ”œโ”€โ”€ src
    |   โ””โ”€โ”€ index.ts
    |
    โ”œโ”€โ”€ package.json
    |
    โ”œโ”€โ”€ README.md
    |
    โ”œโ”€โ”€ tsconfig.json
    |
    โ”œโ”€โ”€ .gitignore
    |
    โ””โ”€โ”€ .npmignore
    
  6. To customize your plugin, navigate to the index.ts file located in the src directory. You can modify the content within this file to meet your specific plugin requirements. There's no need to make changes to any other files outside of index.ts.

If you opt for DataSource, the index.ts file appears as follows:


  import { GSContext,  GSDataSource, GSStatus, PlainObject,} from "@godspeedsystems/core";

  export default class DataSource extends GSDataSource {
  protected async initClient(): Promise<object> {
      try {
        // initialize your client
      } catch (error) {
      throw error;
      }
  }

  async execute(ctx: GSContext, args: PlainObject): Promise<any> {
      
      try {
        // execute methods
        
      } catch (error) {
        throw error;
      }
  }
  }
  const SourceType = 'DS';
  const Type = "y"; // this is the loader file of the plugin, So the final loader file will be `types/${Type.js}`
  const CONFIG_FILE_NAME = "y"; // in case of event source, this also works as event identifier, and in case of datasource works as datasource name
  const DEFAULT_CONFIG = {};

  export {
    DataSource,
    SourceType,
    Type,
    CONFIG_FILE_NAME,
    DEFAULT_CONFIG
  }

If you opt for EventSource, the index.ts file appears as follows:

  import { PlainObject, GSActor, GSCloudEvent, GSStatus, GSEventSource, GSDataSource, GSContext } from "@godspeedsystems/core";


  class EventSource extends GSEventSource {

  protected initClient(): Promise<PlainObject> {
      // initialize your client
  }
  async subscribeToEvent(eventRoute: string, eventConfig: PlainObject, processEvent: (event: GSCloudEvent, eventConfig: PlainObject) => Promise<GSStatus>): Promise<void> {
      try {
        //  subscribeToEvent
        
      } catch (error) {
        throw error;
      }
  }
  }

  const SourceType = 'ES';
  const Type = "p"; // this is the loader file of the plugin, So the final loader file will be `types/${Type.js}`
  const CONFIG_FILE_NAME = "p"; // in case of event source, this also works as event identifier, and in case of datasource works as datasource name
  const DEFAULT_CONFIG = {};

  export {
    EventSource,
    SourceType,
    Type,
    CONFIG_FILE_NAME,
    DEFAULT_CONFIG
  }

If you opt for DataSource-As-EventSource , the index.ts file appears as follows:


  import { GSContext, GSDataSource, PlainObject, GSDataSourceAsEventSource, GSCloudEvent, GSStatus, GSActor} from "@godspeedsystems/core";

  class DataSource extends GSDataSource {
    protected async initClient(): Promise<PlainObject> {
      try {
        
        // initialize your client
      } catch (error) {
        throw error;
      }

    }

    async execute(ctx: GSContext, args: PlainObject): Promise<any> {
      try {
        // execute methods
        
      } catch (error) {
        throw error;
      }
    }
  }

  class EventSource extends GSDataSourceAsEventSource {
    async subscribeToEvent(
      eventKey: string,
      eventConfig: PlainObject,
      processEvent: (
        event: GSCloudEvent,
        eventConfig: PlainObject
      ) => Promise<GSStatus>
    ): Promise<void> {

      //  subscribeToEvent
    }
  }
  const SourceType = 'BOTH';
  const Type = "shirisha"; // this is the loader file of the plugin, So the final loader file will be `types/${Type.js}`
  const CONFIG_FILE_NAME = "shirisha"; // in case of event source, this also works as event identifier, and in case of datasource works as datasource name
  const DEFAULT_CONFIG = {};

  export {
    DataSource,
    EventSource,
    SourceType,
    Type,
    CONFIG_FILE_NAME,
    DEFAULT_CONFIG
  }
  1. For better understanding checkout Examples.

    AWS (DataSource)

    CRON (EventSource)

    KAFKA (DataSource-As-EventSource)

List of Plugins

No Plugin Name Type npm package link Documentation Maintained by
1 Express Eventsource npm readme Godspeed
2 Prisma Datasource npm readme Godspeed
3 Apache Kafka DS & ES readme Godspeed
4 CRON Eventsource Eventsource npm readme Godspeed
5 MongoDB
6 Cassandra
7 Redis
8 Elasticsearch
9 Splunk
10 MySQL
11 RabbitMQ
12 Amazon S3
13 Salesforce
14 HubSpot
15 MailChimp
16 Microsoft Access
17 SQLite
18 DB2 (IBM Database)
19 Neo4j
20 CockroachDB
21 MariaDB
22 Google Cloud Pub/Sub
23 RabbitMQ
24 GraphQL
25 gRPC
26 JMeter
27 JIRA Software
28 Jenkins
29 GitLab CI/CD
30 Azure DevOps
31 Heroku
32 Vercel
33 Netlify
34 PostgreSQL

lerna-test's People

Contributors

yaswanth-godspeed avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.