mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-11 07:12:59 +02:00
* config,docs: add databroker storage backend configuration * cache: allow configuring which backend storage to use Currently supported types are "memory", "redis".
25 lines
851 B
Go
25 lines
851 B
Go
package cache
|
|
|
|
import (
|
|
"google.golang.org/grpc"
|
|
|
|
"github.com/pomerium/pomerium/config"
|
|
internal_databroker "github.com/pomerium/pomerium/internal/databroker"
|
|
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
|
)
|
|
|
|
// A DataBrokerServer implements the data broker service interface.
|
|
type DataBrokerServer struct {
|
|
databroker.DataBrokerServiceServer
|
|
}
|
|
|
|
// NewDataBrokerServer creates a new databroker service server.
|
|
func NewDataBrokerServer(grpcServer *grpc.Server, opts config.Options) *DataBrokerServer {
|
|
internalSrv := internal_databroker.New(
|
|
internal_databroker.WithStorageType(opts.DataBrokerStorageType),
|
|
internal_databroker.WithStorageConnectionString(opts.DataBrokerStorageConnectionString),
|
|
)
|
|
srv := &DataBrokerServer{DataBrokerServiceServer: internalSrv}
|
|
databroker.RegisterDataBrokerServiceServer(grpcServer, srv)
|
|
return srv
|
|
}
|