Skip to content

Commit

Permalink
Merge pull request #1144 from gofr-dev/release-v1.24.2
Browse files Browse the repository at this point in the history
Release v1.24.2
  • Loading branch information
vipul-rawat authored Oct 22, 2024
2 parents 40a1ecf + c18607d commit cd62d12
Show file tree
Hide file tree
Showing 24 changed files with 378 additions and 148 deletions.
2 changes: 1 addition & 1 deletion docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ghcr.io/gofr-dev/website:latest
WORKDIR /app

COPY docs/quick-start /app/src/app/docs/quick-start
COPY docs/public /app/public
COPY docs/public/ /app/public
COPY docs/advanced-guide /app/src/app/docs/advanced-guide
COPY docs/references /app/src/app/docs/references
COPY docs/page.md /app/src/app/docs
Expand Down
185 changes: 146 additions & 39 deletions docs/navigation.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,162 @@
export const navigation = [
{
title: 'Quick Start Guide',
desc: "Get started with GoFR through our Quick Start Guide. Learn to build scalable applications with easy-to-follow instructions on server setup, database connections, configuration management, and more. Boost your productivity and streamline your development process.",
links: [
{ title: 'Hello Server', href: '/docs/quick-start/introduction' },
{ title: 'Configuration', href: '/docs/quick-start/configuration' },
{ title: 'Connecting Redis', href: '/docs/quick-start/connecting-redis' },
{ title: 'Connecting MySQL', href: '/docs/quick-start/connecting-mysql' },
{ title: 'Observability', href: '/docs/quick-start/observability' },
{ title: 'Adding REST Handlers', href: '/docs/quick-start/add-rest-handlers' },
{
title: 'Hello Server',
href: '/docs/quick-start/introduction' ,
desc: "Getting started with how to write a server using GoFR with basic examples and explanations. Boost your productivity with efficient coding practices and learn to build scalable applications quickly."},
{
title: 'Configuration',
href: '/docs/quick-start/configuration',
desc: "Set up environment variables, manage settings, and streamline your development process."
},
{
title: 'Connecting Redis',
href: '/docs/quick-start/connecting-redis',
desc: "Discover how to connect your GoFR application to Redis for fast in-memory data storage."
},
{
title: 'Connecting MySQL',
href: '/docs/quick-start/connecting-mysql',
desc: "Step-by-step guide on integrating MySQL with your GoFR application. With managed database connections and new methods for increasing your productivity."
},
{
title: 'Observability',
href: '/docs/quick-start/observability',
desc: "Inbuilt logging, tracing, and metrics to enhance reliability and performance."
},
{
title: 'Adding REST Handlers',
href: '/docs/quick-start/add-rest-handlers',
desc: "Fastest way to create CRUD APIs by just providing the entity."
}
],
},
{
title: 'Advanced Guide',
links: [
{ title: "Scheduling Cron Jobs", href: "/docs/advanced-guide/using-cron"},
{ title: 'Overriding Default', href: '/docs/advanced-guide/overriding-default' },
{ title: 'Remote Log Level Change', href: '/docs/advanced-guide/remote-log-level-change' },
{ title: 'Publishing Custom Metrics', href: '/docs/advanced-guide/publishing-custom-metrics' },
{ title: 'Custom Spans in Tracing', href: '/docs/advanced-guide/custom-spans-in-tracing' },
{ title: 'Adding Custom Middleware',href: '/docs/advanced-guide/middlewares'},
{ title: 'HTTP Communication', href: '/docs/advanced-guide/http-communication' },
{ title: 'HTTP Authentication', href: '/docs/advanced-guide/http-authentication' },
{ title: 'Circuit Breaker Support', href: '/docs/advanced-guide/circuit-breaker' },
{ title: 'Monitoring Service Health', href: '/docs/advanced-guide/monitoring-service-health' },
{ title: 'Handling Data Migrations', href: '/docs/advanced-guide/handling-data-migrations' },
{ title: 'Writing gRPC Server', href: '/docs/advanced-guide/grpc' },
{ title: 'Using Pub/Sub', href: '/docs/advanced-guide/using-publisher-subscriber' },
{ title: 'Injecting Databases', href: '/docs/advanced-guide/injecting-databases-drivers' },
{ title: 'Key Value Store', href: '/docs/advanced-guide/key-value-store' },
{ title: 'Dealing with SQL', href: '/docs/advanced-guide/dealing-with-sql' },
{ title: 'Automatic SwaggerUI Rendering', href: '/docs/advanced-guide/swagger-documentation' },
{ title: 'Error Handling',href: '/docs/advanced-guide/gofr-errors'},
{ title: 'Handling File', href: '/docs/advanced-guide/handling-file'},
{ title: 'WebSockets', href: '/docs/advanced-guide/websocket' },
{
title: "Scheduling Cron Jobs",
href: "/docs/advanced-guide/using-cron",
desc: "Learn how to schedule and manage cron jobs in your application for automated tasks and background processes with GoFr's CRON job management."
},
{
title: 'Overriding Default',
href: '/docs/advanced-guide/overriding-default',
desc: "Understand how to override default configurations and behaviors in GoFR to tailor framework to your specific needs."
},
{
title: 'Remote Log Level Change',
href: '/docs/advanced-guide/remote-log-level-change',
desc: "Discover how to dynamically change log levels remotely, enabling you to adjust logging verbosity without redeploying your application."
},
{
title: 'Publishing Custom Metrics',
href: '/docs/advanced-guide/publishing-custom-metrics',
desc: "Explore methods for publishing custom metrics to monitor your application's performance and gain valuable insights."
},
{
title: 'Custom Spans in Tracing',
href: '/docs/advanced-guide/custom-spans-in-tracing',
desc: "Learn to create custom spans for tracing to enhance observability and analyze the performance of your services."
},
{
title: 'Adding Custom Middleware',
href: '/docs/advanced-guide/middlewares',
desc: "Learn how to add custom middleware to your GoFR application for enhanced functionality and request processing."
},
{
title: 'HTTP Communication',
href: '/docs/advanced-guide/http-communication',
desc: "Get familiar with making HTTP requests and handling responses within your GoFR application to facilitate seamless communication."
},
{
title: 'HTTP Authentication',
href: '/docs/advanced-guide/http-authentication',
desc: "Implement various HTTP authentication methods to secure your GoFR application and protect sensitive endpoints."
},
{
title: 'Circuit Breaker Support',
href: '/docs/advanced-guide/circuit-breaker',
desc: "Understand how to implement circuit breaker patterns to enhance the resilience of your services against failures."
},
{
title: 'Monitoring Service Health',
href: '/docs/advanced-guide/monitoring-service-health',
desc: "Learn to monitor the health of your services effectively, ensuring optimal performance and quick issue resolution."
},
{
title: 'Handling Data Migrations',
href: '/docs/advanced-guide/handling-data-migrations',
desc: "Explore strategies for managing data migrations within your GoFR application to ensure smooth transitions and data integrity."
},
{
title: 'Writing gRPC Server',
href: '/docs/advanced-guide/grpc',
desc: "Step-by-step guide on writing a gRPC server in GoFR to facilitate efficient communication between services."
},
{
title: 'Using Pub/Sub',
href: '/docs/advanced-guide/using-publisher-subscriber',
desc: "Discover how to gofr seamlessly allows to integrate different Pub/Sub systems in your application for effective messaging and event-driven architectures."
},
{
title: 'Injecting Databases',
href: '/docs/advanced-guide/injecting-databases-drivers',
desc: "Learn how to inject database drivers into your GoFR application for seamless data management and operations."
},
{
title: 'Key Value Store',
href: '/docs/advanced-guide/key-value-store',
desc: "Explore how to implement and manage a key-value store in your GoFR application for fast and efficient data retrieval."
},
{
title: 'Dealing with SQL',
href: '/docs/advanced-guide/dealing-with-sql',
desc: "Get insights into best practices for working with SQL databases in GoFR, including query optimization and error handling."
},
{
title: 'Automatic SwaggerUI Rendering',
href: '/docs/advanced-guide/swagger-documentation',
desc: "Learn how to automatically render SwaggerUI documentation for your GoFR APIs, improving discoverability and usability."
},
{
title: 'Error Handling',
href: '/docs/advanced-guide/gofr-errors',
desc: "Understand error handling mechanisms in GoFR to ensure robust applications and improved user experience."
},
{
title: 'Handling File',
href: '/docs/advanced-guide/handling-file',
desc: "Explore how GoFR enables efficient file handling by abstracting remote and local filestore providers in your Go application. Learn to manage file uploads, downloads, and storage seamlessly, enhancing your application's capability to work with diverse data sources."
},
{
title: 'WebSockets',
href: '/docs/advanced-guide/websocket',
desc: "Explore how gofr eases the process of WebSocket communication in your Golang application for real-time data exchange."
}
],
},
{
title: 'References',
links: [
{ title: 'Context', href: '/docs/references/context' },
{ title: 'Configs', href: '/docs/references/configs' },
{tile: 'Testing', href:'/docs/references/testing'},
// { title: 'HTTP Service', href: '/docs/references/http-service' },
// { title: 'Files', href: '/docs/references/files' },
// { title: 'Datastore', href: '/docs/references/datastore' },
// { title: 'PubSub', href: '/docs/references/pubsub' },
// { title: 'Metrics', href: '/docs/references/metrics' },
// { title: 'Traces', href: '/docs/references/traces' },
// { title: 'Logs', href: '/docs/references/logs' },
// { title: 'Errors', href: '/docs/references/errors' },
// { title: 'Swaggger', href: '/docs/references/swagger' },
{
title: 'Context',
href: '/docs/references/context',
desc: "Discover the GoFR context, an injected object that simplifies request-specific data handling for HTTP, gRPC, and Pub/Sub calls. Learn how it extends Go's context, providing easy access to dependencies like databases, loggers, and HTTP clients. Explore features for reading HTTP requests, binding data, and accessing query and path parameters efficiently, all while reducing application complexity."
},
{
title: 'Configs',
href: '/docs/references/configs',
desc: "Learn how to manage configuration settings in your GoFR applications, including default values for environment variables. This section provides a comprehensive list of all available configurations to streamline your setup."
},
{
title: 'Testing',
href: '/docs/references/testing',
desc: "GoFR provides a centralized collection of mocks to facilitate writing effective unit tests. Explore testing strategies and tools for GoFR applications, ensuring your code is robust, reliable, and maintainable."
}
],
},
]
]
6 changes: 3 additions & 3 deletions pkg/gofr/datasource/cassandra/cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (c *Client) NewBatch(name string, batchType int) error {
func (c *Client) QueryWithCtx(ctx context.Context, dest any, stmt string, values ...any) error {
_, span := c.addTrace(ctx, "query", stmt)

defer c.sendOperationStats(&QueryLog{Query: stmt, Keyspace: c.config.Keyspace}, time.Now(), "query", span)
defer c.sendOperationStats(&QueryLog{Operation: "QueryWithCtx", Query: stmt, Keyspace: c.config.Keyspace}, time.Now(), "query", span)

rvo := reflect.ValueOf(dest)
if rvo.Kind() != reflect.Ptr {
Expand Down Expand Up @@ -171,7 +171,7 @@ func (c *Client) QueryWithCtx(ctx context.Context, dest any, stmt string, values
func (c *Client) ExecWithCtx(ctx context.Context, stmt string, values ...any) error {
_, span := c.addTrace(ctx, "exec", stmt)

defer c.sendOperationStats(&QueryLog{Query: stmt, Keyspace: c.config.Keyspace}, time.Now(), "exec", span)
defer c.sendOperationStats(&QueryLog{Operation: "ExecWithCtx", Query: stmt, Keyspace: c.config.Keyspace}, time.Now(), "exec", span)

return c.cassandra.session.query(stmt, values...).exec()
}
Expand All @@ -185,7 +185,7 @@ func (c *Client) ExecCASWithCtx(ctx context.Context, dest any, stmt string, valu

_, span := c.addTrace(ctx, "exec-cas", stmt)

defer c.sendOperationStats(&QueryLog{Query: stmt, Keyspace: c.config.Keyspace}, time.Now(), "exec-cas", span)
defer c.sendOperationStats(&QueryLog{Operation: "ExecCASWithCtx", Query: stmt, Keyspace: c.config.Keyspace}, time.Now(), "exec-cas", span)

rvo := reflect.ValueOf(dest)
if rvo.Kind() != reflect.Ptr {
Expand Down
6 changes: 3 additions & 3 deletions pkg/gofr/datasource/cassandra/cassandra_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (c *Client) ExecuteBatchCAS(name string, dest ...any) (bool, error) {
func (c *Client) BatchQueryWithCtx(ctx context.Context, name, stmt string, values ...any) error {
_, span := c.addTrace(ctx, "batch-query", stmt)

defer c.sendOperationStats(&QueryLog{Query: stmt, Keyspace: c.config.Keyspace}, time.Now(), "batch-query", span)
defer c.sendOperationStats(&QueryLog{Operation: "BatchQueryWithCtx", Query: stmt, Keyspace: c.config.Keyspace}, time.Now(), "batch-query", span)

b, ok := c.cassandra.batches[name]
if !ok {
Expand All @@ -35,7 +35,7 @@ func (c *Client) BatchQueryWithCtx(ctx context.Context, name, stmt string, value
func (c *Client) ExecuteBatchWithCtx(ctx context.Context, name string) error {
_, span := c.addTrace(ctx, "execute-batch", "batch")

defer c.sendOperationStats(&QueryLog{Query: "batch", Keyspace: c.config.Keyspace}, time.Now(), "execute-batch",
defer c.sendOperationStats(&QueryLog{Operation: "ExecuteBatchWithCtx", Query: "batch", Keyspace: c.config.Keyspace}, time.Now(), "execute-batch",
span)

b, ok := c.cassandra.batches[name]
Expand All @@ -49,7 +49,7 @@ func (c *Client) ExecuteBatchWithCtx(ctx context.Context, name string) error {
func (c *Client) ExecuteBatchCASWithCtx(ctx context.Context, name string, dest ...any) (bool, error) {
_, span := c.addTrace(ctx, "execute-batch-cas", "batch")

defer c.sendOperationStats(&QueryLog{Query: "batch", Keyspace: c.config.Keyspace}, time.Now(), "execute-batch-cas",
defer c.sendOperationStats(&QueryLog{Operation: "ExecuteBatchCASWithCtx", Query: "batch", Keyspace: c.config.Keyspace}, time.Now(), "execute-batch-cas",
span)

b, ok := c.cassandra.batches[name]
Expand Down
3 changes: 3 additions & 0 deletions pkg/gofr/datasource/cassandra/cassandra_batch_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build exclude
// +build exclude

package cassandra

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/gofr/datasource/cassandra/cassandra_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build exclude
// +build exclude

package cassandra

import (
Expand Down
11 changes: 6 additions & 5 deletions pkg/gofr/datasource/cassandra/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ type Logger interface {
}

type QueryLog struct {
Query string `json:"query"`
Duration int64 `json:"duration"`
Keyspace string `json:"keyspace,omitempty"`
Operation string `json:"operation"`
Query string `json:"query"`
Duration int64 `json:"duration"`
Keyspace string `json:"keyspace,omitempty"`
}

func (ql *QueryLog) PrettyPrint(writer io.Writer) {
fmt.Fprintf(writer, "\u001B[38;5;8m%-32s \u001B[38;5;206m%-6s\u001B[0m %8d\u001B[38;5;8mµs\u001B[0m %s\n",
clean(ql.Query), "CASS", ql.Duration, clean(ql.Keyspace))
fmt.Fprintf(writer, "\u001B[38;5;8m%-32s \u001B[38;5;206m%-6s\u001B[0m %8d\u001B[38;5;8mµs\u001B[0m %s \u001B[38;5;8m%-32s\u001B[0m\n",
clean(ql.Operation), "CASS", ql.Duration, clean(ql.Keyspace), clean(ql.Query))
}

// clean takes a string query as input and performs two operations to clean it up:
Expand Down
4 changes: 3 additions & 1 deletion pkg/gofr/datasource/cassandra/mock_interfaces.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pkg/gofr/datasource/cassandra/mock_logger.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pkg/gofr/datasource/cassandra/mock_metrics.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/gofr/datasource/file/ftp/file_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build exclude
// +build exclude

package ftp

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/gofr/datasource/file/ftp/fs_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build exclude
// +build exclude

package ftp

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/gofr/datasource/file/ftp/mock_interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/gofr/datasource/file/sftp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ require (
github.com/kr/fs v0.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/sys v0.26.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
)
1 change: 1 addition & 0 deletions pkg/gofr/datasource/file/sftp/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand Down
Loading

0 comments on commit cd62d12

Please sign in to comment.