Skip to content

Commit

Permalink
Update the docs to mention the new JSON binary protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Sep 2, 2023
1 parent d67ffff commit db084e8
Show file tree
Hide file tree
Showing 43 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion developing-plugins/grpc-api-reference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: gRPC API Reference
description: GatewayD exposes a gRPC API that can be used to interact with the GatewayD plugin system. This API can be used by the GatewayD plugins and is available in the GatewayD SDK.
Expand Down
2 changes: 1 addition & 1 deletion developing-plugins/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Developing Plugins
nav_order: 4
Expand Down
2 changes: 1 addition & 1 deletion developing-plugins/plugin-developers-guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Plugin Developers Guide
description: Plugin developers' guide of GatewayD
Expand Down
16 changes: 8 additions & 8 deletions developing-plugins/sdk-reference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: SDK Reference
description: The GatewayD plugin SDK provides a number of interfaces, structs and methods to help you build your plugin.
Expand Down Expand Up @@ -43,22 +43,22 @@ The root of the SDK is the `github.com/gatewayd-io/gatewayd-plugin-sdk`. It cont
func DecodeBytes(encoded string) ([]byte, error)
```

- `HandleClientMessage` handles a client message. This function should be called from `onTrafficFromClient` hook. It returns a `structpb.Struct` with extra fields that are decoded from the message. It logs the error and returns `nil` if there is an error.
- `HandleClientMessage` handles a client message. This function should be called from `onTrafficFromClient` hook. It returns a `v1.Struct` with extra fields that are decoded from the message. It logs the error and returns `nil` if there is an error.

```go
func HandleClientMessage(req *structpb.Struct, logger hclog.Logger) (*structpb.Struct, error)
func HandleClientMessage(req *v1.Struct, logger hclog.Logger) (*v1.Struct, error)
```

- `HandleServerMessage` handles a server message. This function should be called from `onTrafficFromServer` hook. It returns a `structpb.Struct` with extra fields that are decoded from the message. It logs the error and returns `nil` if there is an error.
- `HandleServerMessage` handles a server message. This function should be called from `onTrafficFromServer` hook. It returns a `v1.Struct` with extra fields that are decoded from the message. It logs the error and returns `nil` if there is an error.

```go
func HandleServerMessage(resp *structpb.Struct, logger hclog.Logger) (*structpb.Struct, error)
func HandleServerMessage(resp *v1.Struct, logger hclog.Logger) (*v1.Struct, error)
```

- `GetQueryFromRequest` decodes the request and returns the query. It returns an error if the request cannot be decoded. It returns an empty string if the query is not found.

```go
func GetQueryFromRequest(req *structpb.Struct) (string, error)
func GetQueryFromRequest(req *v1.Struct) (string, error)
```

- `GetTablesFromQuery` returns the tables used in a query. It returns an error if the query cannot be parsed.
Expand Down Expand Up @@ -97,10 +97,10 @@ The root of the SDK is the `github.com/gatewayd-io/gatewayd-plugin-sdk`. It cont
func DefaultGRPCServer(opts []grpc.ServerOption) *grpc.Server
```

- `GetAttr` returns the value of an attribute from the `structpb.Struct`. It returns the default value if the attribute is not found.
- `GetAttr` returns the value of an attribute from the `v1.Struct`. It returns the default value if the attribute is not found.

```go
func GetAttr(req *structpb.Struct, key string, defaultValue interface{}) interface{}
func GetAttr(req *v1.Struct, key string, defaultValue interface{}) interface{}
```

### `plugin/v1`
Expand Down
2 changes: 1 addition & 1 deletion developing-plugins/template-projects.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Template Projects
description: Template projects can be used to quickly get started with developing plugins.
Expand Down
2 changes: 1 addition & 1 deletion getting-started/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Getting Started
nav_order: 1
Expand Down
2 changes: 1 addition & 1 deletion getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Installation
description: How to install GatewayD and its plugins on different platforms and how to build it from source.
Expand Down
2 changes: 1 addition & 1 deletion getting-started/running-gatewayd.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Running GatewayD
description: How to run GatewayD and test it with psql
Expand Down
2 changes: 1 addition & 1 deletion getting-started/welcome.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Welcome
description: Introduction to GatewayD and its key features
Expand Down
2 changes: 1 addition & 1 deletion miscellaneous/glossary.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Glossary
description: Glossary of GatewayD terms
Expand Down
2 changes: 1 addition & 1 deletion miscellaneous/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Miscellaneous
nav_order: 6
Expand Down
2 changes: 1 addition & 1 deletion miscellaneous/telemetry-and-usage-report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Telemetry and Usage Report
description: Telemetry and usage report of GatewayD
Expand Down
2 changes: 1 addition & 1 deletion plugins/gatewayd-plugin-cache.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: gatewayd-plugin-cache
description: GatewayD plugin for caching query results in Redis.
Expand Down
2 changes: 1 addition & 1 deletion plugins/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Plugins
nav_order: 5
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/API.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: API
description: GatewayD exposes a gRPC API with an HTTP gateway for querying and managing the `gatewayd` process and its plugins.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/CLI.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: CLI
description: GatewayD is a CLI application that runs on Windows, Linux-based distributions and macOS.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/clients.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Clients
description: Client object is a client that can connect to the database servers over TCP, UDP and Unix Domain Socket.
Expand Down
10 changes: 5 additions & 5 deletions using-gatewayd/configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Configuration
description: GatewayD is fully configurable via various sources, including default values, YAML config files, environment variables, CLI flags and plugins.
Expand Down Expand Up @@ -181,13 +181,13 @@ GatewayD allows plugins to update the global configuration at runtime. This is d
An example of this update can be found in the [Go plugin template](https://github.com/gatewayd-io/plugin-template-go/blob/981b36aa62b4ba059656c6dde08f67a9206c0948/plugin/plugin.go#L54-L129). The following snippet shows how to update the global configuration at runtime:

```go
func (p *Plugin) OnConfigLoaded(ctx context.Context, req *structpb.Struct) (*structpb.Struct, error) {
func (p *Plugin) OnConfigLoaded(ctx context.Context, req *v1.Struct) (*v1.Struct, error) {
if req.Fields == nil {
req.Fields = make(map[string]*structpb.Value)
req.Fields = make(map[string]*v1.Value)
}
req.Fields["loggers.default.level"] = structpb.NewStringValue("debug")
req.Fields["loggers.default.noColor"] = structpb.NewBoolValue(false)
req.Fields["loggers.default.level"] = v1.NewStringValue("debug")
req.Fields["loggers.default.noColor"] = v1.NewBoolValue(false)
return req, nil
}
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/connection-lifecycle.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Connection Lifecycle
description: Connection Lifecycle of GatewayD
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: API
description: GatewayD gRPC API configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/clients.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Clients
description: GatewayD client configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Global Configuration
nav_order: 2
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/loggers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Loggers
description: GatewayD logger configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/metrics.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Metrics
description: GatewayD metrics configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/pools.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Pools
description: GatewayD pool configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/proxies.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Proxies
description: GatewayD proxy configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/servers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Servers
description: GatewayD server configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Using GatewayD
nav_order: 2
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/observability.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Observability
description: Observability is a first-class citizen of GatewayD. It generates logs, metrics and traces to make it easier to see what is going on inside.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: General configurations
description: General configurations for plugins
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/plugins-configuration/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Plugins Configuration
nav_order: 3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Plugins configuration
description: GatewayD plugins configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/pools.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Pools
description: GatewayD has a generic internal pool object that is used to manage plugins and connections.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/protocols.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Protocols
description: GatewayD is application layer protocol-agnostic. This means that GatewayD *can* practically support any protocol in the application layer, or L7.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/proxies.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Proxies
description: Proxy object is used to create a binding between incoming connections from the database clients to the database servers.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/servers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Servers
description: Server is an object that listens on an address:port pair and accepts connections from database clients.
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/hook-registry.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Hook registry
description: The hook registry is a central place where all hooks are registered and executed. It is used by the plugin registry to register and execute plugin hooks.
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/hooks.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Hooks
description: Plugins can be used to modify the connection lifecycle. Each step in the connection lifecycle is represented by one or more plugin hook(s). Plugins can register themselves to be called when a specific hook is triggered.
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Using Plugins
nav_order: 3
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/plugin-registry.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Plugin registry
description: The plugin registry is a central place where all plugins are loaded, configured and executed, and also the main entry point for all plugins.
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/plugin-types.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Plugin types
description: >
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/plugins.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Plugins
description: Plugins play a very important role in GatewayD for adding support for different databases. They are the building blocks of GatewayD, and they are responsible for the majority of the functionality of GatewayD.
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/proposals.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2023-08-16 23:51:12 +0200
last_modified_date: 2023-09-01 14:29:52 +0200
layout: default
title: Proposals
description: GatewayD proposals are used to propose new ideas and features for GatewayD.
Expand Down

0 comments on commit db084e8

Please sign in to comment.