Categorygithub.com/CourtneyLO/websocket-generator
modulepackage
0.21.0
Repository: https://github.com/courtneylo/websocket-generator.git
Documentation: pkg.go.dev

# README

WebSocket Generator - WIP

This script will generate a fully functional WebSocket using AWS Gateway Api and DynamoDB.

The WebSocket routes will be as follows:

  • $connect: Makes the WebSocket connection and saves the connectionID, timestamp and deviceTypeto a dynamoDB table. DeviceType helps to distinguish between different device connectivity
  • $disconnect: Disconnects the WebSocket and removes the connectionID from the dynamoDB table.
  • $default: This will contain the __PING__ __PONG__ functionality which ensures the connection can kept alive throughout it's use.

It will be built using Terraform and Serverless with choice of one of the following 6 languages:

  • Node
  • Typescript
  • Python
  • Golang
  • Java
  • Ruby

All Terraform and Serveless code will be added to you project in the directory of your choice. Once the coded is added you can alter or modified the code as you please. You can choose to continue using the build in scripts (see below)or use the Terraform and Serverless commands independently, it is up you. This is a quick first step to creating your own websocket.

Prerequists

  • You will need to have your aws account ID
  • For a better user interface use a full screen terminal tab

Config Questions

QuestionDescriptionDefaultExamples
1Select your preferred languageThe language you wish for your WebSocket lambdas to be writtenNodeNode, Typescript, Python, Golang, Java, Ruby
2Environment NameThe environment you wish to deploy your codeDevelopmentDevelopment, Staging, Production
3Infrastructure Code Location PathThe path should be only the path from the current directory. The current Directory path will be joined with the given path. Make sure to be in the directory (project) you wish to add the WebSocket infrastructure code too.infrastructureinfrastructure
4WebSocket Code Location PathThe path should be only the path from the current directory. The current Directory path will be joined with the given path. Make sure to be in the directory (project) you wish to add the WebSocket serverless code too.websocketwebsocket
5Terraform Resource NameThe prefix you wish to add to all your resource names. Resource name format will look as <terraform-resource-name>-<environment>-<specifc-resource-name>your projects namehelloworld-development-websocket-manager
6AWS RegionThe AWS region where you want your infrastructure to be locatedeu-west-2us-east-1
7AWS Account IDThe AWS account ID that you wish to use for your infrastructureThis is required, there is no default123456789000
8Authorization Key NameThe name of the authorization query parameter on your WebSocket URLauthorization?authorization=1234

# Packages

No description provided by the author