MCPcopy Create free account
hub / github.com/Permify/permify / Read

Method Read

internal/servers/bundle_server.go:76–96  ·  view source on GitHub ↗

Read handles the reading of bundles.

(ctx context.Context, request *v1.BundleReadRequest)

Source from the content-addressed store, hash-verified

74
75// Read handles the reading of bundles.
76func (r *BundleServer) Read(ctx context.Context, request *v1.BundleReadRequest) (*v1.BundleReadResponse, error) {
77 ctx, span := internal.Tracer.Start(ctx, "bundle.read")
78 defer span.End()
79
80 v := request.Validate()
81 if v != nil {
82 return nil, status.Error(GetStatus(v), v.Error()) // Return validation error
83 }
84
85 bundle, err := r.br.Read(ctx, request.GetTenantId(), request.GetName())
86 if err != nil {
87 span.RecordError(err)
88 span.SetStatus(otelCodes.Error, err.Error())
89 slog.ErrorContext(ctx, err.Error())
90 return nil, status.Error(GetStatus(err), err.Error())
91 }
92
93 return &v1.BundleReadResponse{
94 Bundle: bundle,
95 }, nil
96}
97
98// Delete handles the deletion of bundles.
99func (r *BundleServer) Delete(ctx context.Context, request *v1.BundleDeleteRequest) (*v1.BundleDeleteResponse, error) {

Callers

nothing calls this directly

Implementers 1

UnimplementedBundleServerpkg/pb/base/v1/service_grpc.pb.go

Calls 7

GetStatusFunction · 0.85
StartMethod · 0.80
ReadMethod · 0.65
GetNameMethod · 0.65
ValidateMethod · 0.45
ErrorMethod · 0.45
GetTenantIdMethod · 0.45

Tested by

no test coverage detected