mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-09 21:08:11 +02:00
databroker: add list types method
This commit is contained in:
parent
7a405abea1
commit
2eb24fd42a
13 changed files with 494 additions and 232 deletions
|
@ -128,6 +128,22 @@ func (srv *Server) Get(ctx context.Context, req *databroker.GetRequest) (*databr
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (srv *Server) ListTypes(ctx context.Context) (*databroker.ListTypesResponse, error) {
|
||||
ctx, span := trace.StartSpan(ctx, "databroker.grpc.ListTypes")
|
||||
defer span.End()
|
||||
log.Info(ctx).Msg("list types")
|
||||
|
||||
db, err := srv.getBackend()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
types, err := db.ListTypes(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &databroker.ListTypesResponse{Types: types}, nil
|
||||
}
|
||||
|
||||
// Query queries for records.
|
||||
func (srv *Server) Query(ctx context.Context, req *databroker.QueryRequest) (*databroker.QueryResponse, error) {
|
||||
ctx, span := trace.StartSpan(ctx, "databroker.grpc.Query")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue