mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-09 15:17:39 +02:00
databroker server backend config (#1127)
* config,docs: add databroker storage backend configuration * cache: allow configuring which backend storage to use Currently supported types are "memory", "redis".
This commit is contained in:
parent
c9182f757e
commit
1640151bc1
9 changed files with 99 additions and 6 deletions
9
cache/databroker.go
vendored
9
cache/databroker.go
vendored
|
@ -3,6 +3,7 @@ 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"
|
||||
)
|
||||
|
@ -13,8 +14,12 @@ type DataBrokerServer struct {
|
|||
}
|
||||
|
||||
// NewDataBrokerServer creates a new databroker service server.
|
||||
func NewDataBrokerServer(grpcServer *grpc.Server) *DataBrokerServer {
|
||||
srv := &DataBrokerServer{DataBrokerServiceServer: internal_databroker.New()}
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue