...

Source file src/google.golang.org/genproto/googleapis/api/expr/v1beta1/source.pb.go

Documentation: google.golang.org/genproto/googleapis/api/expr/v1beta1

     1  // Copyright 2024 Google LLC
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  //
    15  
    16  // Code generated by protoc-gen-go. DO NOT EDIT.
    17  // versions:
    18  // 	protoc-gen-go v1.26.0
    19  // 	protoc        v4.24.4
    20  // source: google/api/expr/v1beta1/source.proto
    21  
    22  package expr
    23  
    24  import (
    25  	reflect "reflect"
    26  	sync "sync"
    27  
    28  	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
    29  	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
    30  )
    31  
    32  const (
    33  	// Verify that this generated code is sufficiently up-to-date.
    34  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
    35  	// Verify that runtime/protoimpl is sufficiently up-to-date.
    36  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
    37  )
    38  
    39  // Source information collected at parse time.
    40  type SourceInfo struct {
    41  	state         protoimpl.MessageState
    42  	sizeCache     protoimpl.SizeCache
    43  	unknownFields protoimpl.UnknownFields
    44  
    45  	// The location name. All position information attached to an expression is
    46  	// relative to this location.
    47  	//
    48  	// The location could be a file, UI element, or similar. For example,
    49  	// `acme/app/AnvilPolicy.cel`.
    50  	Location string `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"`
    51  	// Monotonically increasing list of character offsets where newlines appear.
    52  	//
    53  	// The line number of a given position is the index `i` where for a given
    54  	// `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The
    55  	// column may be derivd from `id_positions[id] - line_offsets[i]`.
    56  	LineOffsets []int32 `protobuf:"varint,3,rep,packed,name=line_offsets,json=lineOffsets,proto3" json:"line_offsets,omitempty"`
    57  	// A map from the parse node id (e.g. `Expr.id`) to the character offset
    58  	// within source.
    59  	Positions map[int32]int32 `protobuf:"bytes,4,rep,name=positions,proto3" json:"positions,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
    60  }
    61  
    62  func (x *SourceInfo) Reset() {
    63  	*x = SourceInfo{}
    64  	if protoimpl.UnsafeEnabled {
    65  		mi := &file_google_api_expr_v1beta1_source_proto_msgTypes[0]
    66  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    67  		ms.StoreMessageInfo(mi)
    68  	}
    69  }
    70  
    71  func (x *SourceInfo) String() string {
    72  	return protoimpl.X.MessageStringOf(x)
    73  }
    74  
    75  func (*SourceInfo) ProtoMessage() {}
    76  
    77  func (x *SourceInfo) ProtoReflect() protoreflect.Message {
    78  	mi := &file_google_api_expr_v1beta1_source_proto_msgTypes[0]
    79  	if protoimpl.UnsafeEnabled && x != nil {
    80  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    81  		if ms.LoadMessageInfo() == nil {
    82  			ms.StoreMessageInfo(mi)
    83  		}
    84  		return ms
    85  	}
    86  	return mi.MessageOf(x)
    87  }
    88  
    89  // Deprecated: Use SourceInfo.ProtoReflect.Descriptor instead.
    90  func (*SourceInfo) Descriptor() ([]byte, []int) {
    91  	return file_google_api_expr_v1beta1_source_proto_rawDescGZIP(), []int{0}
    92  }
    93  
    94  func (x *SourceInfo) GetLocation() string {
    95  	if x != nil {
    96  		return x.Location
    97  	}
    98  	return ""
    99  }
   100  
   101  func (x *SourceInfo) GetLineOffsets() []int32 {
   102  	if x != nil {
   103  		return x.LineOffsets
   104  	}
   105  	return nil
   106  }
   107  
   108  func (x *SourceInfo) GetPositions() map[int32]int32 {
   109  	if x != nil {
   110  		return x.Positions
   111  	}
   112  	return nil
   113  }
   114  
   115  // A specific position in source.
   116  type SourcePosition struct {
   117  	state         protoimpl.MessageState
   118  	sizeCache     protoimpl.SizeCache
   119  	unknownFields protoimpl.UnknownFields
   120  
   121  	// The soucre location name (e.g. file name).
   122  	Location string `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"`
   123  	// The character offset.
   124  	Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
   125  	// The 1-based index of the starting line in the source text
   126  	// where the issue occurs, or 0 if unknown.
   127  	Line int32 `protobuf:"varint,3,opt,name=line,proto3" json:"line,omitempty"`
   128  	// The 0-based index of the starting position within the line of source text
   129  	// where the issue occurs.  Only meaningful if line is nonzer..
   130  	Column int32 `protobuf:"varint,4,opt,name=column,proto3" json:"column,omitempty"`
   131  }
   132  
   133  func (x *SourcePosition) Reset() {
   134  	*x = SourcePosition{}
   135  	if protoimpl.UnsafeEnabled {
   136  		mi := &file_google_api_expr_v1beta1_source_proto_msgTypes[1]
   137  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   138  		ms.StoreMessageInfo(mi)
   139  	}
   140  }
   141  
   142  func (x *SourcePosition) String() string {
   143  	return protoimpl.X.MessageStringOf(x)
   144  }
   145  
   146  func (*SourcePosition) ProtoMessage() {}
   147  
   148  func (x *SourcePosition) ProtoReflect() protoreflect.Message {
   149  	mi := &file_google_api_expr_v1beta1_source_proto_msgTypes[1]
   150  	if protoimpl.UnsafeEnabled && x != nil {
   151  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   152  		if ms.LoadMessageInfo() == nil {
   153  			ms.StoreMessageInfo(mi)
   154  		}
   155  		return ms
   156  	}
   157  	return mi.MessageOf(x)
   158  }
   159  
   160  // Deprecated: Use SourcePosition.ProtoReflect.Descriptor instead.
   161  func (*SourcePosition) Descriptor() ([]byte, []int) {
   162  	return file_google_api_expr_v1beta1_source_proto_rawDescGZIP(), []int{1}
   163  }
   164  
   165  func (x *SourcePosition) GetLocation() string {
   166  	if x != nil {
   167  		return x.Location
   168  	}
   169  	return ""
   170  }
   171  
   172  func (x *SourcePosition) GetOffset() int32 {
   173  	if x != nil {
   174  		return x.Offset
   175  	}
   176  	return 0
   177  }
   178  
   179  func (x *SourcePosition) GetLine() int32 {
   180  	if x != nil {
   181  		return x.Line
   182  	}
   183  	return 0
   184  }
   185  
   186  func (x *SourcePosition) GetColumn() int32 {
   187  	if x != nil {
   188  		return x.Column
   189  	}
   190  	return 0
   191  }
   192  
   193  var File_google_api_expr_v1beta1_source_proto protoreflect.FileDescriptor
   194  
   195  var file_google_api_expr_v1beta1_source_proto_rawDesc = []byte{
   196  	0x0a, 0x24, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x70,
   197  	0x72, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
   198  	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
   199  	0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x22,
   200  	0xdb, 0x01, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a,
   201  	0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
   202  	0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x69,
   203  	0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05,
   204  	0x52, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x12, 0x50, 0x0a,
   205  	0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,
   206  	0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78,
   207  	0x70, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63,
   208  	0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45,
   209  	0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a,
   210  	0x3c, 0x0a, 0x0e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72,
   211  	0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
   212  	0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
   213  	0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x70, 0x0a,
   214  	0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12,
   215  	0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
   216  	0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6f,
   217  	0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66,
   218  	0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
   219  	0x05, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d,
   220  	0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x42,
   221  	0x6c, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70,
   222  	0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0b,
   223  	0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x67,
   224  	0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67,
   225  	0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
   226  	0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x76, 0x31,
   227  	0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x65, 0x78, 0x70, 0x72, 0xf8, 0x01, 0x01, 0x62, 0x06, 0x70,
   228  	0x72, 0x6f, 0x74, 0x6f, 0x33,
   229  }
   230  
   231  var (
   232  	file_google_api_expr_v1beta1_source_proto_rawDescOnce sync.Once
   233  	file_google_api_expr_v1beta1_source_proto_rawDescData = file_google_api_expr_v1beta1_source_proto_rawDesc
   234  )
   235  
   236  func file_google_api_expr_v1beta1_source_proto_rawDescGZIP() []byte {
   237  	file_google_api_expr_v1beta1_source_proto_rawDescOnce.Do(func() {
   238  		file_google_api_expr_v1beta1_source_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_expr_v1beta1_source_proto_rawDescData)
   239  	})
   240  	return file_google_api_expr_v1beta1_source_proto_rawDescData
   241  }
   242  
   243  var file_google_api_expr_v1beta1_source_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
   244  var file_google_api_expr_v1beta1_source_proto_goTypes = []interface{}{
   245  	(*SourceInfo)(nil),     // 0: google.api.expr.v1beta1.SourceInfo
   246  	(*SourcePosition)(nil), // 1: google.api.expr.v1beta1.SourcePosition
   247  	nil,                    // 2: google.api.expr.v1beta1.SourceInfo.PositionsEntry
   248  }
   249  var file_google_api_expr_v1beta1_source_proto_depIdxs = []int32{
   250  	2, // 0: google.api.expr.v1beta1.SourceInfo.positions:type_name -> google.api.expr.v1beta1.SourceInfo.PositionsEntry
   251  	1, // [1:1] is the sub-list for method output_type
   252  	1, // [1:1] is the sub-list for method input_type
   253  	1, // [1:1] is the sub-list for extension type_name
   254  	1, // [1:1] is the sub-list for extension extendee
   255  	0, // [0:1] is the sub-list for field type_name
   256  }
   257  
   258  func init() { file_google_api_expr_v1beta1_source_proto_init() }
   259  func file_google_api_expr_v1beta1_source_proto_init() {
   260  	if File_google_api_expr_v1beta1_source_proto != nil {
   261  		return
   262  	}
   263  	if !protoimpl.UnsafeEnabled {
   264  		file_google_api_expr_v1beta1_source_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
   265  			switch v := v.(*SourceInfo); i {
   266  			case 0:
   267  				return &v.state
   268  			case 1:
   269  				return &v.sizeCache
   270  			case 2:
   271  				return &v.unknownFields
   272  			default:
   273  				return nil
   274  			}
   275  		}
   276  		file_google_api_expr_v1beta1_source_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
   277  			switch v := v.(*SourcePosition); i {
   278  			case 0:
   279  				return &v.state
   280  			case 1:
   281  				return &v.sizeCache
   282  			case 2:
   283  				return &v.unknownFields
   284  			default:
   285  				return nil
   286  			}
   287  		}
   288  	}
   289  	type x struct{}
   290  	out := protoimpl.TypeBuilder{
   291  		File: protoimpl.DescBuilder{
   292  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   293  			RawDescriptor: file_google_api_expr_v1beta1_source_proto_rawDesc,
   294  			NumEnums:      0,
   295  			NumMessages:   3,
   296  			NumExtensions: 0,
   297  			NumServices:   0,
   298  		},
   299  		GoTypes:           file_google_api_expr_v1beta1_source_proto_goTypes,
   300  		DependencyIndexes: file_google_api_expr_v1beta1_source_proto_depIdxs,
   301  		MessageInfos:      file_google_api_expr_v1beta1_source_proto_msgTypes,
   302  	}.Build()
   303  	File_google_api_expr_v1beta1_source_proto = out.File
   304  	file_google_api_expr_v1beta1_source_proto_rawDesc = nil
   305  	file_google_api_expr_v1beta1_source_proto_goTypes = nil
   306  	file_google_api_expr_v1beta1_source_proto_depIdxs = nil
   307  }
   308  

View as plain text