• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ory / keto / 10166504429

30 Jul 2024 04:53PM UTC coverage: 77.612%. First build
10166504429

Pull #1559

github

zepatrik
chore: bump ory/x
Pull Request #1559: chore: bump dependencies

5734 of 7388 relevant lines covered (77.61%)

489.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/contrib/docs-code-samples/expand-api-display-access/01-expand-beach/main.go
1
// Copyright © 2023 Ory Corp
2
// SPDX-License-Identifier: Apache-2.0
3

4
package main
5

6
import (
7
        "context"
8
        "encoding/json"
9
        "os"
10

11
        "google.golang.org/grpc"
12
        "google.golang.org/grpc/credentials/insecure"
13

14
        "github.com/ory/keto/ketoapi"
15
        rts "github.com/ory/keto/proto/ory/keto/relation_tuples/v1alpha2"
16
)
17

18
func main() {
×
19
        conn, err := grpc.Dial("127.0.0.1:4466", grpc.WithTransportCredentials(insecure.NewCredentials()))
×
20
        if err != nil {
×
21
                panic(err)
×
22
        }
23

24
        client := rts.NewExpandServiceClient(conn)
×
25

×
26
        res, err := client.Expand(context.Background(), &rts.ExpandRequest{
×
27
                Subject:  rts.NewSubjectSet("files", "/photos/beach.jpg", "access"),
×
28
                MaxDepth: 3,
×
29
        })
×
30
        if err != nil {
×
31
                panic(err)
×
32
        }
33

34
        tree := ketoapi.TreeFromProto[*ketoapi.RelationTuple](res.Tree)
×
35

×
36
        enc := json.NewEncoder(os.Stdout)
×
37
        enc.SetIndent("", "  ")
×
38
        if err := enc.Encode(tree); err != nil {
×
39
                panic(err.Error())
×
40
        }
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc