Skip to content

Commit

Permalink
Merge pull request #1167 from gofr-dev/release-1.25.0
Browse files Browse the repository at this point in the history
Release v1.25.0
  • Loading branch information
vikash authored Nov 4, 2024
2 parents cd62d12 + a323409 commit ca59aa0
Show file tree
Hide file tree
Showing 20 changed files with 776 additions and 195 deletions.
139 changes: 81 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,75 @@
<h1 style="text-align: center; font-size: 100px; font-weight: 500;">
<i>Go</i>Fr
</h1>

<p align="center">
<img align="center" width="300" alt="logo" src="https://github.com/gofr-dev/gofr/assets/44036979/916fe7b1-42fb-4af1-9e0b-4a7a064c243c">
</p>
<p align="center"><b>
GoFr is an opinionated microservice development framework.</b></p>

<div align=center>
<a href="https://pkg.go.dev/gofr.dev"><img src="https://img.shields.io/badge/%F0%9F%93%9A%20godoc-pkg-00ACD7.svg?color=00ACD7&style=flat-square"></a>
<a href="https://gofr.dev/docs"><img src="https://img.shields.io/badge/%F0%9F%92%A1%20gofr-docs-00ACD7.svg?style=flat-square"></a>
<a href="https://codeclimate.com/github/gofr-dev/gofr/maintainability"><img src="https://api.codeclimate.com/v1/badges/58c8d0443a3d08c59c07/maintainability" /></a>
<a href="https://codeclimate.com/github/gofr-dev/gofr/test_coverage"><img src="https://api.codeclimate.com/v1/badges/58c8d0443a3d08c59c07/test_coverage" /></a>
<a href="https://goreportcard.com/report/gofr.dev"><img src="https://goreportcard.com/badge/gofr.dev"></a>
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg"></a>
<a href="https://discord.gg/wsaSkQTdgq"><img src="https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat" /></a>

<h2 align="center" style="font-size: 28px;"><b>GoFr: An Opinionated Microservice Development Framework</b></h2>

<div align="center">
<a href="https://pkg.go.dev/gofr.dev"><img src="https://img.shields.io/badge/GoDoc-Read%20Documentation-blue?style=for-the-badge" alt="godoc"></a>
<a href="https://gofr.dev/docs"><img src="https://img.shields.io/badge/GoFr-Docs-orange?style=for-the-badge" alt="gofr-docs"></a>
<a href="https://codeclimate.com/github/gofr-dev/gofr/maintainability"><img src="https://img.shields.io/codeclimate/maintainability/gofr-dev/gofr?style=for-the-badge" alt="maintainability"></a>
<a href="https://codeclimate.com/github/gofr-dev/gofr/test_coverage"><img src="https://img.shields.io/codeclimate/coverage/gofr-dev/gofr?style=for-the-badge" alt="test-coverage"></a>
<a href="https://goreportcard.com/report/gofr.dev"><img src="https://goreportcard.com/badge/gofr.dev?style=for-the-badge" alt="Go Report Card"></a>
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-blue?style=for-the-badge" alt="Apache 2.0 License"></a>
<a href="https://discord.gg/wsaSkQTdgq"><img src="https://img.shields.io/badge/discord-join-us?style=for-the-badge&logo=discord&color=7289DA" alt="discord" /></a>
<a href="https://gurubase.io/g/gofr"><img src="https://img.shields.io/badge/Gurubase-Ask%20GoFr%20Guru-006BFF?style=for-the-badge" /></a>
</div>

Listed in [CNCF Landscape](https://landscape.cncf.io/?selected=go-fr).
<h2 align="center">Listed in the <a href="https://landscape.cncf.io/?selected=go-fr">CNCF Landscape</a></h2>

## 🎯 **Goal**
GoFr is designed to **simplify microservice development**, with key focuses on **Kubernetes deployment** and **out-of-the-box observability**. While capable of building generic applications, **microservices** remain at its core.

## 🎯 Goal
Even though generic applications can be written using GoFr, our main focus is to simplify the development of microservices.
We will focus on deployment in Kubernetes and aspire to provide out-of-the-box observability.
---

## 💡 Key Features
## 💡 **Key Features**

1. Simple API syntax
2. REST Standards by default
3. Configuration management
4. [Observability](https://gofr.dev/docs/quick-start/observability) (Logs, Traces, Metrics)
5. Inbuilt [Auth Middleware](https://gofr.dev/docs/advanced-guide/http-authentication) & Support for [Custom Middleware](https://gofr.dev/docs/advanced-guide/middlewares)
6. [gRPC support](https://gofr.dev/docs/advanced-guide/grpc)
7. [HTTP service](https://gofr.dev/docs/advanced-guide/http-communication) with support for [Circuit Breaker](https://gofr.dev/docs/advanced-guide/circuit-breaker)
8. [Pub/Sub](https://gofr.dev/docs/advanced-guide/using-publisher-subscriber)
9. [Health Check](https://gofr.dev/docs/advanced-guide/monitoring-service-health) by default for all datasources.
10. [Database Migration](https://gofr.dev/docs/advanced-guide/handling-data-migrations)
11. [Cron Jobs](https://gofr.dev/docs/advanced-guide/using-cron)
12. Support for [changing Log Level](https://gofr.dev/docs/advanced-guide/remote-log-level-change) without restarting the application.
13. [Swagger Rendering](https://gofr.dev/docs/advanced-guide/swagger-documentation)
14. [Abstracted File Systems](https://gofr.dev/docs/advanced-guide/handling-file)
15. [Websockets](https://gofr.dev/docs/advanced-guide/handling-file)
1. **Simple API Syntax**
2. **REST Standards by Default**
3. **Configuration Management**
4. **[Observability](https://gofr.dev/docs/quick-start/observability)** (Logs, Traces, Metrics)
5. **Inbuilt [Auth Middleware](https://gofr.dev/docs/advanced-guide/http-authentication)** & Custom Middleware Support
6. **[gRPC Support](https://gofr.dev/docs/advanced-guide/grpc)**
7. **[HTTP Service](https://gofr.dev/docs/advanced-guide/http-communication)** with Circuit Breaker Support
8. **[Pub/Sub](https://gofr.dev/docs/advanced-guide/using-publisher-subscriber)**
9. **[Health Check](https://gofr.dev/docs/advanced-guide/monitoring-service-health)** for All Datasources
10. **[Database Migration](https://gofr.dev/docs/advanced-guide/handling-data-migrations)**
11. **[Cron Jobs](https://gofr.dev/docs/advanced-guide/using-cron)**
12. **Support for [Changing Log Level](https://gofr.dev/docs/advanced-guide/remote-log-level-change) Without Restarting**
13. **[Swagger Rendering](https://gofr.dev/docs/advanced-guide/swagger-documentation)**
14. **[Abstracted File Systems](https://gofr.dev/docs/advanced-guide/handling-file)**
15. **[Websockets](https://gofr.dev/docs/advanced-guide/handling-file)**

![banner.gif](.github/banner.gif)
---

## Getting started
### Prerequisites
GoFr requires [Go](https://go.dev/) version [1.21](https://go.dev/doc/devel/release#go1.21.0) or above.
## 🚀 **Getting Started**

### Getting GoFr
With [Go's module support](https://go.dev/wiki/Modules#how-to-use-modules), `go [build|run|test]` automatically fetches the necessary dependencies when you add the import in your code:
### **Prerequisites**
- GoFr requires **[Go](https://go.dev/)** version **[1.21](https://go.dev/doc/devel/release#go1.21.0)** or above.

```sh
### **Installation**
To get started with GoFr, add the following import to your code and use Go’s module support to automatically fetch dependencies:

```go
import "gofr.dev/pkg/gofr"
```

Alternatively, use `go get`:
Alternatively, use the command:

```sh
```bash
go get -u gofr.dev/pkg/gofr
```
### Running GoFr
A basic example:

---

## 🏃 **Running GoFr**

Here's a simple example to get a GoFr application up and running:

```go
package main

Expand All @@ -67,35 +79,46 @@ func main() {
app := gofr.New()

app.GET("/greet", func(ctx *gofr.Context) (interface{}, error) {

return "Hello World!", nil
})

app.Run() // listen and serve on localhost:8000
app.Run() // listens and serves on localhost:8000
}
```

To run the code, use the `go run` command, like:
To run this code:

```sh
```bash
$ go run main.go
```

Then visit [`localhost:8000/greet`](http://localhost:8000/greet) in your browser to see the response!
Visit [`localhost:8000/greet`](http://localhost:8000/greet) to see the result.

---

## 📂 **More Examples**

Explore a variety of ready-to-run examples in the [GoFr examples directory](https://github.com/gofr-dev/gofr/tree/development/examples).

---

## 👩‍💻 **Documentation**

- **[GoDoc](https://pkg.go.dev/gofr.dev)**: Official API documentation.
- **[GoFr Documentation](https://gofr.dev/docs)**: Comprehensive guides and resources.

---

### See more examples
A number of ready-to-run examples demonstrating various use cases of GoFr are available in the [GoFr examples](https://github.com/gofr-dev/gofr/tree/development/examples) directory.
## 👍 **Contribute**

## 👩‍💻Documentation
See the [godocs](https://pkg.go.dev/gofr.dev).
Help us make GoFr even better:

The documentation is also available on [gofr.dev](https://gofr.dev/docs).
1. **Star** this repo on GitHub! 🌟
2. Write a review or tutorial on **[Medium](https://medium.com/)**, **[Dev.to](https://dev.to/)**, or your blog.
3. Review the **[CONTRIBUTING.md](CONTRIBUTING.md)** guide to learn how to contribute to the project.

## 👍 Contribute
If you want to say thank you and/or support the active development of GoFr:
---

1. [Star](https://docs.github.com/en/get-started/exploring-projects-on-github/saving-repositories-with-stars) the repo.
2. Write a review or tutorial on [Medium](https://medium.com/), [Dev.to](https://dev.to/) or personal blog.
3. Visit [CONTRIBUTING](CONTRIBUTING.md) for details on submitting patches and the contribution workflow.
### 🎁 **Get a GoFr T-Shirt & Stickers!**

If your PR is merged or you have written an article or contributed in someway to development or spreading the word about GoFr, fill the [Google Form](https://forms.gle/R1Yz7ZzY3U5WWTgy5), and we will send you a <b>GoFr T-Shirt and Stickers</b> as a token of appreciation.
If your PR is merged, or if you contribute by writing articles or promoting GoFr, we invite you to fill out [this form](https://forms.gle/R1Yz7ZzY3U5WWTgy5) to claim your GoFr merchandise as a token of our appreciation!
12 changes: 11 additions & 1 deletion docs/quick-start/connecting-redis/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Optionally, you can use Docker to set up a development environment as described
docker run --name gofr-redis -p 6379:6379 -d redis
```

You can also set up a development environment with password authentication as described below.

```bash
docker run --name gofr-redis -p 2002:6379 -d \
-e REDIS_PASSWORD=password \
redis:7.0.5 --requirepass password
```

You can set a sample key `greeting` using the following command:

```bash
Expand All @@ -27,13 +35,15 @@ Following configuration keys are required for Redis connectivity:

* `REDIS_HOST`: It specifies the hostname or IP address of your Redis server.
* `REDIS_PORT`: It specifies the port number on which your Redis server is listening. The default Redis port is 6379.

* `REDIS_USER` : This is the user you'll use to connect to your Redis server. You can configure multiple users with different permissions in a single Redis container. For more details, refer to the [official docs](https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/)
* `REDIS_PASSWORD`: The password is required only if your Redis server is configured for authentication; if authentication is not enabled, no password is necessary.
```dotenv
APP_NAME=test-service
HTTP_PORT=9000
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=password
```

The following code snippet demonstrates how to retrieve data from a Redis key named "greeting":
Expand Down
26 changes: 13 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module gofr.dev
go 1.22

require (
cloud.google.com/go/pubsub v1.44.0
cloud.google.com/go/pubsub v1.45.1
github.com/DATA-DOG/go-sqlmock v1.5.2
github.com/XSAM/otelsql v0.34.0
github.com/alicebob/miniredis/v2 v2.33.0
Expand All @@ -19,35 +19,35 @@ require (
github.com/joho/godotenv v1.5.1
github.com/lib/pq v1.10.9
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.20.4
github.com/redis/go-redis/extra/redisotel/v9 v9.0.5
github.com/redis/go-redis/v9 v9.6.2
github.com/prometheus/client_golang v1.20.5
github.com/redis/go-redis/extra/redisotel/v9 v9.7.0
github.com/redis/go-redis/v9 v9.7.0
github.com/segmentio/kafka-go v0.4.47
github.com/stretchr/testify v1.9.0
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.55.0
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.56.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0
go.opentelemetry.io/otel v1.31.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0
go.opentelemetry.io/otel/exporters/prometheus v0.52.0
go.opentelemetry.io/otel/exporters/zipkin v1.30.0
go.opentelemetry.io/otel/exporters/zipkin v1.31.0
go.opentelemetry.io/otel/metric v1.31.0
go.opentelemetry.io/otel/sdk v1.31.0
go.opentelemetry.io/otel/sdk/metric v1.30.0
go.opentelemetry.io/otel/trace v1.31.0
go.uber.org/mock v0.4.0
go.uber.org/mock v0.5.0
golang.org/x/oauth2 v0.23.0
golang.org/x/sync v0.8.0
golang.org/x/term v0.25.0
golang.org/x/text v0.19.0
google.golang.org/api v0.200.0
google.golang.org/api v0.203.0
google.golang.org/grpc v1.67.1
google.golang.org/protobuf v1.35.1
modernc.org/sqlite v1.33.1
)

require (
cloud.google.com/go v0.115.1 // indirect
cloud.google.com/go/auth v0.9.8 // indirect
cloud.google.com/go v0.116.0 // indirect
cloud.google.com/go/auth v0.9.9 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.5.2 // indirect
cloud.google.com/go/iam v1.2.1 // indirect
Expand Down Expand Up @@ -79,7 +79,7 @@ require (
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.59.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect
github.com/redis/go-redis/extra/rediscmd/v9 v9.7.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/yuin/gopher-lua v1.1.1 // indirect
Expand All @@ -92,9 +92,9 @@ require (
golang.org/x/net v0.30.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/time v0.7.0 // indirect
google.golang.org/genproto v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
modernc.org/libc v1.55.3 // indirect
Expand Down
Loading

0 comments on commit ca59aa0

Please sign in to comment.