npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@godspeedsystems/plugins-redis-as-datasource

v1.0.4

Published

redis as datasource plugin for Godspeed Framework

Downloads

37

Readme

godspeed-plugin-Redis-as-datasource

Welcome to the Godspeed Redis Plugin! 🚀

The Godspeed Redis Plugin provides integration with Redis, allowing developers to seamlessly interact with Redis databases within the Godspeed framework. This plugin simplifies the process of working with Redis data, providing a standardized way to perform common Redis operations.

How to add Redis plugin in your project:

  • Create a godspeed project from the CLI and add the Redis plugin the plugin from the CLI and select the @godspeedsystems/plugins-redis-as-datasource to integrate the plugin.
macbookpro@MacbookPros-MBP gs-test-project % godspeed plugin add   


       ,_,   ╔════════════════════════════════════╗
      (o,o)  ║        Welcome to Godspeed         ║
     ({___}) ║    World's First Meta Framework    ║
       " "   ╚════════════════════════════════════╝


? Please select godspeed plugin to install: (Press <space> to select, <Up and Down> to move rows)
┌────┬───────────────────────────────────┬─────────────────────────────────────────────────────────────────┐
│    │ Name                              │ Description                                                     │
├────┼───────────────────────────────────┼─────────────────────────────────────────────────────────────────┤
│  ◯ │ kafka-as-datasource-as-eventsource│ kafka as datasource-as-eventsource plugin for Godspeed Framework│
├────┼───────────────────────────────────┼─────────────────────────────────────────────────────────────────┤
│  ◯ │ cron-as-eventsource               │ Cron as eventsource plugin for Godspeed Framework               │
├────┼───────────────────────────────────┼─────────────────────────────────────────────────────────────────┤
│ ❯◯ │ redis-as-datasource               │ redis as datasource plugin for Godspeed Framework               │
├────┼───────────────────────────────────┼─────────────────────────────────────────────────────────────────┤
│  ◯ │ elasticgraph-as-datasource        │ elasticgraph as datasource plugin for Godspeed Framework        │
├────┼───────────────────────────────────┼─────────────────────────────────────────────────────────────────┤
│  ◯ │ axios-as-datasource               │ Axios as datasource plugin for Godspeed Framework               │
└────┴───────────────────────────────────┴─────────────────────────────────────────────────────────────────┘
  • You will find the files in your project related to the Redis plugin at src/datasources/types/redis.ts and src/datasources/redis.yaml.

Configure your Redis data source with connection string.

redis config (src/datasources/redis.yaml)

type: redis
url: redis://alice:[email protected]:6380

Here are some example workflows of using the Redis plugin in your Godspeed workflows:

Workflow to Get a Value from Redis:

id: get_redis_value tasks:

  • id: get_task fn: datasource.redis.get args: key: 'example_key'

Workflow to Set a Value in Redis:

id: set_redis_value tasks:

  • id: set_task fn: datasource.redis.set args: key: 'example_key' value: 'example_value'

How It Helps

The Godspeed Redis Plugin offers the following benefits:

  1. Redis Integration: The plugin abstracts away the complexities of setting up a Redis client, making it effortless to connect to Redis databases and perform operations.

  2. Unified Data Source: Developers can use a uniform API to define data sources that interact with Redis. This enhances consistency and ease of use across different parts of the application.

  3. Error Handling: The plugin includes robust error handling, allowing developers to gracefully handle scenarios such as connection issues, key not found, and other Redis-related errors.

  4. Integration with Godspeed Core: The plugin seamlessly integrates with the Godspeed Core library, aligning with the principles of the Godspeed framework and enabling streamlined event-driven workflows.

Plugin Components

The plugin consists of the following key components:

1. DataSource Class

  • This class extends GSDataSource, a base class provided by the Godspeed framework for creating data sources.

  • It initializes a Redis client to interact with Redis databases based on the provided configuration options.

  • The execute method is used to define how the plugin should perform Redis operations. It maps incoming parameters to Redis commands, processes the operation, and handles various response scenarios.

2. Constants

  • SourceType: A constant representing the source type of the plugin, which is 'DS' (data source).

  • Type: A constant representing the loader file of the plugin. The final loader file will be located in the 'types' directory and named ${Type.js}, where Type is 'redis' in this case.

  • CONFIG_FILE_NAME: In the context of a data source, this constant also serves as the data source name. In this plugin, it is set to 'redis'.

  • DEFAULT_CONFIG: A default configuration object with Redis options like host, port, and other settings.

Conclusion

The Godspeed Redis Plugin is a valuable addition to the Godspeed framework, providing a standardized way to interact with Redis databases. With this plugin, you can effortlessly perform Redis operations, handle responses, and streamline data storage within your applications.

We value your feedback and contributions. If you have any questions, suggestions, or encounter issues while using the plugin, please reach out to us. Your insights and ideas help us enhance and improve this plugin for the entire Godspeed community.

We're excited to see how you leverage the Godspeed Redis Plugin in your projects and look forward to collaborating with you to make your applications even more powerful. Happy coding!

Thank You For Using Godspeed