Categorygithub.com/grokify/chatblox
modulepackage
0.2.8
Repository: https://github.com/grokify/chatblox.git
Documentation: pkg.go.dev

# README

Chatblox

Build Status Go Report Card Docs License

Overview

Chatblox is framework for building chatbots in Go.

This is a work in progress app and not ready for use.

Configuration

Set the following environment variables:

VariableTypeRequiredNotes
CHATBLOX_ENGINEstringyaws or nethttp
CHATBLOX_PORTintegernlocal port number for net/http
CHATBLOX_REQUEST_FUZZY_AT_MENTION_MATCHbooleannMatch non-completed at mentions.
CHATBLOX_RESPONSE_AUTO_AT_MENTIONbooleann
CHATBLOX_POST_SUFFIXstringn
GOOGLE_SERVICE_ACCOUNT_JWTJSON stringy
GOOGLE_SPREADSHEET_IDstringyID as in URL
GOOGLE_SHEET_TITLE_RECORDSstringysheet title for data records, e.g. Records
GOOGLE_SHEET_TITLE_METADATAstringysheet title for metadata, e.g. Metadata
RINGCENTRAL_BOT_IDstringybot personId in Glip
RINGCENTRAL_BOT_NAMEstringybot name in Glip for fuzzy at matching
RINGCENTRAL_SERVER_URLstringyBase API URL, e.g. https://platform.ringcentral.com
RINGCENTRAL_TOKEN_JSONJSON stringyJSON token as returned by /oauth/token endpoint

Using the AWS Engine

To use the AWS Lambda engine, you need an AWS account. If you don't hae one, the free trial account includes 1 million free Lambda requests per month forever and 1 million free API Gateway requests per month for the first year.

Installation via AWS Lambda

See the AWS docs for deployment:

https://docs.aws.amazon.com/lambda/latest/dg/lambda-go-how-to-create-deployment-package.html

Using the aws-cli you can use the following approach:

$ cd ./apps/server
$ GOOS=linux go build main.go
$ zip main.zip ./main
# --handler is the path to the executable inside the .zip
$ aws lambda create-function --region us-east-1 --function-name Databot --memory 128 --role arn:aws:iam::account-id:role/execution_role --runtime go1.x --zip-file fileb://main.zip --handler main

Installation via AWS UI

API Gateway

  1. "Actions" > "Create Resource"
  2. Click "Configure as proxy resource"
  3. Click "Enable API Gateway CORS"
  4. Click "Create Resource"
  5. Add "Lambda Function"
  6. Click "Save"
  7. Click "Actions" > "Deploy API"
  8. Add "Stage name", e.g. prod, v1, etc.
  9. Create Webhook URL for https://myId.execute-api.myRegion.amazonaws.com/v1/webhook

Keepalive

In production, there are are reasons why a RingCentral webhook may fail and become blacklisted. These should be tracked down an eliminated. If there are reasons to reenable the webhook, you can deploy the [rchooks] RingCentral Lambda keepalive function:

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
type EventResponse struct { StatusCode int `json:"statusCode,omitempty"` Headers map[string]string `json:"headers,omitempty"` Message string `json:"message,omitempty"` } func (er *EventResponse) ToJson() []byte { if len(er.Message) == 0 { er.Message = "" } msgJson, err := json.Marshal(er) if err != nil { return []byte(`{"statusCode":500,"message":"Cannot Marshal to JSON"}`) } return msgJson } */.

# Type aliases

No description provided by the author