File: mixed.proto

package info (click to toggle)
golang-google-protobuf 1.36.7-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid
  • size: 14,996 kB
  • sloc: sh: 94; makefile: 4
file content (81 lines) | stat: -rw-r--r-- 1,879 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// This testproto explicitly configures the API level of each message.
//
// This allows creating mixed trees of proto messages on different API levels.

edition = "2023";

package goproto.proto.test;

import "google/protobuf/go_features.proto";

option go_package = "google.golang.org/protobuf/internal/testprotos/mixed";

message Open {
  option features.(pb.go).api_level = API_OPEN;

  // These fields allow for arbitrary mixing.
  Open open = 1;
  Hybrid hybrid = 2;
  Opaque opaque = 3;

  int32 optional_int32 = 4;
}

message Hybrid {
  option features.(pb.go).api_level = API_HYBRID;

  // These fields allow for arbitrary mixing.
  Open open = 1;
  Hybrid hybrid = 2;
  Opaque opaque = 3;

  int32 optional_int32 = 4;
}

message Opaque {
  option features.(pb.go).api_level = API_OPAQUE;

  // These fields allow for arbitrary mixing.
  Open open = 1;
  Hybrid hybrid = 2;
  Opaque opaque = 3;

  int32 optional_int32 = 4;
}

message OpenLazy {
  option features.(pb.go).api_level = API_OPEN;

  // These fields allow for arbitrary mixing.
  OpenLazy open = 1 [lazy = true];
  HybridLazy hybrid = 2 [lazy = true];
  OpaqueLazy opaque = 3 [lazy = true];

  int32 optional_int32 = 4;
}

message HybridLazy {
  option features.(pb.go).api_level = API_HYBRID;

  // These fields allow for arbitrary mixing.
  OpenLazy open = 1 [lazy = true];
  HybridLazy hybrid = 2 [lazy = true];
  OpaqueLazy opaque = 3 [lazy = true];

  int32 optional_int32 = 4;
}

message OpaqueLazy {
  option features.(pb.go).api_level = API_OPAQUE;

  // These fields allow for arbitrary mixing.
  OpenLazy open = 1 [lazy = true];
  HybridLazy hybrid = 2 [lazy = true];
  OpaqueLazy opaque = 3 [lazy = true];

  int32 optional_int32 = 4;
}