Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v1.33.0 #1466

Merged
merged 35 commits into from
Feb 6, 2025
Merged

Release/v1.33.0 #1466

merged 35 commits into from
Feb 6, 2025

Conversation

Umang01-hash
Copy link
Member

@Umang01-hash Umang01-hash commented Feb 5, 2025

Release v1.33.0

Features

1. ArangoDB Support as a Datasource

Users can now integrate ArangoDB as a datasource within their GoFr applications. Supported Methods include :

type ArangoDB interface {
    // CreateDocument creates a new document in the specified collection.
	CreateDocument(ctx context.Context, dbName, collectionName string, document any) (string, error)
	// GetDocument retrieves a document by its ID from the specified collection.
	GetDocument(ctx context.Context, dbName, collectionName, documentID string, result any) error
	// UpdateDocument updates an existing document in the specified collection.
	UpdateDocument(ctx context.Context, dbName, collectionName, documentID string, document any) error
	// DeleteDocument deletes a document by its ID from the specified collection.
	DeleteDocument(ctx context.Context, dbName, collectionName, documentID string) error
	// GetEdges retrieves all the edge documents connected to a specific vertex in an ArangoDB graph.
	GetEdges(ctx context.Context, dbName, graphName, edgeCollection, vertexID string, resp any) error
	// Query executes an AQL query and binds the results
	Query(ctx context.Context, dbName string, query string, bindVars map[string]any, result any) error
    HealthCheck(context.Context) (any, error)
}

Refer to our official documentation to know more.

2. Default HealthCheck Support for gRPC Servers and Clients

This release introduces built-in HealthCheck support for both gRPC servers and clients.

  • Prerequisites:
    To use the new health check features, ensure that gofr-cli v0.5.0 is installed. Use it to generate your gRPC client and server templates.

  • gRPC Servers
    After running the existing command:

      gofr wrap grpc server -proto=path/to/your/proto/file
    

    A new file named health_gofr.go will be generated. This file contains the health functionality for your gRPC server. The health methods are embedded within the GoFr gRPC server struct, which looks like this:

     type {serviceName}GoFrServer struct {
         health *healthServer
     }

    Supported HealthCheck Methods:

     // Check checks if the service is healthy.
     func (h *healthServer) Check(ctx *gofr.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
     // Watch watches for any changes in the service’s health status.
     func (h *healthServer) Watch(ctx *gofr.Context, in *grpc_health_v1.HealthCheckRequest, stream grpc_health_v1.Health_WatchServer) error
     // SetServingStatus allows you to set the health status of the service (healthy, unhealthy, etc.).
     func (h *healthServer) SetServingStatus(ctx *gofr.Context, service string, status grpc_health_v1.HealthCheckResponse_ServingStatus)
     // Shutdown gracefully shuts down the service.
     func (h *healthServer) Shutdown(ctx *gofr.Context)
     // Resume resumes the service after it has been shut down.
     func (h *healthServer) Resume(ctx *gofr.Context)

    To integrate these health features, register your gRPC server in main.go as follows:

     func main() {
         app := gofr.New()
    
         packageName.Register{serviceName}ServerWithGofr(app, &{packageName}.New{serviceName}GoFrServer())
    
         app.Run()
     }
  • For gRPC Clients
    HealthCheck calls are now supported on all gRPC clients generated through the gofr-cli command i.e :

     gofr wrap grpc client -proto=path/to/your/proto/file
    

    Supported HealthCheck methods include :

     // Check checks the service health.
     func (c *{serviceName}GoFrClient) Check(ctx *gofr.Context, in *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
     // Watch allows the client to watch for health status changes.
     func (c *{serviceName}GoFrClient) Watch(ctx *gofr.Context, in *grpc_health_v1.HealthCheckRequest) (grpc.ServerStreamingClient[grpc_health_v1.HealthCheckResponse], error)

For a deeper understanding, check out our official documentation and refer to our example repo.

Fix

Resolved an issue with the AddRESTHandlers support where PUT requests were not updating records in the database when we have autoincrement tag added in our entity struct. The issue has now been fixed.

vaidehiadhi and others added 30 commits January 20, 2025 17:12
minor correction in documentation's tone
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.218.0 to 0.219.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](googleapis/google-api-go-client@v0.218.0...v0.219.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@Umang01-hash Umang01-hash merged commit d6cd85a into main Feb 6, 2025
13 checks passed
@Umang01-hash Umang01-hash deleted the release/v1.33.0 branch February 6, 2025 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants