github.com/alwitt/goutils@v0.6.4/README.md (about)

     1  # Golang Support Packages
     2  
     3  [![MIT][License-Image]][License-Url] [![Go Report Card][ReportCard-Image]][ReportCard-Url] [![CICD](https://github.com/alwitt/go-utils/actions/workflows/cicd.yaml/badge.svg?branch=main)](https://github.com/alwitt/go-utils/actions/workflows/cicd.yaml)
     4  
     5  [License-Url]: https://mit-license.org/
     6  [License-Image]: https://img.shields.io/badge/License-MIT-blue.svg
     7  [ReportCard-Url]: https://goreportcard.com/report/github.com/alwitt/go-utils
     8  [ReportCard-Image]: https://goreportcard.com/badge/github.com/alwitt/go-utils
     9  
    10  Provides common support components used in other Golang projects.
    11  
    12  ## Components Provided
    13  
    14  | Component | Description | Note |
    15  |-----------|-------------|------|
    16  | `Component` | Base `struct` for other components | Contains the support method `NewLogTagsForContext` which generates a new copy of the `apex` `logs.Fields` metadata structure. |
    17  | `RestAPIHandler` | Base `struct` for other REST API handlers | Contains utility methods, and a REST request logging middleware. |
    18  | `TaskProcessor` | An asynchronous job queue system | Provides single threaded and multi threaded worker pool implementation. |
    19  | `IntervalTimer` | Task execution trigger interval timer | Operates in periodic or one-shot mode. |
    20  | `PubSubClient` | PubSub client providing higher layer APIs | |
    21  | `RequestResponseClient` | Support request-response pattern between multiple nodes, where any node can request any other node/s. | Currently, SDK only provides a PubSub based client. |
    22  | `MessageBus` | Application-scoped message passing bus | |
    23  
    24  ## Getting Started
    25  
    26  The provided [Makefile](Makefile) contains targets for various development actions. Starting out
    27  
    28  ```
    29  make
    30  ```
    31  
    32  to prepare the development and verify linters pass. Verify project is working with
    33  
    34  > **NOTE:** The PubSub related tests required GCP credential configuration JSON, and the name of the GCP project provided as ENV variables.
    35  > * `UNITTEST_GCP_PROJECT_ID` - GCP project ID name
    36  > * `GOOGLE_APPLICATION_CREDENTIALS` - GCP authentication config JSON
    37  
    38  ```
    39  make test
    40  ```
    41  
    42  to execute all unit-tests.