diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d32844..447eddf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,11 +15,9 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: [ '1.19', '1.20', '1.21.x' ] + go-version: '1.21.x' - name: Gomod run: go mod download - - name: Golint - run: hack/verify-golint.sh - name: Gofmt run: hack/verify-gofmt.sh - name: Go vet diff --git a/connector/auth/doc.go b/connector/auth/doc.go index 624e790..d074778 100644 --- a/connector/auth/doc.go +++ b/connector/auth/doc.go @@ -17,7 +17,8 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -/*Package auth provides authentication properties and functionalities for the connector service. +/* +Package auth provides authentication properties and functionalities for the connector service. TokenValidator provides the functionality for authenticating a JWT token in a received request. Others provide the basic structures needed. diff --git a/connector/client/doc.go b/connector/client/doc.go index 1ee97ff..9ad01c4 100644 --- a/connector/client/doc.go +++ b/connector/client/doc.go @@ -17,7 +17,8 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -/*Package client provides a HTTP client for calls to the connector service. +/* +Package client provides a HTTP client for calls to the connector service. The configuration needed for the call are defined by the struct Config */ diff --git a/core/activity/doc.go b/core/activity/doc.go index 3903dd1..8174e98 100644 --- a/core/activity/doc.go +++ b/core/activity/doc.go @@ -17,7 +17,8 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -/*Package activity acts as a handler for any received activity and the user defined operation +/* +Package activity acts as a handler for any received activity and the user defined operation on that activity. It then is responsible for sending a reply to the connector service. */ package activity diff --git a/core/doc.go b/core/doc.go index cddfc99..a9b72fa 100644 --- a/core/doc.go +++ b/core/doc.go @@ -17,7 +17,8 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -/*Package core is the entry point and the main interface for a user program. +/* +Package core is the entry point and the main interface for a user program. It provides an adapter to the user program using which all the operations can be made on this SDK. See the example to understand how to use this package to perform operations on the Bot Framwework connector service. diff --git a/samples/echobot/doc.go b/samples/echobot/doc.go index d3300d6..f4d3bb2 100644 --- a/samples/echobot/doc.go +++ b/samples/echobot/doc.go @@ -1,17 +1,18 @@ -/*Bot Framework echo bot sample. +/* +Bot Framework echo bot sample. This bot uses msbotbuilder-go: https://github.com/infracloudio/msbotbuilder-go. It shows how to create a simple bot that accepts input from the user and echoes it back. - -Run the example +# Run the example Bring up a terminal and run. Set two variables for the session as APP_ID and APP_PASSWORD to the values of your BotFramework app_id and password. Then, run: - go run main.go -This will start a server which will listen on port 3978 + go run main.go + +# This will start a server which will listen on port 3978 -Understanding the example +# Understanding the example The program starts by creating a hanlder struct of type `activity.HandlerFuncs`. This struct contains defination for the `OnMessageFunc` field which is a treated as a callback by the library @@ -23,16 +24,17 @@ on the respective event. }, } - A webserver is started with a hanlder passed the received payload to `adapter.ParseRequest` This methods authenticates the payload, parses the request and returns an Activity value. + activity, err := adapter.ParseRequest(ctx, req) The Activity is then passed to `adapter.ProcessActivity` with the hanlder created to process the activity as per the hanlder functions and send the response to the connector service. + err = adapter.ProcessActivity(ctx, activity, customHandler) -In case of no error, this web responds with a 200 status +# In case of no error, this web responds with a 200 status To expose this local IP outside your local network, a tool like ngrok can be used.