deps: update images to 0.94
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
This commit is contained in:
parent
4f90a757dc
commit
bccd1639af
1096 changed files with 411794 additions and 11488 deletions
10
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md
generated
vendored
10
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md
generated
vendored
|
|
@ -1,5 +1,15 @@
|
|||
# Release History
|
||||
|
||||
## 1.14.0 (2024-08-07)
|
||||
|
||||
### Features Added
|
||||
|
||||
* Added field `Attributes` to `runtime.StartSpanOptions` to simplify creating spans with attributes.
|
||||
|
||||
### Other Changes
|
||||
|
||||
* Include the HTTP verb and URL in `log.EventRetryPolicy` log entries so it's clear which operation is being retried.
|
||||
|
||||
## 1.13.0 (2024-07-16)
|
||||
|
||||
### Features Added
|
||||
|
|
|
|||
2
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go
generated
vendored
2
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go
generated
vendored
|
|
@ -40,5 +40,5 @@ const (
|
|||
Module = "azcore"
|
||||
|
||||
// Version is the semantic version (see http://semver.org) of this module.
|
||||
Version = "v1.13.0"
|
||||
Version = "v1.14.0"
|
||||
)
|
||||
|
|
|
|||
11
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_trace.go
generated
vendored
11
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_trace.go
generated
vendored
|
|
@ -96,7 +96,8 @@ func (h *httpTracePolicy) Do(req *policy.Request) (resp *http.Response, err erro
|
|||
|
||||
// StartSpanOptions contains the optional values for StartSpan.
|
||||
type StartSpanOptions struct {
|
||||
// for future expansion
|
||||
// Attributes contains key-value pairs of attributes for the span.
|
||||
Attributes []tracing.Attribute
|
||||
}
|
||||
|
||||
// StartSpan starts a new tracing span.
|
||||
|
|
@ -126,8 +127,14 @@ func StartSpan(ctx context.Context, name string, tracer tracing.Tracer, options
|
|||
return ctx, func(err error) {}
|
||||
}
|
||||
}
|
||||
|
||||
if options == nil {
|
||||
options = &StartSpanOptions{}
|
||||
}
|
||||
|
||||
ctx, span := tracer.Start(ctx, name, &tracing.SpanOptions{
|
||||
Kind: newSpanKind,
|
||||
Kind: newSpanKind,
|
||||
Attributes: options.Attributes,
|
||||
})
|
||||
ctx = context.WithValue(ctx, ctxActiveSpan{}, newSpanKind)
|
||||
return ctx, func(err error) {
|
||||
|
|
|
|||
3
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_retry.go
generated
vendored
3
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_retry.go
generated
vendored
|
|
@ -102,7 +102,8 @@ func (p *retryPolicy) Do(req *policy.Request) (resp *http.Response, err error) {
|
|||
try := int32(1)
|
||||
for {
|
||||
resp = nil // reset
|
||||
log.Writef(log.EventRetryPolicy, "=====> Try=%d", try)
|
||||
// unfortunately we don't have access to the custom allow-list of query params, so we'll redact everything but the default allowed QPs
|
||||
log.Writef(log.EventRetryPolicy, "=====> Try=%d for %s %s", try, req.Raw().Method, getSanitizedURL(*req.Raw().URL, getAllowedQueryParams(nil)))
|
||||
|
||||
// For each try, seek to the beginning of the Body stream. We do this even for the 1st try because
|
||||
// the stream may not be at offset 0 when we first get it and we want the same behavior for the
|
||||
|
|
|
|||
14
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md
generated
vendored
14
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md
generated
vendored
|
|
@ -1,5 +1,19 @@
|
|||
# Release History
|
||||
|
||||
## 1.4.1 (2024-09-18)
|
||||
|
||||
### Features Added
|
||||
* Added crc64 response header to Put Blob.
|
||||
* Upgraded service version to `2024-08-04`.
|
||||
|
||||
## 1.4.1-beta.1 (2024-08-27)
|
||||
|
||||
### Features Added
|
||||
* Upgraded service version to `2024-08-04`.
|
||||
|
||||
### Other Changes
|
||||
* Updated `azcore` version to `1.14.0`
|
||||
|
||||
## 1.4.0 (2024-07-18)
|
||||
|
||||
### Other Changes
|
||||
|
|
|
|||
|
|
@ -109,6 +109,85 @@ func getHeader(key string, headers map[string][]string) string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func getWeightTables() [][]int {
|
||||
tableLv0 := [...]int{
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x71c, 0x0, 0x71f, 0x721, 0x723, 0x725,
|
||||
0x0, 0x0, 0x0, 0x72d, 0x803, 0x0, 0x0, 0x733, 0x0, 0xd03, 0xd1a, 0xd1c, 0xd1e,
|
||||
0xd20, 0xd22, 0xd24, 0xd26, 0xd28, 0xd2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0xe02, 0xe09, 0xe0a, 0xe1a, 0xe21, 0xe23, 0xe25, 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51,
|
||||
0xe70, 0xe7c, 0xe7e, 0xe89, 0xe8a, 0xe91, 0xe99, 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9,
|
||||
0x0, 0x0, 0x0, 0x743, 0x744, 0x748, 0xe02, 0xe09, 0xe0a, 0xe1a, 0xe21, 0xe23, 0xe25,
|
||||
0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, 0xe70, 0xe7c, 0xe7e, 0xe89, 0xe8a, 0xe91, 0xe99,
|
||||
0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, 0x0, 0x74c, 0x0, 0x750, 0x0,
|
||||
}
|
||||
tableLv2 := [...]int{
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8012, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8212, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
}
|
||||
tables := [][]int{tableLv0[:], tableLv2[:]}
|
||||
return tables
|
||||
}
|
||||
|
||||
// NewHeaderStringComparer performs a multi-level, weight-based comparison of two strings
|
||||
func compareHeaders(lhs, rhs string, tables [][]int) int {
|
||||
currLevel, i, j := 0, 0, 0
|
||||
n := len(tables)
|
||||
lhsLen := len(lhs)
|
||||
rhsLen := len(rhs)
|
||||
|
||||
for currLevel < n {
|
||||
if currLevel == (n-1) && i != j {
|
||||
if i > j {
|
||||
return -1
|
||||
}
|
||||
if i < j {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
w1 := tables[currLevel][lhs[i]]
|
||||
if i >= lhsLen {
|
||||
w1 = 0x1
|
||||
}
|
||||
|
||||
w2 := tables[currLevel][rhs[j]]
|
||||
if j >= rhsLen {
|
||||
w2 = 0x1
|
||||
}
|
||||
|
||||
if w1 == 0x1 && w2 == 0x1 {
|
||||
i = 0
|
||||
j = 0
|
||||
currLevel++
|
||||
} else if w1 == w2 {
|
||||
i++
|
||||
j++
|
||||
} else if w1 == 0 {
|
||||
i++
|
||||
} else if w2 == 0 {
|
||||
j++
|
||||
} else {
|
||||
if w1 < w2 {
|
||||
return -1
|
||||
}
|
||||
if w1 > w2 {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (c *SharedKeyCredential) buildCanonicalizedHeader(headers http.Header) string {
|
||||
cm := map[string][]string{}
|
||||
for k, v := range headers {
|
||||
|
|
@ -125,7 +204,11 @@ func (c *SharedKeyCredential) buildCanonicalizedHeader(headers http.Header) stri
|
|||
for key := range cm {
|
||||
keys = append(keys, key)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
tables := getWeightTables()
|
||||
// Sort the keys using the custom comparator
|
||||
sort.Slice(keys, func(i, j int) bool {
|
||||
return compareHeaders(keys[i], keys[j], tables) < 0
|
||||
})
|
||||
ch := bytes.NewBufferString("")
|
||||
for i, key := range keys {
|
||||
if i > 0 {
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@ package exported
|
|||
|
||||
const (
|
||||
ModuleName = "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
|
||||
ModuleVersion = "v1.4.0"
|
||||
ModuleVersion = "v1.4.1"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ go: true
|
|||
clear-output-folder: false
|
||||
version: "^3.0.0"
|
||||
license-header: MICROSOFT_MIT_NO_VERSION
|
||||
input-file: "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a32d0b2423d19835246bb2ef92941503bfd5e734/specification/storage/data-plane/Microsoft.BlobStorage/preview/2021-12-02/blob.json"
|
||||
input-file: "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f6f50c6388fd5836fa142384641b8353a99874ef/specification/storage/data-plane/Microsoft.BlobStorage/stable/2024-08-04/blob.json"
|
||||
credential-scope: "https://storage.azure.com/.default"
|
||||
output-folder: ../generated
|
||||
file-prefix: "zz_"
|
||||
|
|
@ -22,7 +22,7 @@ export-clients: true
|
|||
use: "@autorest/go@4.0.0-preview.65"
|
||||
```
|
||||
|
||||
### Updating service version to 2024-05-04
|
||||
### Updating service version to 2024-08-04
|
||||
```yaml
|
||||
directive:
|
||||
- from:
|
||||
|
|
@ -35,8 +35,21 @@ directive:
|
|||
where: $
|
||||
transform: >-
|
||||
return $.
|
||||
replaceAll(`[]string{"2021-12-02"}`, `[]string{ServiceVersion}`).
|
||||
replaceAll(`2021-12-02`, `2024-05-04`);
|
||||
replaceAll(`[]string{"2021-12-02"}`, `[]string{ServiceVersion}`);
|
||||
```
|
||||
|
||||
### Fix CRC Response Header in PutBlob response
|
||||
``` yaml
|
||||
directive:
|
||||
- from: swagger-document
|
||||
where: $["x-ms-paths"]["/{containerName}/{blob}?BlockBlob"].put.responses["201"].headers
|
||||
transform: >
|
||||
$["x-ms-content-crc64"] = {
|
||||
"x-ms-client-name": "ContentCRC64",
|
||||
"type": "string",
|
||||
"format": "byte",
|
||||
"description": "Returned for a block blob so that the client can check the integrity of message content."
|
||||
};
|
||||
```
|
||||
|
||||
### Undo breaking change with BlobName
|
||||
|
|
|
|||
|
|
@ -6,4 +6,4 @@
|
|||
|
||||
package generated
|
||||
|
||||
const ServiceVersion = "2024-05-04"
|
||||
const ServiceVersion = "2024-08-04"
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ type AppendBlobClient struct {
|
|||
// AppendBlob. Append Block is supported only on version 2015-02-21 version or later.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - contentLength - The length of the request.
|
||||
// - body - Initial data
|
||||
// - options - AppendBlobClientAppendBlockOptions contains the optional parameters for the AppendBlobClient.AppendBlock method.
|
||||
|
|
@ -116,7 +116,7 @@ func (client *AppendBlobClient) appendBlockCreateRequest(ctx context.Context, co
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
if err := req.SetBody(body, "application/octet-stream"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -198,7 +198,7 @@ func (client *AppendBlobClient) appendBlockHandleResponse(resp *http.Response) (
|
|||
// created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - sourceURL - Specify a URL to the copy source.
|
||||
// - contentLength - The length of the request.
|
||||
// - options - AppendBlobClientAppendBlockFromURLOptions contains the optional parameters for the AppendBlobClient.AppendBlockFromURL
|
||||
|
|
@ -310,7 +310,7 @@ func (client *AppendBlobClient) appendBlockFromURLCreateRequest(ctx context.Cont
|
|||
if options != nil && options.SourceRange != nil {
|
||||
req.Raw().Header["x-ms-source-range"] = []string{*options.SourceRange}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -384,7 +384,7 @@ func (client *AppendBlobClient) appendBlockFromURLHandleResponse(resp *http.Resp
|
|||
// Create - The Create Append Blob operation creates a new append blob.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - contentLength - The length of the request.
|
||||
// - options - AppendBlobClientCreateOptions contains the optional parameters for the AppendBlobClient.Create method.
|
||||
// - BlobHTTPHeaders - BlobHTTPHeaders contains a group of parameters for the BlobClient.SetHTTPHeaders method.
|
||||
|
|
@ -494,7 +494,7 @@ func (client *AppendBlobClient) createCreateRequest(ctx context.Context, content
|
|||
if options != nil && options.BlobTagsString != nil {
|
||||
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -557,7 +557,7 @@ func (client *AppendBlobClient) createHandleResponse(resp *http.Response) (Appen
|
|||
// or later.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - AppendBlobClientSealOptions contains the optional parameters for the AppendBlobClient.Seal method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
|
|
@ -615,7 +615,7 @@ func (client *AppendBlobClient) sealCreateRequest(ctx context.Context, options *
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ type BlobClient struct {
|
|||
// blob with zero length and full metadata.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - copyID - The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation.
|
||||
// - options - BlobClientAbortCopyFromURLOptions contains the optional parameters for the BlobClient.AbortCopyFromURL method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
|
|
@ -72,7 +72,7 @@ func (client *BlobClient) abortCopyFromURLCreateRequest(ctx context.Context, cop
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ func (client *BlobClient) abortCopyFromURLHandleResponse(resp *http.Response) (B
|
|||
// AcquireLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - duration - Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite
|
||||
// lease can be between 15 and 60 seconds. A lease duration cannot be changed using
|
||||
// renew or change.
|
||||
|
|
@ -161,7 +161,7 @@ func (client *BlobClient) acquireLeaseCreateRequest(ctx context.Context, duratio
|
|||
if options != nil && options.ProposedLeaseID != nil {
|
||||
req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ func (client *BlobClient) acquireLeaseHandleResponse(resp *http.Response) (BlobC
|
|||
// BreakLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientBreakLeaseOptions contains the optional parameters for the BlobClient.BreakLease method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
func (client *BlobClient) BreakLease(ctx context.Context, options *BlobClientBreakLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (BlobClientBreakLeaseResponse, error) {
|
||||
|
|
@ -259,7 +259,7 @@ func (client *BlobClient) breakLeaseCreateRequest(ctx context.Context, options *
|
|||
if options != nil && options.BreakPeriod != nil {
|
||||
req.Raw().Header["x-ms-lease-break-period"] = []string{strconv.FormatInt(int64(*options.BreakPeriod), 10)}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -306,7 +306,7 @@ func (client *BlobClient) breakLeaseHandleResponse(resp *http.Response) (BlobCli
|
|||
// ChangeLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - leaseID - Specifies the current lease ID on the resource.
|
||||
// - proposedLeaseID - Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed
|
||||
// lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID
|
||||
|
|
@ -365,7 +365,7 @@ func (client *BlobClient) changeLeaseCreateRequest(ctx context.Context, leaseID
|
|||
req.Raw().Header["x-ms-lease-action"] = []string{"change"}
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
|
||||
req.Raw().Header["x-ms-proposed-lease-id"] = []string{proposedLeaseID}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -408,7 +408,7 @@ func (client *BlobClient) changeLeaseHandleResponse(resp *http.Response) (BlobCl
|
|||
// until the copy is complete.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies
|
||||
// a page blob snapshot. The value should be URL-encoded as it would appear in a request
|
||||
// URI. The source blob must either be public or must be authenticated via a shared access signature.
|
||||
|
|
@ -517,7 +517,7 @@ func (client *BlobClient) copyFromURLCreateRequest(ctx context.Context, copySour
|
|||
if options != nil && options.BlobTagsString != nil {
|
||||
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -582,7 +582,7 @@ func (client *BlobClient) copyFromURLHandleResponse(resp *http.Response) (BlobCl
|
|||
// CreateSnapshot - The Create Snapshot operation creates a read-only snapshot of a blob
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientCreateSnapshotOptions contains the optional parameters for the BlobClient.CreateSnapshot method.
|
||||
// - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method.
|
||||
// - CPKScopeInfo - CPKScopeInfo contains a group of parameters for the BlobClient.SetMetadata method.
|
||||
|
|
@ -659,7 +659,7 @@ func (client *BlobClient) createSnapshotCreateRequest(ctx context.Context, optio
|
|||
}
|
||||
}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -721,7 +721,7 @@ func (client *BlobClient) createSnapshotHandleResponse(resp *http.Response) (Blo
|
|||
// return an HTTP status code of 404 (ResourceNotFound).
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientDeleteOptions contains the optional parameters for the BlobClient.Delete method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
|
|
@ -788,7 +788,7 @@ func (client *BlobClient) deleteCreateRequest(ctx context.Context, options *Blob
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -817,7 +817,7 @@ func (client *BlobClient) deleteHandleResponse(resp *http.Response) (BlobClientD
|
|||
// DeleteImmutabilityPolicy - The Delete Immutability Policy operation deletes the immutability policy on the blob
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientDeleteImmutabilityPolicyOptions contains the optional parameters for the BlobClient.DeleteImmutabilityPolicy
|
||||
// method.
|
||||
func (client *BlobClient) DeleteImmutabilityPolicy(ctx context.Context, options *BlobClientDeleteImmutabilityPolicyOptions) (BlobClientDeleteImmutabilityPolicyResponse, error) {
|
||||
|
|
@ -854,7 +854,7 @@ func (client *BlobClient) deleteImmutabilityPolicyCreateRequest(ctx context.Cont
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -884,7 +884,7 @@ func (client *BlobClient) deleteImmutabilityPolicyHandleResponse(resp *http.Resp
|
|||
// can also call Download to read a snapshot.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientDownloadOptions contains the optional parameters for the BlobClient.Download method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
// - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method.
|
||||
|
|
@ -965,7 +965,7 @@ func (client *BlobClient) downloadCreateRequest(ctx context.Context, options *Bl
|
|||
if options != nil && options.RangeGetContentMD5 != nil {
|
||||
req.Raw().Header["x-ms-range-get-content-md5"] = []string{strconv.FormatBool(*options.RangeGetContentMD5)}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -1192,7 +1192,7 @@ func (client *BlobClient) downloadHandleResponse(resp *http.Response) (BlobClien
|
|||
// GetAccountInfo - Returns the sku name and account kind
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientGetAccountInfoOptions contains the optional parameters for the BlobClient.GetAccountInfo method.
|
||||
func (client *BlobClient) GetAccountInfo(ctx context.Context, options *BlobClientGetAccountInfoOptions) (BlobClientGetAccountInfoResponse, error) {
|
||||
var err error
|
||||
|
|
@ -1221,9 +1221,15 @@ func (client *BlobClient) getAccountInfoCreateRequest(ctx context.Context, optio
|
|||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("comp", "properties")
|
||||
reqQP.Set("restype", "account")
|
||||
if options != nil && options.Timeout != nil {
|
||||
reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10))
|
||||
}
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/xml"}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -1243,6 +1249,13 @@ func (client *BlobClient) getAccountInfoHandleResponse(resp *http.Response) (Blo
|
|||
}
|
||||
result.Date = &date
|
||||
}
|
||||
if val := resp.Header.Get("x-ms-is-hns-enabled"); val != "" {
|
||||
isHierarchicalNamespaceEnabled, err := strconv.ParseBool(val)
|
||||
if err != nil {
|
||||
return BlobClientGetAccountInfoResponse{}, err
|
||||
}
|
||||
result.IsHierarchicalNamespaceEnabled = &isHierarchicalNamespaceEnabled
|
||||
}
|
||||
if val := resp.Header.Get("x-ms-request-id"); val != "" {
|
||||
result.RequestID = &val
|
||||
}
|
||||
|
|
@ -1259,7 +1272,7 @@ func (client *BlobClient) getAccountInfoHandleResponse(resp *http.Response) (Blo
|
|||
// for the blob. It does not return the content of the blob.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientGetPropertiesOptions contains the optional parameters for the BlobClient.GetProperties method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
// - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method.
|
||||
|
|
@ -1330,7 +1343,7 @@ func (client *BlobClient) getPropertiesCreateRequest(ctx context.Context, option
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -1577,7 +1590,7 @@ func (client *BlobClient) getPropertiesHandleResponse(resp *http.Response) (Blob
|
|||
// GetTags - The Get Tags operation enables users to get the tags associated with a blob.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientGetTagsOptions contains the optional parameters for the BlobClient.GetTags method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
|
|
@ -1627,7 +1640,7 @@ func (client *BlobClient) getTagsCreateRequest(ctx context.Context, options *Blo
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -1659,7 +1672,7 @@ func (client *BlobClient) getTagsHandleResponse(resp *http.Response) (BlobClient
|
|||
// Query - The Query operation enables users to select/project on blob data by providing simple query expressions.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientQueryOptions contains the optional parameters for the BlobClient.Query method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
// - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method.
|
||||
|
|
@ -1729,7 +1742,7 @@ func (client *BlobClient) queryCreateRequest(ctx context.Context, options *BlobC
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
if options != nil && options.QueryRequest != nil {
|
||||
if err := runtime.MarshalAsXML(req, *options.QueryRequest); err != nil {
|
||||
return nil, err
|
||||
|
|
@ -1893,7 +1906,7 @@ func (client *BlobClient) queryHandleResponse(resp *http.Response) (BlobClientQu
|
|||
// ReleaseLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - leaseID - Specifies the current lease ID on the resource.
|
||||
// - options - BlobClientReleaseLeaseOptions contains the optional parameters for the BlobClient.ReleaseLease method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
|
|
@ -1948,7 +1961,7 @@ func (client *BlobClient) releaseLeaseCreateRequest(ctx context.Context, leaseID
|
|||
}
|
||||
req.Raw().Header["x-ms-lease-action"] = []string{"release"}
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -1987,7 +2000,7 @@ func (client *BlobClient) releaseLeaseHandleResponse(resp *http.Response) (BlobC
|
|||
// RenewLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - leaseID - Specifies the current lease ID on the resource.
|
||||
// - options - BlobClientRenewLeaseOptions contains the optional parameters for the BlobClient.RenewLease method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
|
|
@ -2042,7 +2055,7 @@ func (client *BlobClient) renewLeaseCreateRequest(ctx context.Context, leaseID s
|
|||
}
|
||||
req.Raw().Header["x-ms-lease-action"] = []string{"renew"}
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -2084,7 +2097,7 @@ func (client *BlobClient) renewLeaseHandleResponse(resp *http.Response) (BlobCli
|
|||
// SetExpiry - Sets the time a blob will expire and be deleted.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - expiryOptions - Required. Indicates mode of the expiry time
|
||||
// - options - BlobClientSetExpiryOptions contains the optional parameters for the BlobClient.SetExpiry method.
|
||||
func (client *BlobClient) SetExpiry(ctx context.Context, expiryOptions ExpiryOptions, options *BlobClientSetExpiryOptions) (BlobClientSetExpiryResponse, error) {
|
||||
|
|
@ -2125,7 +2138,7 @@ func (client *BlobClient) setExpiryCreateRequest(ctx context.Context, expiryOpti
|
|||
if options != nil && options.ExpiresOn != nil {
|
||||
req.Raw().Header["x-ms-expiry-time"] = []string{*options.ExpiresOn}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -2164,7 +2177,7 @@ func (client *BlobClient) setExpiryHandleResponse(resp *http.Response) (BlobClie
|
|||
// SetHTTPHeaders - The Set HTTP Headers operation sets system properties on the blob
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientSetHTTPHeadersOptions contains the optional parameters for the BlobClient.SetHTTPHeaders method.
|
||||
// - BlobHTTPHeaders - BlobHTTPHeaders contains a group of parameters for the BlobClient.SetHTTPHeaders method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
|
|
@ -2239,7 +2252,7 @@ func (client *BlobClient) setHTTPHeadersCreateRequest(ctx context.Context, optio
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -2285,7 +2298,7 @@ func (client *BlobClient) setHTTPHeadersHandleResponse(resp *http.Response) (Blo
|
|||
// SetImmutabilityPolicy - The Set Immutability Policy operation sets the immutability policy on the blob
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientSetImmutabilityPolicyOptions contains the optional parameters for the BlobClient.SetImmutabilityPolicy
|
||||
// method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
|
|
@ -2332,7 +2345,7 @@ func (client *BlobClient) setImmutabilityPolicyCreateRequest(ctx context.Context
|
|||
if options != nil && options.ImmutabilityPolicyExpiry != nil {
|
||||
req.Raw().Header["x-ms-immutability-policy-until-date"] = []string{(*options.ImmutabilityPolicyExpiry).In(gmt).Format(time.RFC1123)}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -2371,7 +2384,7 @@ func (client *BlobClient) setImmutabilityPolicyHandleResponse(resp *http.Respons
|
|||
// SetLegalHold - The Set Legal Hold operation sets a legal hold on the blob.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - legalHold - Specified if a legal hold should be set on the blob.
|
||||
// - options - BlobClientSetLegalHoldOptions contains the optional parameters for the BlobClient.SetLegalHold method.
|
||||
func (client *BlobClient) SetLegalHold(ctx context.Context, legalHold bool, options *BlobClientSetLegalHoldOptions) (BlobClientSetLegalHoldResponse, error) {
|
||||
|
|
@ -2409,7 +2422,7 @@ func (client *BlobClient) setLegalHoldCreateRequest(ctx context.Context, legalHo
|
|||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-legal-hold"] = []string{strconv.FormatBool(legalHold)}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -2446,7 +2459,7 @@ func (client *BlobClient) setLegalHoldHandleResponse(resp *http.Response) (BlobC
|
|||
// pairs
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientSetMetadataOptions contains the optional parameters for the BlobClient.SetMetadata method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
// - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method.
|
||||
|
|
@ -2523,7 +2536,7 @@ func (client *BlobClient) setMetadataCreateRequest(ctx context.Context, options
|
|||
}
|
||||
}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -2578,7 +2591,7 @@ func (client *BlobClient) setMetadataHandleResponse(resp *http.Response) (BlobCl
|
|||
// SetTags - The Set Tags operation enables users to set tags on a blob.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - tags - Blob tags
|
||||
// - options - BlobClientSetTagsOptions contains the optional parameters for the BlobClient.SetTags method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
|
|
@ -2632,7 +2645,7 @@ func (client *BlobClient) setTagsCreateRequest(ctx context.Context, tags BlobTag
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
if err := runtime.MarshalAsXML(req, tags); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -2667,7 +2680,7 @@ func (client *BlobClient) setTagsHandleResponse(resp *http.Response) (BlobClient
|
|||
// storage type. This operation does not update the blob's ETag.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - tier - Indicates the tier to be set on the blob.
|
||||
// - options - BlobClientSetTierOptions contains the optional parameters for the BlobClient.SetTier method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
|
|
@ -2722,7 +2735,7 @@ func (client *BlobClient) setTierCreateRequest(ctx context.Context, tier AccessT
|
|||
if options != nil && options.RehydratePriority != nil {
|
||||
req.Raw().Header["x-ms-rehydrate-priority"] = []string{string(*options.RehydratePriority)}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -2744,7 +2757,7 @@ func (client *BlobClient) setTierHandleResponse(resp *http.Response) (BlobClient
|
|||
// StartCopyFromURL - The Start Copy From URL operation copies a blob or an internet resource to a new blob.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies
|
||||
// a page blob snapshot. The value should be URL-encoded as it would appear in a request
|
||||
// URI. The source blob must either be public or must be authenticated via a shared access signature.
|
||||
|
|
@ -2848,7 +2861,7 @@ func (client *BlobClient) startCopyFromURLCreateRequest(ctx context.Context, cop
|
|||
if options != nil && options.BlobTagsString != nil {
|
||||
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -2896,7 +2909,7 @@ func (client *BlobClient) startCopyFromURLHandleResponse(resp *http.Response) (B
|
|||
// Undelete - Undelete a blob that was previously soft deleted
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - BlobClientUndeleteOptions contains the optional parameters for the BlobClient.Undelete method.
|
||||
func (client *BlobClient) Undelete(ctx context.Context, options *BlobClientUndeleteOptions) (BlobClientUndeleteResponse, error) {
|
||||
var err error
|
||||
|
|
@ -2932,7 +2945,7 @@ func (client *BlobClient) undeleteCreateRequest(ctx context.Context, options *Bl
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ type BlockBlobClient struct {
|
|||
// belong to.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - blocks - Blob Blocks.
|
||||
// - options - BlockBlobClientCommitBlockListOptions contains the optional parameters for the BlockBlobClient.CommitBlockList
|
||||
// method.
|
||||
|
|
@ -152,7 +152,7 @@ func (client *BlockBlobClient) commitBlockListCreateRequest(ctx context.Context,
|
|||
if options != nil && options.BlobTagsString != nil {
|
||||
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
if err := runtime.MarshalAsXML(req, blocks); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ func (client *BlockBlobClient) commitBlockListHandleResponse(resp *http.Response
|
|||
// GetBlockList - The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - listType - Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together.
|
||||
// - options - BlockBlobClientGetBlockListOptions contains the optional parameters for the BlockBlobClient.GetBlockList method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
|
|
@ -273,7 +273,7 @@ func (client *BlockBlobClient) getBlockListCreateRequest(ctx context.Context, li
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ func (client *BlockBlobClient) getBlockListHandleResponse(resp *http.Response) (
|
|||
// Block from URL API in conjunction with Put Block List.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - contentLength - The length of the request.
|
||||
// - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies
|
||||
// a page blob snapshot. The value should be URL-encoded as it would appear in a request
|
||||
|
|
@ -470,7 +470,7 @@ func (client *BlockBlobClient) putBlobFromURLCreateRequest(ctx context.Context,
|
|||
if options != nil && options.BlobTagsString != nil {
|
||||
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -532,7 +532,7 @@ func (client *BlockBlobClient) putBlobFromURLHandleResponse(resp *http.Response)
|
|||
// StageBlock - The Stage Block operation creates a new block to be committed as part of a blob
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - blockID - A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal
|
||||
// to 64 bytes in size. For a given blob, the length of the value specified for the blockid
|
||||
// parameter must be the same size for each block.
|
||||
|
|
@ -599,7 +599,7 @@ func (client *BlockBlobClient) stageBlockCreateRequest(ctx context.Context, bloc
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
if err := req.SetBody(body, "application/octet-stream"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -659,7 +659,7 @@ func (client *BlockBlobClient) stageBlockHandleResponse(resp *http.Response) (Bl
|
|||
// are read from a URL.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - blockID - A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal
|
||||
// to 64 bytes in size. For a given blob, the length of the value specified for the blockid
|
||||
// parameter must be the same size for each block.
|
||||
|
|
@ -748,7 +748,7 @@ func (client *BlockBlobClient) stageBlockFromURLCreateRequest(ctx context.Contex
|
|||
if options != nil && options.SourceRange != nil {
|
||||
req.Raw().Header["x-ms-source-range"] = []string{*options.SourceRange}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -807,7 +807,7 @@ func (client *BlockBlobClient) stageBlockFromURLHandleResponse(resp *http.Respon
|
|||
// the content of a block blob, use the Put Block List operation.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - contentLength - The length of the request.
|
||||
// - body - Initial data
|
||||
// - options - BlockBlobClientUploadOptions contains the optional parameters for the BlockBlobClient.Upload method.
|
||||
|
|
@ -927,7 +927,7 @@ func (client *BlockBlobClient) uploadCreateRequest(ctx context.Context, contentL
|
|||
if options != nil && options.BlobTagsString != nil {
|
||||
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
if err := req.SetBody(body, "application/octet-stream"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -940,6 +940,13 @@ func (client *BlockBlobClient) uploadHandleResponse(resp *http.Response) (BlockB
|
|||
if val := resp.Header.Get("x-ms-client-request-id"); val != "" {
|
||||
result.ClientRequestID = &val
|
||||
}
|
||||
if val := resp.Header.Get("x-ms-content-crc64"); val != "" {
|
||||
contentCRC64, err := base64.StdEncoding.DecodeString(val)
|
||||
if err != nil {
|
||||
return BlockBlobClientUploadResponse{}, err
|
||||
}
|
||||
result.ContentCRC64 = contentCRC64
|
||||
}
|
||||
if val := resp.Header.Get("Content-MD5"); val != "" {
|
||||
contentMD5, err := base64.StdEncoding.DecodeString(val)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ type ContainerClient struct {
|
|||
// to 60 seconds, or can be infinite
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - duration - Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite
|
||||
// lease can be between 15 and 60 seconds. A lease duration cannot be changed using
|
||||
// renew or change.
|
||||
|
|
@ -83,7 +83,7 @@ func (client *ContainerClient) acquireLeaseCreateRequest(ctx context.Context, du
|
|||
if options != nil && options.ProposedLeaseID != nil {
|
||||
req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ func (client *ContainerClient) acquireLeaseHandleResponse(resp *http.Response) (
|
|||
// to 60 seconds, or can be infinite
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ContainerClientBreakLeaseOptions contains the optional parameters for the ContainerClient.BreakLease method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
func (client *ContainerClient) BreakLease(ctx context.Context, options *ContainerClientBreakLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (ContainerClientBreakLeaseResponse, error) {
|
||||
|
|
@ -174,7 +174,7 @@ func (client *ContainerClient) breakLeaseCreateRequest(ctx context.Context, opti
|
|||
if options != nil && options.BreakPeriod != nil {
|
||||
req.Raw().Header["x-ms-lease-break-period"] = []string{strconv.FormatInt(int64(*options.BreakPeriod), 10)}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ func (client *ContainerClient) breakLeaseHandleResponse(resp *http.Response) (Co
|
|||
// to 60 seconds, or can be infinite
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - leaseID - Specifies the current lease ID on the resource.
|
||||
// - proposedLeaseID - Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed
|
||||
// lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID
|
||||
|
|
@ -273,7 +273,7 @@ func (client *ContainerClient) changeLeaseCreateRequest(ctx context.Context, lea
|
|||
req.Raw().Header["x-ms-lease-action"] = []string{"change"}
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
|
||||
req.Raw().Header["x-ms-proposed-lease-id"] = []string{proposedLeaseID}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -316,7 +316,7 @@ func (client *ContainerClient) changeLeaseHandleResponse(resp *http.Response) (C
|
|||
// fails
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ContainerClientCreateOptions contains the optional parameters for the ContainerClient.Create method.
|
||||
// - ContainerCPKScopeInfo - ContainerCPKScopeInfo contains a group of parameters for the ContainerClient.Create method.
|
||||
func (client *ContainerClient) Create(ctx context.Context, options *ContainerClientCreateOptions, containerCPKScopeInfo *ContainerCPKScopeInfo) (ContainerClientCreateResponse, error) {
|
||||
|
|
@ -369,7 +369,7 @@ func (client *ContainerClient) createCreateRequest(ctx context.Context, options
|
|||
}
|
||||
}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -409,7 +409,7 @@ func (client *ContainerClient) createHandleResponse(resp *http.Response) (Contai
|
|||
// deleted during garbage collection
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ContainerClientDeleteOptions contains the optional parameters for the ContainerClient.Delete method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
|
|
@ -456,7 +456,7 @@ func (client *ContainerClient) deleteCreateRequest(ctx context.Context, options
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -486,7 +486,7 @@ func (client *ContainerClient) deleteHandleResponse(resp *http.Response) (Contai
|
|||
// Filter blobs searches within the given container.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - where - Filters the results to return only to return only blobs whose tags match the specified expression.
|
||||
// - options - ContainerClientFilterBlobsOptions contains the optional parameters for the ContainerClient.FilterBlobs method.
|
||||
func (client *ContainerClient) FilterBlobs(ctx context.Context, where string, options *ContainerClientFilterBlobsOptions) (ContainerClientFilterBlobsResponse, error) {
|
||||
|
|
@ -534,7 +534,7 @@ func (client *ContainerClient) filterBlobsCreateRequest(ctx context.Context, whe
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -567,7 +567,7 @@ func (client *ContainerClient) filterBlobsHandleResponse(resp *http.Response) (C
|
|||
// be accessed publicly.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ContainerClientGetAccessPolicyOptions contains the optional parameters for the ContainerClient.GetAccessPolicy
|
||||
// method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
|
|
@ -609,7 +609,7 @@ func (client *ContainerClient) getAccessPolicyCreateRequest(ctx context.Context,
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -654,7 +654,7 @@ func (client *ContainerClient) getAccessPolicyHandleResponse(resp *http.Response
|
|||
// GetAccountInfo - Returns the sku name and account kind
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ContainerClientGetAccountInfoOptions contains the optional parameters for the ContainerClient.GetAccountInfo
|
||||
// method.
|
||||
func (client *ContainerClient) GetAccountInfo(ctx context.Context, options *ContainerClientGetAccountInfoOptions) (ContainerClientGetAccountInfoResponse, error) {
|
||||
|
|
@ -684,9 +684,15 @@ func (client *ContainerClient) getAccountInfoCreateRequest(ctx context.Context,
|
|||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("comp", "properties")
|
||||
reqQP.Set("restype", "account")
|
||||
if options != nil && options.Timeout != nil {
|
||||
reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10))
|
||||
}
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/xml"}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -706,6 +712,13 @@ func (client *ContainerClient) getAccountInfoHandleResponse(resp *http.Response)
|
|||
}
|
||||
result.Date = &date
|
||||
}
|
||||
if val := resp.Header.Get("x-ms-is-hns-enabled"); val != "" {
|
||||
isHierarchicalNamespaceEnabled, err := strconv.ParseBool(val)
|
||||
if err != nil {
|
||||
return ContainerClientGetAccountInfoResponse{}, err
|
||||
}
|
||||
result.IsHierarchicalNamespaceEnabled = &isHierarchicalNamespaceEnabled
|
||||
}
|
||||
if val := resp.Header.Get("x-ms-request-id"); val != "" {
|
||||
result.RequestID = &val
|
||||
}
|
||||
|
|
@ -722,7 +735,7 @@ func (client *ContainerClient) getAccountInfoHandleResponse(resp *http.Response)
|
|||
// does not include the container's list of blobs
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ContainerClientGetPropertiesOptions contains the optional parameters for the ContainerClient.GetProperties method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
func (client *ContainerClient) GetProperties(ctx context.Context, options *ContainerClientGetPropertiesOptions, leaseAccessConditions *LeaseAccessConditions) (ContainerClientGetPropertiesResponse, error) {
|
||||
|
|
@ -762,7 +775,7 @@ func (client *ContainerClient) getPropertiesCreateRequest(ctx context.Context, o
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -851,7 +864,7 @@ func (client *ContainerClient) getPropertiesHandleResponse(resp *http.Response)
|
|||
|
||||
// NewListBlobFlatSegmentPager - [Update] The List Blobs operation returns a list of the blobs under the specified container
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ContainerClientListBlobFlatSegmentOptions contains the optional parameters for the ContainerClient.NewListBlobFlatSegmentPager
|
||||
// method.
|
||||
//
|
||||
|
|
@ -884,7 +897,7 @@ func (client *ContainerClient) ListBlobFlatSegmentCreateRequest(ctx context.Cont
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -918,7 +931,7 @@ func (client *ContainerClient) ListBlobFlatSegmentHandleResponse(resp *http.Resp
|
|||
|
||||
// NewListBlobHierarchySegmentPager - [Update] The List Blobs operation returns a list of the blobs under the specified container
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - delimiter - When the request includes this parameter, the operation returns a BlobPrefix element in the response body that
|
||||
// acts as a placeholder for all blobs whose names begin with the same substring up to the
|
||||
// appearance of the delimiter character. The delimiter may be a single character or a string.
|
||||
|
|
@ -975,7 +988,7 @@ func (client *ContainerClient) ListBlobHierarchySegmentCreateRequest(ctx context
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -1011,7 +1024,7 @@ func (client *ContainerClient) ListBlobHierarchySegmentHandleResponse(resp *http
|
|||
// to 60 seconds, or can be infinite
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - leaseID - Specifies the current lease ID on the resource.
|
||||
// - options - ContainerClientReleaseLeaseOptions contains the optional parameters for the ContainerClient.ReleaseLease method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
|
|
@ -1058,7 +1071,7 @@ func (client *ContainerClient) releaseLeaseCreateRequest(ctx context.Context, le
|
|||
}
|
||||
req.Raw().Header["x-ms-lease-action"] = []string{"release"}
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -1097,7 +1110,7 @@ func (client *ContainerClient) releaseLeaseHandleResponse(resp *http.Response) (
|
|||
// Rename - Renames an existing container.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - sourceContainerName - Required. Specifies the name of the container to rename.
|
||||
// - options - ContainerClientRenameOptions contains the optional parameters for the ContainerClient.Rename method.
|
||||
func (client *ContainerClient) Rename(ctx context.Context, sourceContainerName string, options *ContainerClientRenameOptions) (ContainerClientRenameResponse, error) {
|
||||
|
|
@ -1139,7 +1152,7 @@ func (client *ContainerClient) renameCreateRequest(ctx context.Context, sourceCo
|
|||
if options != nil && options.SourceLeaseID != nil {
|
||||
req.Raw().Header["x-ms-source-lease-id"] = []string{*options.SourceLeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -1169,7 +1182,7 @@ func (client *ContainerClient) renameHandleResponse(resp *http.Response) (Contai
|
|||
// to 60 seconds, or can be infinite
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - leaseID - Specifies the current lease ID on the resource.
|
||||
// - options - ContainerClientRenewLeaseOptions contains the optional parameters for the ContainerClient.RenewLease method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
|
|
@ -1216,7 +1229,7 @@ func (client *ContainerClient) renewLeaseCreateRequest(ctx context.Context, leas
|
|||
}
|
||||
req.Raw().Header["x-ms-lease-action"] = []string{"renew"}
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -1258,7 +1271,7 @@ func (client *ContainerClient) renewLeaseHandleResponse(resp *http.Response) (Co
|
|||
// Restore - Restores a previously-deleted container.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ContainerClientRestoreOptions contains the optional parameters for the ContainerClient.Restore method.
|
||||
func (client *ContainerClient) Restore(ctx context.Context, options *ContainerClientRestoreOptions) (ContainerClientRestoreResponse, error) {
|
||||
var err error
|
||||
|
|
@ -1301,7 +1314,7 @@ func (client *ContainerClient) restoreCreateRequest(ctx context.Context, options
|
|||
if options != nil && options.DeletedContainerVersion != nil {
|
||||
req.Raw().Header["x-ms-deleted-container-version"] = []string{*options.DeletedContainerVersion}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -1331,7 +1344,7 @@ func (client *ContainerClient) restoreHandleResponse(resp *http.Response) (Conta
|
|||
// may be accessed publicly.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - containerACL - the acls for the container
|
||||
// - options - ContainerClientSetAccessPolicyOptions contains the optional parameters for the ContainerClient.SetAccessPolicy
|
||||
// method.
|
||||
|
|
@ -1384,7 +1397,7 @@ func (client *ContainerClient) setAccessPolicyCreateRequest(ctx context.Context,
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
type wrapper struct {
|
||||
XMLName xml.Name `xml:"SignedIdentifiers"`
|
||||
ContainerACL *[]*SignedIdentifier `xml:"SignedIdentifier"`
|
||||
|
|
@ -1430,7 +1443,7 @@ func (client *ContainerClient) setAccessPolicyHandleResponse(resp *http.Response
|
|||
// SetMetadata - operation sets one or more user-defined name-value pairs for the specified container.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ContainerClientSetMetadataOptions contains the optional parameters for the ContainerClient.SetMetadata method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
// - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method.
|
||||
|
|
@ -1482,7 +1495,7 @@ func (client *ContainerClient) setMetadataCreateRequest(ctx context.Context, opt
|
|||
}
|
||||
}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -1521,7 +1534,7 @@ func (client *ContainerClient) setMetadataHandleResponse(resp *http.Response) (C
|
|||
// SubmitBatch - The Batch operation allows multiple API calls to be embedded into a single HTTP request.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - contentLength - The length of the request.
|
||||
// - multipartContentType - Required. The value of this header must be multipart/mixed with a batch boundary. Example header
|
||||
// value: multipart/mixed; boundary=batch_
|
||||
|
|
@ -1565,7 +1578,7 @@ func (client *ContainerClient) submitBatchCreateRequest(ctx context.Context, con
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
if err := req.SetBody(body, multipartContentType); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,7 +302,13 @@ type BlobClientDownloadOptions struct {
|
|||
|
||||
// BlobClientGetAccountInfoOptions contains the optional parameters for the BlobClient.GetAccountInfo method.
|
||||
type BlobClientGetAccountInfoOptions struct {
|
||||
// placeholder for future optional parameters
|
||||
// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
|
||||
// analytics logging is enabled.
|
||||
RequestID *string
|
||||
|
||||
// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations.
|
||||
// [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations]
|
||||
Timeout *int32
|
||||
}
|
||||
|
||||
// BlobClientGetPropertiesOptions contains the optional parameters for the BlobClient.GetProperties method.
|
||||
|
|
@ -873,7 +879,13 @@ type ContainerClientGetAccessPolicyOptions struct {
|
|||
|
||||
// ContainerClientGetAccountInfoOptions contains the optional parameters for the ContainerClient.GetAccountInfo method.
|
||||
type ContainerClientGetAccountInfoOptions struct {
|
||||
// placeholder for future optional parameters
|
||||
// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
|
||||
// analytics logging is enabled.
|
||||
RequestID *string
|
||||
|
||||
// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations.
|
||||
// [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations]
|
||||
Timeout *int32
|
||||
}
|
||||
|
||||
// ContainerClientGetPropertiesOptions contains the optional parameters for the ContainerClient.GetProperties method.
|
||||
|
|
@ -1357,7 +1369,13 @@ type ServiceClientFilterBlobsOptions struct {
|
|||
|
||||
// ServiceClientGetAccountInfoOptions contains the optional parameters for the ServiceClient.GetAccountInfo method.
|
||||
type ServiceClientGetAccountInfoOptions struct {
|
||||
// placeholder for future optional parameters
|
||||
// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
|
||||
// analytics logging is enabled.
|
||||
RequestID *string
|
||||
|
||||
// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations.
|
||||
// [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations]
|
||||
Timeout *int32
|
||||
}
|
||||
|
||||
// ServiceClientGetPropertiesOptions contains the optional parameters for the ServiceClient.GetProperties method.
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ type PageBlobClient struct {
|
|||
// ClearPages - The Clear Pages operation clears a set of pages from a page blob
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - contentLength - The length of the request.
|
||||
// - options - PageBlobClientClearPagesOptions contains the optional parameters for the PageBlobClient.ClearPages method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
|
|
@ -114,7 +114,7 @@ func (client *PageBlobClient) clearPagesCreateRequest(ctx context.Context, conte
|
|||
if options != nil && options.Range != nil {
|
||||
req.Raw().Header["x-ms-range"] = []string{*options.Range}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -178,7 +178,7 @@ func (client *PageBlobClient) clearPagesHandleResponse(resp *http.Response) (Pag
|
|||
// 2016-05-31.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies
|
||||
// a page blob snapshot. The value should be URL-encoded as it would appear in a request
|
||||
// URI. The source blob must either be public or must be authenticated via a shared access signature.
|
||||
|
|
@ -235,7 +235,7 @@ func (client *PageBlobClient) copyIncrementalCreateRequest(ctx context.Context,
|
|||
if modifiedAccessConditions != nil && modifiedAccessConditions.IfTags != nil {
|
||||
req.Raw().Header["x-ms-if-tags"] = []string{*modifiedAccessConditions.IfTags}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -280,7 +280,7 @@ func (client *PageBlobClient) copyIncrementalHandleResponse(resp *http.Response)
|
|||
// Create - The Create operation creates a new page blob.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - contentLength - The length of the request.
|
||||
// - blobContentLength - This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned
|
||||
// to a 512-byte boundary.
|
||||
|
|
@ -399,7 +399,7 @@ func (client *PageBlobClient) createCreateRequest(ctx context.Context, contentLe
|
|||
if options != nil && options.BlobTagsString != nil {
|
||||
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -461,7 +461,7 @@ func (client *PageBlobClient) createHandleResponse(resp *http.Response) (PageBlo
|
|||
// NewGetPageRangesPager - The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot
|
||||
// of a page blob
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - PageBlobClientGetPageRangesOptions contains the optional parameters for the PageBlobClient.NewGetPageRangesPager
|
||||
// method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
|
|
@ -533,7 +533,7 @@ func (client *PageBlobClient) GetPageRangesCreateRequest(ctx context.Context, op
|
|||
if options != nil && options.Range != nil {
|
||||
req.Raw().Header["x-ms-range"] = []string{*options.Range}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -582,7 +582,7 @@ func (client *PageBlobClient) GetPageRangesHandleResponse(resp *http.Response) (
|
|||
// NewGetPageRangesDiffPager - The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that
|
||||
// were changed between target blob and previous snapshot.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - PageBlobClientGetPageRangesDiffOptions contains the optional parameters for the PageBlobClient.NewGetPageRangesDiffPager
|
||||
// method.
|
||||
// - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method.
|
||||
|
|
@ -660,7 +660,7 @@ func (client *PageBlobClient) GetPageRangesDiffCreateRequest(ctx context.Context
|
|||
if options != nil && options.Range != nil {
|
||||
req.Raw().Header["x-ms-range"] = []string{*options.Range}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -709,7 +709,7 @@ func (client *PageBlobClient) GetPageRangesDiffHandleResponse(resp *http.Respons
|
|||
// Resize - Resize the Blob
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - blobContentLength - This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned
|
||||
// to a 512-byte boundary.
|
||||
// - options - PageBlobClientResizeOptions contains the optional parameters for the PageBlobClient.Resize method.
|
||||
|
|
@ -782,7 +782,7 @@ func (client *PageBlobClient) resizeCreateRequest(ctx context.Context, blobConte
|
|||
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
|
||||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -828,7 +828,7 @@ func (client *PageBlobClient) resizeHandleResponse(resp *http.Response) (PageBlo
|
|||
// UpdateSequenceNumber - Update the sequence number of the blob
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - sequenceNumberAction - Required if the x-ms-blob-sequence-number header is set for the request. This property applies to
|
||||
// page blobs only. This property indicates how the service should modify the blob's sequence number
|
||||
// - options - PageBlobClientUpdateSequenceNumberOptions contains the optional parameters for the PageBlobClient.UpdateSequenceNumber
|
||||
|
|
@ -891,7 +891,7 @@ func (client *PageBlobClient) updateSequenceNumberCreateRequest(ctx context.Cont
|
|||
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
|
||||
}
|
||||
req.Raw().Header["x-ms-sequence-number-action"] = []string{string(sequenceNumberAction)}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -937,7 +937,7 @@ func (client *PageBlobClient) updateSequenceNumberHandleResponse(resp *http.Resp
|
|||
// UploadPages - The Upload Pages operation writes a range of pages to a page blob
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - contentLength - The length of the request.
|
||||
// - body - Initial data
|
||||
// - options - PageBlobClientUploadPagesOptions contains the optional parameters for the PageBlobClient.UploadPages method.
|
||||
|
|
@ -1031,7 +1031,7 @@ func (client *PageBlobClient) uploadPagesCreateRequest(ctx context.Context, cont
|
|||
if options != nil && options.Range != nil {
|
||||
req.Raw().Header["x-ms-range"] = []string{*options.Range}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
if err := req.SetBody(body, "application/octet-stream"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -1108,7 +1108,7 @@ func (client *PageBlobClient) uploadPagesHandleResponse(resp *http.Response) (Pa
|
|||
// a URL
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - sourceURL - Specify a URL to the copy source.
|
||||
// - sourceRange - Bytes of source data in the specified range. The length of this range should match the ContentLength header
|
||||
// and x-ms-range/Range destination range header.
|
||||
|
|
@ -1224,7 +1224,7 @@ func (client *PageBlobClient) uploadPagesFromURLCreateRequest(ctx context.Contex
|
|||
req.Raw().Header["x-ms-source-if-unmodified-since"] = []string{(*sourceModifiedAccessConditions.SourceIfUnmodifiedSince).In(gmt).Format(time.RFC1123)}
|
||||
}
|
||||
req.Raw().Header["x-ms-source-range"] = []string{sourceRange}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -490,6 +490,9 @@ type BlobClientGetAccountInfoResponse struct {
|
|||
// Date contains the information returned from the Date header response.
|
||||
Date *time.Time
|
||||
|
||||
// IsHierarchicalNamespaceEnabled contains the information returned from the x-ms-is-hns-enabled header response.
|
||||
IsHierarchicalNamespaceEnabled *bool
|
||||
|
||||
// RequestID contains the information returned from the x-ms-request-id header response.
|
||||
RequestID *string
|
||||
|
||||
|
|
@ -1176,6 +1179,9 @@ type BlockBlobClientUploadResponse struct {
|
|||
// ClientRequestID contains the information returned from the x-ms-client-request-id header response.
|
||||
ClientRequestID *string
|
||||
|
||||
// ContentCRC64 contains the information returned from the x-ms-content-crc64 header response.
|
||||
ContentCRC64 []byte
|
||||
|
||||
// ContentMD5 contains the information returned from the Content-MD5 header response.
|
||||
ContentMD5 []byte
|
||||
|
||||
|
|
@ -1371,6 +1377,9 @@ type ContainerClientGetAccountInfoResponse struct {
|
|||
// Date contains the information returned from the Date header response.
|
||||
Date *time.Time
|
||||
|
||||
// IsHierarchicalNamespaceEnabled contains the information returned from the x-ms-is-hns-enabled header response.
|
||||
IsHierarchicalNamespaceEnabled *bool
|
||||
|
||||
// RequestID contains the information returned from the x-ms-request-id header response.
|
||||
RequestID *string
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ type ServiceClient struct {
|
|||
// be scoped within the expression to a single container.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - where - Filters the results to return only to return only blobs whose tags match the specified expression.
|
||||
// - options - ServiceClientFilterBlobsOptions contains the optional parameters for the ServiceClient.FilterBlobs method.
|
||||
func (client *ServiceClient) FilterBlobs(ctx context.Context, where string, options *ServiceClientFilterBlobsOptions) (ServiceClientFilterBlobsResponse, error) {
|
||||
|
|
@ -77,7 +77,7 @@ func (client *ServiceClient) filterBlobsCreateRequest(ctx context.Context, where
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ func (client *ServiceClient) filterBlobsHandleResponse(resp *http.Response) (Ser
|
|||
// GetAccountInfo - Returns the sku name and account kind
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ServiceClientGetAccountInfoOptions contains the optional parameters for the ServiceClient.GetAccountInfo method.
|
||||
func (client *ServiceClient) GetAccountInfo(ctx context.Context, options *ServiceClientGetAccountInfoOptions) (ServiceClientGetAccountInfoResponse, error) {
|
||||
var err error
|
||||
|
|
@ -138,9 +138,15 @@ func (client *ServiceClient) getAccountInfoCreateRequest(ctx context.Context, op
|
|||
reqQP := req.Raw().URL.Query()
|
||||
reqQP.Set("comp", "properties")
|
||||
reqQP.Set("restype", "account")
|
||||
if options != nil && options.Timeout != nil {
|
||||
reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10))
|
||||
}
|
||||
req.Raw().URL.RawQuery = reqQP.Encode()
|
||||
req.Raw().Header["Accept"] = []string{"application/xml"}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +189,7 @@ func (client *ServiceClient) getAccountInfoHandleResponse(resp *http.Response) (
|
|||
// CORS (Cross-Origin Resource Sharing) rules.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ServiceClientGetPropertiesOptions contains the optional parameters for the ServiceClient.GetProperties method.
|
||||
func (client *ServiceClient) GetProperties(ctx context.Context, options *ServiceClientGetPropertiesOptions) (ServiceClientGetPropertiesResponse, error) {
|
||||
var err error
|
||||
|
|
@ -220,7 +226,7 @@ func (client *ServiceClient) getPropertiesCreateRequest(ctx context.Context, opt
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -246,7 +252,7 @@ func (client *ServiceClient) getPropertiesHandleResponse(resp *http.Response) (S
|
|||
// location endpoint when read-access geo-redundant replication is enabled for the storage account.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ServiceClientGetStatisticsOptions contains the optional parameters for the ServiceClient.GetStatistics method.
|
||||
func (client *ServiceClient) GetStatistics(ctx context.Context, options *ServiceClientGetStatisticsOptions) (ServiceClientGetStatisticsResponse, error) {
|
||||
var err error
|
||||
|
|
@ -283,7 +289,7 @@ func (client *ServiceClient) getStatisticsCreateRequest(ctx context.Context, opt
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -316,7 +322,7 @@ func (client *ServiceClient) getStatisticsHandleResponse(resp *http.Response) (S
|
|||
// bearer token authentication.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - keyInfo - Key information
|
||||
// - options - ServiceClientGetUserDelegationKeyOptions contains the optional parameters for the ServiceClient.GetUserDelegationKey
|
||||
// method.
|
||||
|
|
@ -355,7 +361,7 @@ func (client *ServiceClient) getUserDelegationKeyCreateRequest(ctx context.Conte
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
if err := runtime.MarshalAsXML(req, keyInfo); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -390,7 +396,7 @@ func (client *ServiceClient) getUserDelegationKeyHandleResponse(resp *http.Respo
|
|||
// NewListContainersSegmentPager - The List Containers Segment operation returns a list of the containers under the specified
|
||||
// account
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - options - ServiceClientListContainersSegmentOptions contains the optional parameters for the ServiceClient.NewListContainersSegmentPager
|
||||
// method.
|
||||
//
|
||||
|
|
@ -422,7 +428,7 @@ func (client *ServiceClient) ListContainersSegmentCreateRequest(ctx context.Cont
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -448,7 +454,7 @@ func (client *ServiceClient) ListContainersSegmentHandleResponse(resp *http.Resp
|
|||
// and CORS (Cross-Origin Resource Sharing) rules
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - storageServiceProperties - The StorageService properties.
|
||||
// - options - ServiceClientSetPropertiesOptions contains the optional parameters for the ServiceClient.SetProperties method.
|
||||
func (client *ServiceClient) SetProperties(ctx context.Context, storageServiceProperties StorageServiceProperties, options *ServiceClientSetPropertiesOptions) (ServiceClientSetPropertiesResponse, error) {
|
||||
|
|
@ -486,7 +492,7 @@ func (client *ServiceClient) setPropertiesCreateRequest(ctx context.Context, sto
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
if err := runtime.MarshalAsXML(req, storageServiceProperties); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -511,7 +517,7 @@ func (client *ServiceClient) setPropertiesHandleResponse(resp *http.Response) (S
|
|||
// SubmitBatch - The Batch operation allows multiple API calls to be embedded into a single HTTP request.
|
||||
// If the operation fails it returns an *azcore.ResponseError type.
|
||||
//
|
||||
// Generated from API version 2023-11-03
|
||||
// Generated from API version 2024-08-04
|
||||
// - contentLength - The length of the request.
|
||||
// - multipartContentType - Required. The value of this header must be multipart/mixed with a batch boundary. Example header
|
||||
// value: multipart/mixed; boundary=batch_
|
||||
|
|
@ -554,7 +560,7 @@ func (client *ServiceClient) submitBatchCreateRequest(ctx context.Context, conte
|
|||
if options != nil && options.RequestID != nil {
|
||||
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
|
||||
}
|
||||
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
|
||||
req.Raw().Header["x-ms-version"] = []string{"2024-08-04"}
|
||||
if err := req.SetBody(body, multipartContentType); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
202
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/LICENSE
generated
vendored
Normal file
202
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
3
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/README.md
generated
vendored
Normal file
3
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# GCP Resource detection library
|
||||
|
||||
This is a library intended to be used by Upstream OpenTelemetry resource detectors. It exists within this repository to allow for integration testing of the detection functions in real GCP environments.
|
||||
76
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/app_engine.go
generated
vendored
Normal file
76
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/app_engine.go
generated
vendored
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
// Copyright 2022 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package gcp
|
||||
|
||||
const (
|
||||
// See https://cloud.google.com/appengine/docs/flexible/python/migrating#modules
|
||||
// for the environment variables available in GAE environments.
|
||||
gaeServiceEnv = "GAE_SERVICE"
|
||||
gaeVersionEnv = "GAE_VERSION"
|
||||
gaeInstanceEnv = "GAE_INSTANCE"
|
||||
gaeEnv = "GAE_ENV"
|
||||
gaeStandard = "standard"
|
||||
)
|
||||
|
||||
func (d *Detector) onAppEngineStandard() bool {
|
||||
// See https://cloud.google.com/appengine/docs/standard/go111/runtime#environment_variables.
|
||||
env, found := d.os.LookupEnv(gaeEnv)
|
||||
return found && env == gaeStandard
|
||||
}
|
||||
|
||||
func (d *Detector) onAppEngine() bool {
|
||||
_, found := d.os.LookupEnv(gaeServiceEnv)
|
||||
return found
|
||||
}
|
||||
|
||||
// AppEngineServiceName returns the service name of the app engine service.
|
||||
func (d *Detector) AppEngineServiceName() (string, error) {
|
||||
if name, found := d.os.LookupEnv(gaeServiceEnv); found {
|
||||
return name, nil
|
||||
}
|
||||
return "", errEnvVarNotFound
|
||||
}
|
||||
|
||||
// AppEngineServiceVersion returns the service version of the app engine service.
|
||||
func (d *Detector) AppEngineServiceVersion() (string, error) {
|
||||
if version, found := d.os.LookupEnv(gaeVersionEnv); found {
|
||||
return version, nil
|
||||
}
|
||||
return "", errEnvVarNotFound
|
||||
}
|
||||
|
||||
// AppEngineServiceInstance returns the service instance of the app engine service.
|
||||
func (d *Detector) AppEngineServiceInstance() (string, error) {
|
||||
if instanceID, found := d.os.LookupEnv(gaeInstanceEnv); found {
|
||||
return instanceID, nil
|
||||
}
|
||||
return "", errEnvVarNotFound
|
||||
}
|
||||
|
||||
// AppEngineFlexAvailabilityZoneAndRegion returns the zone and region in which this program is running.
|
||||
func (d *Detector) AppEngineFlexAvailabilityZoneAndRegion() (string, string, error) {
|
||||
// The GCE metadata server is available on App Engine Flex.
|
||||
return d.GCEAvailabilityZoneAndRegion()
|
||||
}
|
||||
|
||||
// AppEngineStandardAvailabilityZone returns the zone the app engine service is running in.
|
||||
func (d *Detector) AppEngineStandardAvailabilityZone() (string, error) {
|
||||
return d.metadata.Zone()
|
||||
}
|
||||
|
||||
// AppEngineStandardCloudRegion returns the region the app engine service is running in.
|
||||
func (d *Detector) AppEngineStandardCloudRegion() (string, error) {
|
||||
return d.FaaSCloudRegion()
|
||||
}
|
||||
55
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/bms.go
generated
vendored
Normal file
55
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/bms.go
generated
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright 2024 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package gcp
|
||||
|
||||
const (
|
||||
bmsProjectIDEnv = "BMS_PROJECT_ID"
|
||||
bmsRegionEnv = "BMS_REGION"
|
||||
bmsInstanceIDEnv = "BMS_INSTANCE_ID"
|
||||
)
|
||||
|
||||
// onBareMetalSolution checks if the code is running on a Google Cloud Bare Metal Solution (BMS) by verifying
|
||||
// the presence and non-empty values of BMS_PROJECT_ID, BMS_REGION, and BMS_INSTANCE_ID environment variables.
|
||||
// For more information on Google Cloud Bare Metal Solution, see: https://cloud.google.com/bare-metal/docs
|
||||
func (d *Detector) onBareMetalSolution() bool {
|
||||
projectID, projectIDExists := d.os.LookupEnv(bmsProjectIDEnv)
|
||||
region, regionExists := d.os.LookupEnv(bmsRegionEnv)
|
||||
instanceID, instanceIDExists := d.os.LookupEnv(bmsInstanceIDEnv)
|
||||
return projectIDExists && regionExists && instanceIDExists && projectID != "" && region != "" && instanceID != ""
|
||||
}
|
||||
|
||||
// BareMetalSolutionInstanceID returns the instance ID from the BMS_INSTANCE_ID environment variable.
|
||||
func (d *Detector) BareMetalSolutionInstanceID() (string, error) {
|
||||
if instanceID, found := d.os.LookupEnv(bmsInstanceIDEnv); found {
|
||||
return instanceID, nil
|
||||
}
|
||||
return "", errEnvVarNotFound
|
||||
}
|
||||
|
||||
// BareMetalSolutionCloudRegion returns the region from the BMS_REGION environment variable.
|
||||
func (d *Detector) BareMetalSolutionCloudRegion() (string, error) {
|
||||
if region, found := d.os.LookupEnv(bmsRegionEnv); found {
|
||||
return region, nil
|
||||
}
|
||||
return "", errEnvVarNotFound
|
||||
}
|
||||
|
||||
// BareMetalSolutionProjectID returns the project ID from the BMS_PROJECT_ID environment variable.
|
||||
func (d *Detector) BareMetalSolutionProjectID() (string, error) {
|
||||
if project, found := d.os.LookupEnv(bmsProjectIDEnv); found {
|
||||
return project, nil
|
||||
}
|
||||
return "", errEnvVarNotFound
|
||||
}
|
||||
102
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/detector.go
generated
vendored
Normal file
102
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/detector.go
generated
vendored
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
// Copyright 2022 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package gcp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
|
||||
"cloud.google.com/go/compute/metadata"
|
||||
)
|
||||
|
||||
var errEnvVarNotFound = errors.New("environment variable not found")
|
||||
|
||||
// NewDetector returns a *Detector which can get detect the platform,
|
||||
// and fetch attributes of the platform on which it is running.
|
||||
func NewDetector() *Detector {
|
||||
return &Detector{metadata: metadata.NewClient(nil), os: realOSProvider{}}
|
||||
}
|
||||
|
||||
type Platform int64
|
||||
|
||||
const (
|
||||
UnknownPlatform Platform = iota
|
||||
GKE
|
||||
GCE
|
||||
CloudRun
|
||||
CloudRunJob
|
||||
CloudFunctions
|
||||
AppEngineStandard
|
||||
AppEngineFlex
|
||||
BareMetalSolution
|
||||
)
|
||||
|
||||
// CloudPlatform returns the platform on which this program is running.
|
||||
func (d *Detector) CloudPlatform() Platform {
|
||||
switch {
|
||||
case d.onBareMetalSolution():
|
||||
return BareMetalSolution
|
||||
case d.onGKE():
|
||||
return GKE
|
||||
case d.onCloudFunctions():
|
||||
return CloudFunctions
|
||||
case d.onCloudRun():
|
||||
return CloudRun
|
||||
case d.onCloudRunJob():
|
||||
return CloudRunJob
|
||||
case d.onAppEngineStandard():
|
||||
return AppEngineStandard
|
||||
case d.onAppEngine():
|
||||
return AppEngineFlex
|
||||
case d.onGCE():
|
||||
return GCE
|
||||
}
|
||||
return UnknownPlatform
|
||||
}
|
||||
|
||||
// ProjectID returns the ID of the project in which this program is running.
|
||||
func (d *Detector) ProjectID() (string, error) {
|
||||
return d.metadata.ProjectID()
|
||||
}
|
||||
|
||||
// Detector collects resource information for all GCP platforms.
|
||||
type Detector struct {
|
||||
metadata metadataProvider
|
||||
os osProvider
|
||||
}
|
||||
|
||||
// metadataProvider contains the subset of the metadata.Client functions used
|
||||
// by this resource Detector to allow testing with a fake implementation.
|
||||
type metadataProvider interface {
|
||||
ProjectID() (string, error)
|
||||
InstanceID() (string, error)
|
||||
Get(string) (string, error)
|
||||
InstanceName() (string, error)
|
||||
Hostname() (string, error)
|
||||
Zone() (string, error)
|
||||
InstanceAttributeValue(string) (string, error)
|
||||
}
|
||||
|
||||
// osProvider contains the subset of the os package functions used by.
|
||||
type osProvider interface {
|
||||
LookupEnv(string) (string, bool)
|
||||
}
|
||||
|
||||
// realOSProvider uses the os package to lookup env vars.
|
||||
type realOSProvider struct{}
|
||||
|
||||
func (realOSProvider) LookupEnv(env string) (string, bool) {
|
||||
return os.LookupEnv(env)
|
||||
}
|
||||
105
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/faas.go
generated
vendored
Normal file
105
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/faas.go
generated
vendored
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
// Copyright 2022 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package gcp
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
// Cloud Functions env vars:
|
||||
// https://cloud.google.com/functions/docs/configuring/env-var#newer_runtimes
|
||||
//
|
||||
// Cloud Run env vars:
|
||||
// https://cloud.google.com/run/docs/container-contract#services-env-vars
|
||||
//
|
||||
// Cloud Run jobs env vars:
|
||||
// https://cloud.google.com/run/docs/container-contract#jobs-env-vars
|
||||
cloudFunctionsTargetEnv = "FUNCTION_TARGET"
|
||||
cloudRunConfigurationEnv = "K_CONFIGURATION"
|
||||
cloudRunJobsEnv = "CLOUD_RUN_JOB"
|
||||
faasServiceEnv = "K_SERVICE"
|
||||
faasRevisionEnv = "K_REVISION"
|
||||
cloudRunJobExecutionEnv = "CLOUD_RUN_EXECUTION"
|
||||
cloudRunJobTaskIndexEnv = "CLOUD_RUN_TASK_INDEX"
|
||||
regionMetadataAttr = "instance/region"
|
||||
)
|
||||
|
||||
func (d *Detector) onCloudFunctions() bool {
|
||||
_, found := d.os.LookupEnv(cloudFunctionsTargetEnv)
|
||||
return found
|
||||
}
|
||||
|
||||
func (d *Detector) onCloudRun() bool {
|
||||
_, found := d.os.LookupEnv(cloudRunConfigurationEnv)
|
||||
return found
|
||||
}
|
||||
|
||||
func (d *Detector) onCloudRunJob() bool {
|
||||
_, found := d.os.LookupEnv(cloudRunJobsEnv)
|
||||
return found
|
||||
}
|
||||
|
||||
// FaaSName returns the name of the Cloud Run, Cloud Run jobs or Cloud Functions service.
|
||||
func (d *Detector) FaaSName() (string, error) {
|
||||
if name, found := d.os.LookupEnv(faasServiceEnv); found {
|
||||
return name, nil
|
||||
}
|
||||
if name, found := d.os.LookupEnv(cloudRunJobsEnv); found {
|
||||
return name, nil
|
||||
}
|
||||
return "", errEnvVarNotFound
|
||||
}
|
||||
|
||||
// FaaSVersion returns the revision of the Cloud Run or Cloud Functions service.
|
||||
func (d *Detector) FaaSVersion() (string, error) {
|
||||
if version, found := d.os.LookupEnv(faasRevisionEnv); found {
|
||||
return version, nil
|
||||
}
|
||||
return "", errEnvVarNotFound
|
||||
}
|
||||
|
||||
// CloudRunJobExecution returns the execution id of the Cloud Run jobs.
|
||||
func (d *Detector) CloudRunJobExecution() (string, error) {
|
||||
if eid, found := d.os.LookupEnv(cloudRunJobExecutionEnv); found {
|
||||
return eid, nil
|
||||
}
|
||||
return "", errEnvVarNotFound
|
||||
}
|
||||
|
||||
// CloudRunJobTaskIndex returns the task index for the execution of the Cloud Run jobs.
|
||||
func (d *Detector) CloudRunJobTaskIndex() (string, error) {
|
||||
if tidx, found := d.os.LookupEnv(cloudRunJobTaskIndexEnv); found {
|
||||
return tidx, nil
|
||||
}
|
||||
return "", errEnvVarNotFound
|
||||
}
|
||||
|
||||
// FaaSID returns the instance id of the Cloud Run or Cloud Function.
|
||||
func (d *Detector) FaaSID() (string, error) {
|
||||
return d.metadata.InstanceID()
|
||||
}
|
||||
|
||||
// FaaSCloudRegion detects region from the metadata server.
|
||||
// It is in the format /projects/<project_number>/regions/<region>.
|
||||
//
|
||||
// https://cloud.google.com/run/docs/reference/container-contract#metadata-server
|
||||
func (d *Detector) FaaSCloudRegion() (string, error) {
|
||||
region, err := d.metadata.Get(regionMetadataAttr)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return region[strings.LastIndex(region, "/")+1:], nil
|
||||
}
|
||||
75
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gce.go
generated
vendored
Normal file
75
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gce.go
generated
vendored
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
// Copyright 2022 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package gcp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// See the available GCE instance metadata:
|
||||
// https://cloud.google.com/compute/docs/metadata/default-metadata-values#vm_instance_metadata
|
||||
const machineTypeMetadataAttr = "instance/machine-type"
|
||||
|
||||
func (d *Detector) onGCE() bool {
|
||||
_, err := d.metadata.Get(machineTypeMetadataAttr)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
// GCEHostType returns the machine type of the instance on which this program is running.
|
||||
func (d *Detector) GCEHostType() (string, error) {
|
||||
return d.metadata.Get(machineTypeMetadataAttr)
|
||||
}
|
||||
|
||||
// GCEHostID returns the instance ID of the instance on which this program is running.
|
||||
func (d *Detector) GCEHostID() (string, error) {
|
||||
return d.metadata.InstanceID()
|
||||
}
|
||||
|
||||
// GCEHostName returns the instance name of the instance on which this program is running.
|
||||
// Recommended to use GCEInstanceName() or GCEInstanceHostname() to more accurately reflect which
|
||||
// value is returned.
|
||||
func (d *Detector) GCEHostName() (string, error) {
|
||||
return d.metadata.InstanceName()
|
||||
}
|
||||
|
||||
// GCEInstanceName returns the instance name of the instance on which this program is running.
|
||||
// This is the value visible in the Cloud Console UI, and the prefix for the default hostname
|
||||
// of the instance as defined by the default internal DNS name (see https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
|
||||
func (d *Detector) GCEInstanceName() (string, error) {
|
||||
return d.metadata.InstanceName()
|
||||
}
|
||||
|
||||
// GCEInstanceHostname returns the full value of the default or custom hostname of the instance
|
||||
// on which this program is running. See https://cloud.google.com/compute/docs/instances/custom-hostname-vm.
|
||||
func (d *Detector) GCEInstanceHostname() (string, error) {
|
||||
return d.metadata.Hostname()
|
||||
}
|
||||
|
||||
// GCEAvailabilityZoneAndRegion returns the zone and region in which this program is running.
|
||||
func (d *Detector) GCEAvailabilityZoneAndRegion() (string, string, error) {
|
||||
zone, err := d.metadata.Zone()
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
if zone == "" {
|
||||
return "", "", fmt.Errorf("no zone detected from GCE metadata server")
|
||||
}
|
||||
splitZone := strings.SplitN(zone, "-", 3)
|
||||
if len(splitZone) != 3 {
|
||||
return "", "", fmt.Errorf("zone was not in the expected format: country-region-zone. Got %v", zone)
|
||||
}
|
||||
return zone, strings.Join(splitZone[0:2], "-"), nil
|
||||
}
|
||||
70
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gke.go
generated
vendored
Normal file
70
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gke.go
generated
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
// Copyright 2022 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package gcp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
// If the kubernetes.default.svc service exists in the cluster,
|
||||
// then the KUBERNETES_SERVICE_HOST env var will be populated.
|
||||
// Use this as an indication that we are running on kubernetes.
|
||||
k8sServiceHostEnv = "KUBERNETES_SERVICE_HOST"
|
||||
// See the available GKE metadata:
|
||||
// https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity#instance_metadata
|
||||
clusterNameMetadataAttr = "cluster-name"
|
||||
clusterLocationMetadataAttr = "cluster-location"
|
||||
)
|
||||
|
||||
func (d *Detector) onGKE() bool {
|
||||
_, found := d.os.LookupEnv(k8sServiceHostEnv)
|
||||
return found
|
||||
}
|
||||
|
||||
// GKEHostID returns the instance ID of the instance on which this program is running.
|
||||
func (d *Detector) GKEHostID() (string, error) {
|
||||
return d.GCEHostID()
|
||||
}
|
||||
|
||||
// GKEClusterName returns the name if the GKE cluster in which this program is running.
|
||||
func (d *Detector) GKEClusterName() (string, error) {
|
||||
return d.metadata.InstanceAttributeValue(clusterNameMetadataAttr)
|
||||
}
|
||||
|
||||
type LocationType int64
|
||||
|
||||
const (
|
||||
UndefinedLocation LocationType = iota
|
||||
Zone
|
||||
Region
|
||||
)
|
||||
|
||||
// GKEAvailabilityZoneOrRegion returns the location of the cluster and whether the cluster is zonal or regional.
|
||||
func (d *Detector) GKEAvailabilityZoneOrRegion() (string, LocationType, error) {
|
||||
clusterLocation, err := d.metadata.InstanceAttributeValue(clusterLocationMetadataAttr)
|
||||
if err != nil {
|
||||
return "", UndefinedLocation, err
|
||||
}
|
||||
switch strings.Count(clusterLocation, "-") {
|
||||
case 1:
|
||||
return clusterLocation, Region, nil
|
||||
case 2:
|
||||
return clusterLocation, Zone, nil
|
||||
default:
|
||||
return "", UndefinedLocation, fmt.Errorf("unrecognized format for cluster location: %v", clusterLocation)
|
||||
}
|
||||
}
|
||||
202
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/LICENSE
generated
vendored
Normal file
202
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
37
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/README.md
generated
vendored
Normal file
37
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# OpenTelemetry Google Cloud Monitoring Exporter
|
||||
|
||||
[](https://pkg.go.dev/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric)
|
||||
[![Apache License][license-image]][license-url]
|
||||
|
||||
OpenTelemetry Google Cloud Monitoring Exporter allow the user to send collected metrics to Google Cloud.
|
||||
|
||||
[Google Cloud Monitoring](https://cloud.google.com/monitoring) provides visibility into the performance, uptime, and overall health of cloud-powered applications. It collects metrics, events, and metadata from Google Cloud, Amazon Web Services, hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch, and many others. Operations ingests that data and generates insights via dashboards, charts, and alerts. Cloud Monitoring alerting helps you collaborate by integrating with Slack, PagerDuty, and more.
|
||||
|
||||
## Setup
|
||||
|
||||
Google Cloud Monitoring is a managed service provided by Google Cloud Platform. Google Cloud Monitoring requires to set up "Workspace" in advance. The guide to create a new Workspace is available on [the official document](https://cloud.google.com/monitoring/workspaces/create).
|
||||
|
||||
## Authentication
|
||||
|
||||
The Google Cloud Monitoring exporter depends upon [`google.FindDefaultCredentials`](https://pkg.go.dev/golang.org/x/oauth2/google?tab=doc#FindDefaultCredentials), so the service account is automatically detected by default, but also the custom credential file (so called `service_account_key.json`) can be detected with specific conditions. Quoting from the document of `google.FindDefaultCredentials`:
|
||||
|
||||
* A JSON file whose path is specified by the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
|
||||
* A JSON file in a location known to the gcloud command-line tool. On Windows, this is `%APPDATA%/gcloud/application_default_credentials.json`. On other systems, `$HOME/.config/gcloud/application_default_credentials.json`.
|
||||
|
||||
When running code locally, you may need to specify a Google Project ID in addition to `GOOGLE_APPLICATION_CREDENTIALS`. This is best done using an environment variable (e.g. `GOOGLE_CLOUD_PROJECT`) and the `metric.WithProjectID` method, e.g.:
|
||||
|
||||
```golang
|
||||
projectID := os.Getenv("GOOGLE_CLOUD_PROJECT")
|
||||
opts := []mexporter.Option{
|
||||
mexporter.WithProjectID(projectID),
|
||||
}
|
||||
```
|
||||
|
||||
## Useful links
|
||||
|
||||
* For more information on OpenTelemetry, visit: https://opentelemetry.io/
|
||||
* For more about OpenTelemetry Go, visit: https://github.com/open-telemetry/opentelemetry-go
|
||||
* Learn more about Google Cloud Monitoring at https://cloud.google.com/monitoring
|
||||
|
||||
[license-url]: https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/main/LICENSE
|
||||
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
|
||||
49
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/cloudmonitoring.go
generated
vendored
Normal file
49
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/cloudmonitoring.go
generated
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package metric
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
|
||||
|
||||
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
|
||||
"golang.org/x/oauth2/google"
|
||||
)
|
||||
|
||||
// New creates a new Exporter thats implements metric.Exporter.
|
||||
func New(opts ...Option) (sdkmetric.Exporter, error) {
|
||||
o := options{
|
||||
context: context.Background(),
|
||||
resourceAttributeFilter: DefaultResourceAttributesFilter,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(&o)
|
||||
}
|
||||
|
||||
if o.projectID == "" {
|
||||
creds, err := google.FindDefaultCredentials(o.context, monitoring.DefaultAuthScopes()...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to find Google Cloud credentials: %v", err)
|
||||
}
|
||||
if creds.ProjectID == "" {
|
||||
return nil, errors.New("google cloud monitoring: no project found with application default credentials")
|
||||
}
|
||||
o.projectID = creds.ProjectID
|
||||
}
|
||||
return newMetricExporter(&o)
|
||||
}
|
||||
97
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/constants.go
generated
vendored
Normal file
97
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/constants.go
generated
vendored
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package metric
|
||||
|
||||
// TODO: remove this file when the constants are ready in the Go SDK
|
||||
|
||||
// Mappings for the well-known OpenTelemetry resource label keys
|
||||
// to applicable Monitored Resource label keys.
|
||||
// A uniquely identifying name for the Kubernetes cluster. Kubernetes
|
||||
// does not have cluster names as an internal concept so this may be
|
||||
// set to any meaningful value within the environment. For example,
|
||||
// GKE clusters have a name which can be used for this label.
|
||||
const (
|
||||
// Deprecated: use semconv.CloudProviderKey instead.
|
||||
CloudKeyProvider = "cloud.provider"
|
||||
// Deprecated: use semconv.CloudAccountIDKey instead.
|
||||
CloudKeyAccountID = "cloud.account.id"
|
||||
// Deprecated: use semconv.CloudRegionKey instead.
|
||||
CloudKeyRegion = "cloud.region"
|
||||
// Deprecated: use semconv.CloudAvailabilityZoneKey instead.
|
||||
CloudKeyZone = "cloud.availability_zone"
|
||||
|
||||
// Deprecated: use semconv.ServiceNamespaceKey instead.
|
||||
ServiceKeyNamespace = "service.namespace"
|
||||
// Deprecated: use semconv.ServiceInstanceIDKey instead.
|
||||
ServiceKeyInstanceID = "service.instance.id"
|
||||
// Deprecated: use semconv.ServiceNameKey instead.
|
||||
ServiceKeyName = "service.name"
|
||||
|
||||
// Deprecated: HostType is not needed.
|
||||
HostType = "host"
|
||||
// A uniquely identifying name for the host.
|
||||
// Deprecated: use semconv.HostNameKey instead.
|
||||
HostKeyName = "host.name"
|
||||
// A hostname as returned by the 'hostname' command on host machine.
|
||||
// Deprecated: HostKeyHostName is not needed.
|
||||
HostKeyHostName = "host.hostname"
|
||||
// Deprecated: use semconv.HostIDKey instead.
|
||||
HostKeyID = "host.id"
|
||||
// Deprecated: use semconv.HostTypeKey instead.
|
||||
HostKeyType = "host.type"
|
||||
|
||||
// A uniquely identifying name for the Container.
|
||||
// Deprecated: use semconv.ContainerNameKey instead.
|
||||
ContainerKeyName = "container.name"
|
||||
// Deprecated: use semconv.ContainerImageNameKey instead.
|
||||
ContainerKeyImageName = "container.image.name"
|
||||
// Deprecated: use semconv.ContainerImageTagKey instead.
|
||||
ContainerKeyImageTag = "container.image.tag"
|
||||
|
||||
// Cloud Providers
|
||||
// Deprecated: use semconv.CloudProviderAWS instead.
|
||||
CloudProviderAWS = "aws"
|
||||
// Deprecated: use semconv.CloudProviderGCP instead.
|
||||
CloudProviderGCP = "gcp"
|
||||
// Deprecated: use semconv.CloudProviderAzure instead.
|
||||
CloudProviderAZURE = "azure"
|
||||
|
||||
// Deprecated: Use "k8s" instead. This should not be needed.
|
||||
K8S = "k8s"
|
||||
// Deprecated: use semconv.K8SClusterNameKey instead.
|
||||
K8SKeyClusterName = "k8s.cluster.name"
|
||||
// Deprecated: use semconv.K8SNamespaceNameKey instead.
|
||||
K8SKeyNamespaceName = "k8s.namespace.name"
|
||||
// Deprecated: use semconv.K8SPodNameKey instead.
|
||||
K8SKeyPodName = "k8s.pod.name"
|
||||
// Deprecated: use semconv.K8SDeploymentNameKey instead.
|
||||
K8SKeyDeploymentName = "k8s.deployment.name"
|
||||
|
||||
// Monitored Resources types
|
||||
// Deprecated: Use "k8s_container" instead.
|
||||
K8SContainer = "k8s_container"
|
||||
// Deprecated: Use "k8s_node" instead.
|
||||
K8SNode = "k8s_node"
|
||||
// Deprecated: Use "k8s_pod" instead.
|
||||
K8SPod = "k8s_pod"
|
||||
// Deprecated: Use "k8s_cluster" instead.
|
||||
K8SCluster = "k8s_cluster"
|
||||
// Deprecated: Use "gce_instance" instead.
|
||||
GCEInstance = "gce_instance"
|
||||
// Deprecated: Use "aws_ec2_instance" instead.
|
||||
AWSEC2Instance = "aws_ec2_instance"
|
||||
// Deprecated: Use "generic_task" instead.
|
||||
GenericTask = "generic_task"
|
||||
)
|
||||
32
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/error.go
generated
vendored
Normal file
32
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/error.go
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package metric
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var (
|
||||
errBlankProjectID = errors.New("expecting a non-blank ProjectID")
|
||||
)
|
||||
|
||||
type errUnexpectedAggregationKind struct {
|
||||
kind string
|
||||
}
|
||||
|
||||
func (e errUnexpectedAggregationKind) Error() string {
|
||||
return fmt.Sprintf("the metric kind is unexpected: %v", e.kind)
|
||||
}
|
||||
890
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/metric.go
generated
vendored
Normal file
890
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/metric.go
generated
vendored
Normal file
|
|
@ -0,0 +1,890 @@
|
|||
// Copyright 2021 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package metric
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"net/url"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/sdk/instrumentation"
|
||||
"go.opentelemetry.io/otel/sdk/metric"
|
||||
"go.opentelemetry.io/otel/sdk/metric/metricdata"
|
||||
"go.opentelemetry.io/otel/sdk/resource"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
|
||||
"cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
|
||||
"github.com/googleapis/gax-go/v2"
|
||||
"google.golang.org/api/option"
|
||||
"google.golang.org/genproto/googleapis/api/distribution"
|
||||
"google.golang.org/genproto/googleapis/api/label"
|
||||
googlemetricpb "google.golang.org/genproto/googleapis/api/metric"
|
||||
monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/encoding/gzip"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
|
||||
"github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping"
|
||||
)
|
||||
|
||||
const (
|
||||
// The number of timeserieses to send to GCM in a single request. This
|
||||
// is a hard limit in the GCM API, so we never want to exceed 200.
|
||||
sendBatchSize = 200
|
||||
|
||||
cloudMonitoringMetricDescriptorNameFormat = "workload.googleapis.com/%s"
|
||||
platformMappingMonitoredResourceKey = "gcp.resource_type"
|
||||
)
|
||||
|
||||
// key is used to judge the uniqueness of the record descriptor.
|
||||
type key struct {
|
||||
name string
|
||||
libraryname string
|
||||
}
|
||||
|
||||
func keyOf(metrics metricdata.Metrics, library instrumentation.Library) key {
|
||||
return key{
|
||||
name: metrics.Name,
|
||||
libraryname: library.Name,
|
||||
}
|
||||
}
|
||||
|
||||
// metricExporter is the implementation of OpenTelemetry metric exporter for
|
||||
// Google Cloud Monitoring.
|
||||
type metricExporter struct {
|
||||
o *options
|
||||
shutdown chan struct{}
|
||||
// mdCache is the cache to hold MetricDescriptor to avoid creating duplicate MD.
|
||||
mdCache map[key]*googlemetricpb.MetricDescriptor
|
||||
client *monitoring.MetricClient
|
||||
mdLock sync.RWMutex
|
||||
shutdownOnce sync.Once
|
||||
}
|
||||
|
||||
// ForceFlush does nothing, the exporter holds no state.
|
||||
func (e *metricExporter) ForceFlush(ctx context.Context) error { return ctx.Err() }
|
||||
|
||||
// Shutdown shuts down the client connections.
|
||||
func (e *metricExporter) Shutdown(ctx context.Context) error {
|
||||
err := errShutdown
|
||||
e.shutdownOnce.Do(func() {
|
||||
close(e.shutdown)
|
||||
err = errors.Join(ctx.Err(), e.client.Close())
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
// newMetricExporter returns an exporter that uploads OTel metric data to Google Cloud Monitoring.
|
||||
func newMetricExporter(o *options) (*metricExporter, error) {
|
||||
if strings.TrimSpace(o.projectID) == "" {
|
||||
return nil, errBlankProjectID
|
||||
}
|
||||
|
||||
clientOpts := append([]option.ClientOption{option.WithGRPCDialOption(grpc.WithUserAgent(userAgent))}, o.monitoringClientOptions...)
|
||||
ctx := o.context
|
||||
if ctx == nil {
|
||||
ctx = context.Background()
|
||||
}
|
||||
client, err := monitoring.NewMetricClient(ctx, clientOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if o.compression == "gzip" {
|
||||
client.CallOptions.GetMetricDescriptor = append(client.CallOptions.GetMetricDescriptor,
|
||||
gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name)))
|
||||
client.CallOptions.CreateMetricDescriptor = append(client.CallOptions.CreateMetricDescriptor,
|
||||
gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name)))
|
||||
client.CallOptions.CreateTimeSeries = append(client.CallOptions.CreateTimeSeries,
|
||||
gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name)))
|
||||
client.CallOptions.CreateServiceTimeSeries = append(client.CallOptions.CreateServiceTimeSeries,
|
||||
gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name)))
|
||||
}
|
||||
|
||||
cache := map[key]*googlemetricpb.MetricDescriptor{}
|
||||
e := &metricExporter{
|
||||
o: o,
|
||||
mdCache: cache,
|
||||
client: client,
|
||||
shutdown: make(chan struct{}),
|
||||
}
|
||||
return e, nil
|
||||
}
|
||||
|
||||
var errShutdown = fmt.Errorf("exporter is shutdown")
|
||||
|
||||
// Export exports OpenTelemetry Metrics to Google Cloud Monitoring.
|
||||
func (me *metricExporter) Export(ctx context.Context, rm *metricdata.ResourceMetrics) error {
|
||||
select {
|
||||
case <-me.shutdown:
|
||||
return errShutdown
|
||||
default:
|
||||
}
|
||||
|
||||
if me.o.destinationProjectQuota {
|
||||
ctx = metadata.NewOutgoingContext(ctx, metadata.New(map[string]string{"x-goog-user-project": strings.TrimPrefix(me.o.projectID, "projects/")}))
|
||||
}
|
||||
return errors.Join(
|
||||
me.exportMetricDescriptor(ctx, rm),
|
||||
me.exportTimeSeries(ctx, rm),
|
||||
)
|
||||
}
|
||||
|
||||
// Temporality returns the Temporality to use for an instrument kind.
|
||||
func (me *metricExporter) Temporality(ik metric.InstrumentKind) metricdata.Temporality {
|
||||
return metric.DefaultTemporalitySelector(ik)
|
||||
}
|
||||
|
||||
// Aggregation returns the Aggregation to use for an instrument kind.
|
||||
func (me *metricExporter) Aggregation(ik metric.InstrumentKind) metric.Aggregation {
|
||||
return metric.DefaultAggregationSelector(ik)
|
||||
}
|
||||
|
||||
// exportMetricDescriptor create MetricDescriptor from the record
|
||||
// if the descriptor is not registered in Cloud Monitoring yet.
|
||||
func (me *metricExporter) exportMetricDescriptor(ctx context.Context, rm *metricdata.ResourceMetrics) error {
|
||||
// We only send metric descriptors if we're configured *and* we're not sending service timeseries.
|
||||
if me.o.disableCreateMetricDescriptors {
|
||||
return nil
|
||||
}
|
||||
|
||||
me.mdLock.Lock()
|
||||
defer me.mdLock.Unlock()
|
||||
mds := make(map[key]*googlemetricpb.MetricDescriptor)
|
||||
extraLabels := me.extraLabelsFromResource(rm.Resource)
|
||||
for _, scope := range rm.ScopeMetrics {
|
||||
for _, metrics := range scope.Metrics {
|
||||
k := keyOf(metrics, scope.Scope)
|
||||
|
||||
if _, ok := me.mdCache[k]; ok {
|
||||
continue
|
||||
}
|
||||
|
||||
if _, localok := mds[k]; !localok {
|
||||
md := me.recordToMdpb(metrics, extraLabels)
|
||||
mds[k] = md
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: This process is synchronous and blocks longer time if records in cps
|
||||
// have many different descriptors. In the cps.ForEach above, it should spawn
|
||||
// goroutines to send CreateMetricDescriptorRequest asynchronously in the case
|
||||
// the descriptor does not exist in global cache (me.mdCache).
|
||||
// See details in #26.
|
||||
var errs []error
|
||||
for kmd, md := range mds {
|
||||
err := me.createMetricDescriptorIfNeeded(ctx, md)
|
||||
if err == nil {
|
||||
me.mdCache[kmd] = md
|
||||
}
|
||||
errs = append(errs, err)
|
||||
}
|
||||
return errors.Join(errs...)
|
||||
}
|
||||
|
||||
func (me *metricExporter) createMetricDescriptorIfNeeded(ctx context.Context, md *googlemetricpb.MetricDescriptor) error {
|
||||
mdReq := &monitoringpb.GetMetricDescriptorRequest{
|
||||
Name: fmt.Sprintf("projects/%s/metricDescriptors/%s", me.o.projectID, md.Type),
|
||||
}
|
||||
_, err := me.client.GetMetricDescriptor(ctx, mdReq)
|
||||
if err == nil {
|
||||
// If the metric descriptor already exists, skip the CreateMetricDescriptor call.
|
||||
// Metric descriptors cannot be updated without deleting them first, so there
|
||||
// isn't anything we can do here:
|
||||
// https://cloud.google.com/monitoring/custom-metrics/creating-metrics#md-modify
|
||||
return nil
|
||||
}
|
||||
req := &monitoringpb.CreateMetricDescriptorRequest{
|
||||
Name: fmt.Sprintf("projects/%s", me.o.projectID),
|
||||
MetricDescriptor: md,
|
||||
}
|
||||
_, err = me.client.CreateMetricDescriptor(ctx, req)
|
||||
return err
|
||||
}
|
||||
|
||||
// exportTimeSeries create TimeSeries from the records in cps.
|
||||
// res should be the common resource among all TimeSeries, such as instance id, application name and so on.
|
||||
func (me *metricExporter) exportTimeSeries(ctx context.Context, rm *metricdata.ResourceMetrics) error {
|
||||
tss, err := me.recordsToTspbs(rm)
|
||||
if len(tss) == 0 {
|
||||
return err
|
||||
}
|
||||
|
||||
name := fmt.Sprintf("projects/%s", me.o.projectID)
|
||||
|
||||
errs := []error{err}
|
||||
for i := 0; i < len(tss); i += sendBatchSize {
|
||||
j := i + sendBatchSize
|
||||
if j >= len(tss) {
|
||||
j = len(tss)
|
||||
}
|
||||
|
||||
// TODO: When this exporter is rewritten, support writing to multiple
|
||||
// projects based on the "gcp.project.id" resource.
|
||||
req := &monitoringpb.CreateTimeSeriesRequest{
|
||||
Name: name,
|
||||
TimeSeries: tss[i:j],
|
||||
}
|
||||
if me.o.createServiceTimeSeries {
|
||||
errs = append(errs, me.client.CreateServiceTimeSeries(ctx, req))
|
||||
} else {
|
||||
errs = append(errs, me.client.CreateTimeSeries(ctx, req))
|
||||
}
|
||||
}
|
||||
|
||||
return errors.Join(errs...)
|
||||
}
|
||||
|
||||
func (me *metricExporter) extraLabelsFromResource(res *resource.Resource) *attribute.Set {
|
||||
set, _ := attribute.NewSetWithFiltered(res.Attributes(), me.o.resourceAttributeFilter)
|
||||
return &set
|
||||
}
|
||||
|
||||
// descToMetricType converts descriptor to MetricType proto type.
|
||||
// Basically this returns default value ("workload.googleapis.com/[metric type]").
|
||||
func (me *metricExporter) descToMetricType(desc metricdata.Metrics) string {
|
||||
if formatter := me.o.metricDescriptorTypeFormatter; formatter != nil {
|
||||
return formatter(desc)
|
||||
}
|
||||
return fmt.Sprintf(cloudMonitoringMetricDescriptorNameFormat, desc.Name)
|
||||
}
|
||||
|
||||
// metricTypeToDisplayName takes a GCM metric type, like (workload.googleapis.com/MyCoolMetric) and returns the display name.
|
||||
func metricTypeToDisplayName(mURL string) string {
|
||||
// strip domain, keep path after domain.
|
||||
u, err := url.Parse(fmt.Sprintf("metrics://%s", mURL))
|
||||
if err != nil || u.Path == "" {
|
||||
return mURL
|
||||
}
|
||||
return strings.TrimLeft(u.Path, "/")
|
||||
}
|
||||
|
||||
// recordToMdpb extracts data and converts them to googlemetricpb.MetricDescriptor.
|
||||
func (me *metricExporter) recordToMdpb(metrics metricdata.Metrics, extraLabels *attribute.Set) *googlemetricpb.MetricDescriptor {
|
||||
name := metrics.Name
|
||||
typ := me.descToMetricType(metrics)
|
||||
kind, valueType := recordToMdpbKindType(metrics.Data)
|
||||
|
||||
// Detailed explanations on MetricDescriptor proto is not documented on
|
||||
// generated Go packages. Refer to the original proto file.
|
||||
// https://github.com/googleapis/googleapis/blob/50af053/google/api/metric.proto#L33
|
||||
return &googlemetricpb.MetricDescriptor{
|
||||
Name: name,
|
||||
DisplayName: metricTypeToDisplayName(typ),
|
||||
Type: typ,
|
||||
MetricKind: kind,
|
||||
ValueType: valueType,
|
||||
Unit: string(metrics.Unit),
|
||||
Description: metrics.Description,
|
||||
Labels: labelDescriptors(metrics, extraLabels),
|
||||
}
|
||||
}
|
||||
|
||||
func labelDescriptors(metrics metricdata.Metrics, extraLabels *attribute.Set) []*label.LabelDescriptor {
|
||||
labels := []*label.LabelDescriptor{}
|
||||
seenKeys := map[string]struct{}{}
|
||||
addAttributes := func(attr *attribute.Set) {
|
||||
iter := attr.Iter()
|
||||
for iter.Next() {
|
||||
kv := iter.Attribute()
|
||||
// Skip keys that have already been set
|
||||
if _, ok := seenKeys[normalizeLabelKey(string(kv.Key))]; ok {
|
||||
continue
|
||||
}
|
||||
labels = append(labels, &label.LabelDescriptor{
|
||||
Key: normalizeLabelKey(string(kv.Key)),
|
||||
})
|
||||
seenKeys[normalizeLabelKey(string(kv.Key))] = struct{}{}
|
||||
}
|
||||
}
|
||||
addAttributes(extraLabels)
|
||||
switch a := metrics.Data.(type) {
|
||||
case metricdata.Gauge[int64]:
|
||||
for _, pt := range a.DataPoints {
|
||||
addAttributes(&pt.Attributes)
|
||||
}
|
||||
case metricdata.Gauge[float64]:
|
||||
for _, pt := range a.DataPoints {
|
||||
addAttributes(&pt.Attributes)
|
||||
}
|
||||
case metricdata.Sum[int64]:
|
||||
for _, pt := range a.DataPoints {
|
||||
addAttributes(&pt.Attributes)
|
||||
}
|
||||
case metricdata.Sum[float64]:
|
||||
for _, pt := range a.DataPoints {
|
||||
addAttributes(&pt.Attributes)
|
||||
}
|
||||
case metricdata.Histogram[float64]:
|
||||
for _, pt := range a.DataPoints {
|
||||
addAttributes(&pt.Attributes)
|
||||
}
|
||||
case metricdata.Histogram[int64]:
|
||||
for _, pt := range a.DataPoints {
|
||||
addAttributes(&pt.Attributes)
|
||||
}
|
||||
}
|
||||
return labels
|
||||
}
|
||||
|
||||
type attributes struct {
|
||||
attrs attribute.Set
|
||||
}
|
||||
|
||||
func (attrs *attributes) GetString(key string) (string, bool) {
|
||||
value, ok := attrs.attrs.Value(attribute.Key(key))
|
||||
return value.AsString(), ok
|
||||
}
|
||||
|
||||
// resourceToMonitoredResourcepb converts resource in OTel to MonitoredResource
|
||||
// proto type for Cloud Monitoring.
|
||||
//
|
||||
// https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.monitoredResourceDescriptors
|
||||
func (me *metricExporter) resourceToMonitoredResourcepb(res *resource.Resource) *monitoredrespb.MonitoredResource {
|
||||
platformMrType, platformMappingRequested := res.Set().Value(platformMappingMonitoredResourceKey)
|
||||
|
||||
// check if platform mapping is requested and possible
|
||||
if platformMappingRequested && platformMrType.AsString() == me.o.monitoredResourceDescription.mrType {
|
||||
// assemble attributes required to construct this MR
|
||||
attributeMap := make(map[string]string)
|
||||
for expectedLabel := range me.o.monitoredResourceDescription.mrLabels {
|
||||
value, found := res.Set().Value(attribute.Key(expectedLabel))
|
||||
if found {
|
||||
attributeMap[expectedLabel] = value.AsString()
|
||||
}
|
||||
}
|
||||
return &monitoredrespb.MonitoredResource{
|
||||
Type: platformMrType.AsString(),
|
||||
Labels: attributeMap,
|
||||
}
|
||||
}
|
||||
|
||||
gmr := resourcemapping.ResourceAttributesToMonitoringMonitoredResource(&attributes{
|
||||
attrs: attribute.NewSet(res.Attributes()...),
|
||||
})
|
||||
newLabels := make(map[string]string, len(gmr.Labels))
|
||||
for k, v := range gmr.Labels {
|
||||
newLabels[k] = sanitizeUTF8(v)
|
||||
}
|
||||
mr := &monitoredrespb.MonitoredResource{
|
||||
Type: gmr.Type,
|
||||
Labels: newLabels,
|
||||
}
|
||||
return mr
|
||||
}
|
||||
|
||||
// recordToMdpbKindType return the mapping from OTel's record descriptor to
|
||||
// Cloud Monitoring's MetricKind and ValueType.
|
||||
func recordToMdpbKindType(a metricdata.Aggregation) (googlemetricpb.MetricDescriptor_MetricKind, googlemetricpb.MetricDescriptor_ValueType) {
|
||||
switch agg := a.(type) {
|
||||
case metricdata.Gauge[int64]:
|
||||
return googlemetricpb.MetricDescriptor_GAUGE, googlemetricpb.MetricDescriptor_INT64
|
||||
case metricdata.Gauge[float64]:
|
||||
return googlemetricpb.MetricDescriptor_GAUGE, googlemetricpb.MetricDescriptor_DOUBLE
|
||||
case metricdata.Sum[int64]:
|
||||
if agg.IsMonotonic {
|
||||
return googlemetricpb.MetricDescriptor_CUMULATIVE, googlemetricpb.MetricDescriptor_INT64
|
||||
}
|
||||
return googlemetricpb.MetricDescriptor_GAUGE, googlemetricpb.MetricDescriptor_INT64
|
||||
case metricdata.Sum[float64]:
|
||||
if agg.IsMonotonic {
|
||||
return googlemetricpb.MetricDescriptor_CUMULATIVE, googlemetricpb.MetricDescriptor_DOUBLE
|
||||
}
|
||||
return googlemetricpb.MetricDescriptor_GAUGE, googlemetricpb.MetricDescriptor_DOUBLE
|
||||
case metricdata.Histogram[int64], metricdata.Histogram[float64]:
|
||||
return googlemetricpb.MetricDescriptor_CUMULATIVE, googlemetricpb.MetricDescriptor_DISTRIBUTION
|
||||
default:
|
||||
return googlemetricpb.MetricDescriptor_METRIC_KIND_UNSPECIFIED, googlemetricpb.MetricDescriptor_VALUE_TYPE_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
|
||||
// recordToMpb converts data from records to Metric proto type for Cloud Monitoring.
|
||||
func (me *metricExporter) recordToMpb(metrics metricdata.Metrics, attributes attribute.Set, library instrumentation.Library, extraLabels *attribute.Set) *googlemetricpb.Metric {
|
||||
me.mdLock.RLock()
|
||||
defer me.mdLock.RUnlock()
|
||||
k := keyOf(metrics, library)
|
||||
md, ok := me.mdCache[k]
|
||||
if !ok {
|
||||
md = me.recordToMdpb(metrics, extraLabels)
|
||||
}
|
||||
|
||||
labels := make(map[string]string)
|
||||
addAttributes := func(attr *attribute.Set) {
|
||||
iter := attr.Iter()
|
||||
for iter.Next() {
|
||||
kv := iter.Attribute()
|
||||
labels[normalizeLabelKey(string(kv.Key))] = sanitizeUTF8(kv.Value.Emit())
|
||||
}
|
||||
}
|
||||
addAttributes(extraLabels)
|
||||
addAttributes(&attributes)
|
||||
|
||||
return &googlemetricpb.Metric{
|
||||
Type: md.Type,
|
||||
Labels: labels,
|
||||
}
|
||||
}
|
||||
|
||||
// recordToTspb converts record to TimeSeries proto type with common resource.
|
||||
// ref. https://cloud.google.com/monitoring/api/ref_v3/rest/v3/TimeSeries
|
||||
func (me *metricExporter) recordToTspb(m metricdata.Metrics, mr *monitoredrespb.MonitoredResource, library instrumentation.Scope, extraLabels *attribute.Set) ([]*monitoringpb.TimeSeries, error) {
|
||||
var tss []*monitoringpb.TimeSeries
|
||||
var errs []error
|
||||
if m.Data == nil {
|
||||
return nil, nil
|
||||
}
|
||||
switch a := m.Data.(type) {
|
||||
case metricdata.Gauge[int64]:
|
||||
for _, point := range a.DataPoints {
|
||||
ts, err := gaugeToTimeSeries[int64](point, m, mr)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
}
|
||||
ts.Metric = me.recordToMpb(m, point.Attributes, library, extraLabels)
|
||||
tss = append(tss, ts)
|
||||
}
|
||||
case metricdata.Gauge[float64]:
|
||||
for _, point := range a.DataPoints {
|
||||
ts, err := gaugeToTimeSeries[float64](point, m, mr)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
}
|
||||
ts.Metric = me.recordToMpb(m, point.Attributes, library, extraLabels)
|
||||
tss = append(tss, ts)
|
||||
}
|
||||
case metricdata.Sum[int64]:
|
||||
for _, point := range a.DataPoints {
|
||||
var ts *monitoringpb.TimeSeries
|
||||
var err error
|
||||
if a.IsMonotonic {
|
||||
ts, err = sumToTimeSeries[int64](point, m, mr)
|
||||
} else {
|
||||
// Send non-monotonic sums as gauges
|
||||
ts, err = gaugeToTimeSeries[int64](point, m, mr)
|
||||
}
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
}
|
||||
ts.Metric = me.recordToMpb(m, point.Attributes, library, extraLabels)
|
||||
tss = append(tss, ts)
|
||||
}
|
||||
case metricdata.Sum[float64]:
|
||||
for _, point := range a.DataPoints {
|
||||
var ts *monitoringpb.TimeSeries
|
||||
var err error
|
||||
if a.IsMonotonic {
|
||||
ts, err = sumToTimeSeries[float64](point, m, mr)
|
||||
} else {
|
||||
// Send non-monotonic sums as gauges
|
||||
ts, err = gaugeToTimeSeries[float64](point, m, mr)
|
||||
}
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
}
|
||||
ts.Metric = me.recordToMpb(m, point.Attributes, library, extraLabels)
|
||||
tss = append(tss, ts)
|
||||
}
|
||||
case metricdata.Histogram[int64]:
|
||||
for _, point := range a.DataPoints {
|
||||
ts, err := histogramToTimeSeries(point, m, mr, me.o.enableSumOfSquaredDeviation, me.o.projectID)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
}
|
||||
ts.Metric = me.recordToMpb(m, point.Attributes, library, extraLabels)
|
||||
tss = append(tss, ts)
|
||||
}
|
||||
case metricdata.Histogram[float64]:
|
||||
for _, point := range a.DataPoints {
|
||||
ts, err := histogramToTimeSeries(point, m, mr, me.o.enableSumOfSquaredDeviation, me.o.projectID)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
}
|
||||
ts.Metric = me.recordToMpb(m, point.Attributes, library, extraLabels)
|
||||
tss = append(tss, ts)
|
||||
}
|
||||
case metricdata.ExponentialHistogram[int64]:
|
||||
for _, point := range a.DataPoints {
|
||||
ts, err := expHistogramToTimeSeries(point, m, mr, me.o.enableSumOfSquaredDeviation, me.o.projectID)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
}
|
||||
ts.Metric = me.recordToMpb(m, point.Attributes, library, extraLabels)
|
||||
tss = append(tss, ts)
|
||||
}
|
||||
case metricdata.ExponentialHistogram[float64]:
|
||||
for _, point := range a.DataPoints {
|
||||
ts, err := expHistogramToTimeSeries(point, m, mr, me.o.enableSumOfSquaredDeviation, me.o.projectID)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
}
|
||||
ts.Metric = me.recordToMpb(m, point.Attributes, library, extraLabels)
|
||||
tss = append(tss, ts)
|
||||
}
|
||||
default:
|
||||
errs = append(errs, errUnexpectedAggregationKind{kind: reflect.TypeOf(m.Data).String()})
|
||||
}
|
||||
return tss, errors.Join(errs...)
|
||||
}
|
||||
|
||||
func (me *metricExporter) recordsToTspbs(rm *metricdata.ResourceMetrics) ([]*monitoringpb.TimeSeries, error) {
|
||||
mr := me.resourceToMonitoredResourcepb(rm.Resource)
|
||||
extraLabels := me.extraLabelsFromResource(rm.Resource)
|
||||
|
||||
var (
|
||||
tss []*monitoringpb.TimeSeries
|
||||
errs []error
|
||||
)
|
||||
for _, scope := range rm.ScopeMetrics {
|
||||
for _, metrics := range scope.Metrics {
|
||||
ts, err := me.recordToTspb(metrics, mr, scope.Scope, extraLabels)
|
||||
errs = append(errs, err)
|
||||
tss = append(tss, ts...)
|
||||
}
|
||||
}
|
||||
|
||||
return tss, errors.Join(errs...)
|
||||
}
|
||||
|
||||
func sanitizeUTF8(s string) string {
|
||||
return strings.ToValidUTF8(s, "<22>")
|
||||
}
|
||||
|
||||
func gaugeToTimeSeries[N int64 | float64](point metricdata.DataPoint[N], metrics metricdata.Metrics, mr *monitoredrespb.MonitoredResource) (*monitoringpb.TimeSeries, error) {
|
||||
value, valueType := numberDataPointToValue(point)
|
||||
timestamp := timestamppb.New(point.Time)
|
||||
if err := timestamp.CheckValid(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &monitoringpb.TimeSeries{
|
||||
Resource: mr,
|
||||
Unit: string(metrics.Unit),
|
||||
MetricKind: googlemetricpb.MetricDescriptor_GAUGE,
|
||||
ValueType: valueType,
|
||||
Points: []*monitoringpb.Point{{
|
||||
Interval: &monitoringpb.TimeInterval{
|
||||
EndTime: timestamp,
|
||||
},
|
||||
Value: value,
|
||||
}},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func sumToTimeSeries[N int64 | float64](point metricdata.DataPoint[N], metrics metricdata.Metrics, mr *monitoredrespb.MonitoredResource) (*monitoringpb.TimeSeries, error) {
|
||||
interval, err := toNonemptyTimeIntervalpb(point.StartTime, point.Time)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
value, valueType := numberDataPointToValue[N](point)
|
||||
return &monitoringpb.TimeSeries{
|
||||
Resource: mr,
|
||||
Unit: string(metrics.Unit),
|
||||
MetricKind: googlemetricpb.MetricDescriptor_CUMULATIVE,
|
||||
ValueType: valueType,
|
||||
Points: []*monitoringpb.Point{{
|
||||
Interval: interval,
|
||||
Value: value,
|
||||
}},
|
||||
}, nil
|
||||
}
|
||||
|
||||
// TODO(@dashpole): Refactor to pass control-coupling lint check.
|
||||
//
|
||||
//nolint:revive
|
||||
func histogramToTimeSeries[N int64 | float64](point metricdata.HistogramDataPoint[N], metrics metricdata.Metrics, mr *monitoredrespb.MonitoredResource, enableSOSD bool, projectID string) (*monitoringpb.TimeSeries, error) {
|
||||
interval, err := toNonemptyTimeIntervalpb(point.StartTime, point.Time)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
distributionValue := histToDistribution(point, projectID)
|
||||
if enableSOSD {
|
||||
setSumOfSquaredDeviation(point, distributionValue)
|
||||
}
|
||||
return &monitoringpb.TimeSeries{
|
||||
Resource: mr,
|
||||
Unit: string(metrics.Unit),
|
||||
MetricKind: googlemetricpb.MetricDescriptor_CUMULATIVE,
|
||||
ValueType: googlemetricpb.MetricDescriptor_DISTRIBUTION,
|
||||
Points: []*monitoringpb.Point{{
|
||||
Interval: interval,
|
||||
Value: &monitoringpb.TypedValue{
|
||||
Value: &monitoringpb.TypedValue_DistributionValue{
|
||||
DistributionValue: distributionValue,
|
||||
},
|
||||
},
|
||||
}},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func expHistogramToTimeSeries[N int64 | float64](point metricdata.ExponentialHistogramDataPoint[N], metrics metricdata.Metrics, mr *monitoredrespb.MonitoredResource, enableSOSD bool, projectID string) (*monitoringpb.TimeSeries, error) {
|
||||
interval, err := toNonemptyTimeIntervalpb(point.StartTime, point.Time)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
distributionValue := expHistToDistribution(point, projectID)
|
||||
// TODO: Implement "setSumOfSquaredDeviationExpHist" for parameter "enableSOSD" functionality.
|
||||
return &monitoringpb.TimeSeries{
|
||||
Resource: mr,
|
||||
Unit: string(metrics.Unit),
|
||||
MetricKind: googlemetricpb.MetricDescriptor_CUMULATIVE,
|
||||
ValueType: googlemetricpb.MetricDescriptor_DISTRIBUTION,
|
||||
Points: []*monitoringpb.Point{{
|
||||
Interval: interval,
|
||||
Value: &monitoringpb.TypedValue{
|
||||
Value: &monitoringpb.TypedValue_DistributionValue{
|
||||
DistributionValue: distributionValue,
|
||||
},
|
||||
},
|
||||
}},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func toNonemptyTimeIntervalpb(start, end time.Time) (*monitoringpb.TimeInterval, error) {
|
||||
// The end time of a new interval must be at least a millisecond after the end time of the
|
||||
// previous interval, for all non-gauge types.
|
||||
// https://cloud.google.com/monitoring/api/ref_v3/rpc/google.monitoring.v3#timeinterval
|
||||
if end.Sub(start).Milliseconds() <= 1 {
|
||||
end = start.Add(time.Millisecond)
|
||||
}
|
||||
startpb := timestamppb.New(start)
|
||||
endpb := timestamppb.New(end)
|
||||
err := errors.Join(
|
||||
startpb.CheckValid(),
|
||||
endpb.CheckValid(),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &monitoringpb.TimeInterval{
|
||||
StartTime: startpb,
|
||||
EndTime: endpb,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func histToDistribution[N int64 | float64](hist metricdata.HistogramDataPoint[N], projectID string) *distribution.Distribution {
|
||||
counts := make([]int64, len(hist.BucketCounts))
|
||||
for i, v := range hist.BucketCounts {
|
||||
counts[i] = int64(v)
|
||||
}
|
||||
var mean float64
|
||||
if !math.IsNaN(float64(hist.Sum)) && hist.Count > 0 { // Avoid divide-by-zero
|
||||
mean = float64(hist.Sum) / float64(hist.Count)
|
||||
}
|
||||
return &distribution.Distribution{
|
||||
Count: int64(hist.Count),
|
||||
Mean: mean,
|
||||
BucketCounts: counts,
|
||||
BucketOptions: &distribution.Distribution_BucketOptions{
|
||||
Options: &distribution.Distribution_BucketOptions_ExplicitBuckets{
|
||||
ExplicitBuckets: &distribution.Distribution_BucketOptions_Explicit{
|
||||
Bounds: hist.Bounds,
|
||||
},
|
||||
},
|
||||
},
|
||||
Exemplars: toDistributionExemplar[N](hist.Exemplars, projectID),
|
||||
}
|
||||
}
|
||||
|
||||
func expHistToDistribution[N int64 | float64](hist metricdata.ExponentialHistogramDataPoint[N], projectID string) *distribution.Distribution {
|
||||
// First calculate underflow bucket with all negatives + zeros.
|
||||
underflow := hist.ZeroCount
|
||||
negativeBuckets := hist.NegativeBucket.Counts
|
||||
for i := 0; i < len(negativeBuckets); i++ {
|
||||
underflow += negativeBuckets[i]
|
||||
}
|
||||
|
||||
// Next, pull in remaining buckets.
|
||||
counts := make([]int64, len(hist.PositiveBucket.Counts)+2)
|
||||
bucketOptions := &distribution.Distribution_BucketOptions{}
|
||||
counts[0] = int64(underflow)
|
||||
positiveBuckets := hist.PositiveBucket.Counts
|
||||
for i := 0; i < len(positiveBuckets); i++ {
|
||||
counts[i+1] = int64(positiveBuckets[i])
|
||||
}
|
||||
// Overflow bucket is always empty
|
||||
counts[len(counts)-1] = 0
|
||||
|
||||
if len(hist.PositiveBucket.Counts) == 0 {
|
||||
// We cannot send exponential distributions with no positive buckets,
|
||||
// instead we send a simple overflow/underflow histogram.
|
||||
bucketOptions.Options = &distribution.Distribution_BucketOptions_ExplicitBuckets{
|
||||
ExplicitBuckets: &distribution.Distribution_BucketOptions_Explicit{
|
||||
Bounds: []float64{0},
|
||||
},
|
||||
}
|
||||
} else {
|
||||
// Exponential histogram
|
||||
growth := math.Exp2(math.Exp2(-float64(hist.Scale)))
|
||||
scale := math.Pow(growth, float64(hist.PositiveBucket.Offset))
|
||||
bucketOptions.Options = &distribution.Distribution_BucketOptions_ExponentialBuckets{
|
||||
ExponentialBuckets: &distribution.Distribution_BucketOptions_Exponential{
|
||||
GrowthFactor: growth,
|
||||
Scale: scale,
|
||||
NumFiniteBuckets: int32(len(counts) - 2),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
var mean float64
|
||||
if !math.IsNaN(float64(hist.Sum)) && hist.Count > 0 { // Avoid divide-by-zero
|
||||
mean = float64(hist.Sum) / float64(hist.Count)
|
||||
}
|
||||
|
||||
return &distribution.Distribution{
|
||||
Count: int64(hist.Count),
|
||||
Mean: mean,
|
||||
BucketCounts: counts,
|
||||
BucketOptions: bucketOptions,
|
||||
Exemplars: toDistributionExemplar[N](hist.Exemplars, projectID),
|
||||
}
|
||||
}
|
||||
|
||||
func toDistributionExemplar[N int64 | float64](Exemplars []metricdata.Exemplar[N], projectID string) []*distribution.Distribution_Exemplar {
|
||||
var exemplars []*distribution.Distribution_Exemplar
|
||||
for _, e := range Exemplars {
|
||||
attachments := []*anypb.Any{}
|
||||
if hasValidSpanContext(e) {
|
||||
sctx, err := anypb.New(&monitoringpb.SpanContext{
|
||||
SpanName: fmt.Sprintf("projects/%s/traces/%s/spans/%s", projectID, hex.EncodeToString(e.TraceID[:]), hex.EncodeToString(e.SpanID[:])),
|
||||
})
|
||||
if err == nil {
|
||||
attachments = append(attachments, sctx)
|
||||
}
|
||||
}
|
||||
if len(e.FilteredAttributes) > 0 {
|
||||
attr, err := anypb.New(&monitoringpb.DroppedLabels{
|
||||
Label: attributesToLabels(e.FilteredAttributes),
|
||||
})
|
||||
if err == nil {
|
||||
attachments = append(attachments, attr)
|
||||
}
|
||||
}
|
||||
exemplars = append(exemplars, &distribution.Distribution_Exemplar{
|
||||
Value: float64(e.Value),
|
||||
Timestamp: timestamppb.New(e.Time),
|
||||
Attachments: attachments,
|
||||
})
|
||||
}
|
||||
sort.Slice(exemplars, func(i, j int) bool {
|
||||
return exemplars[i].Value < exemplars[j].Value
|
||||
})
|
||||
return exemplars
|
||||
}
|
||||
|
||||
func attributesToLabels(attrs []attribute.KeyValue) map[string]string {
|
||||
labels := make(map[string]string, len(attrs))
|
||||
for _, attr := range attrs {
|
||||
labels[normalizeLabelKey(string(attr.Key))] = sanitizeUTF8(attr.Value.Emit())
|
||||
}
|
||||
return labels
|
||||
}
|
||||
|
||||
var (
|
||||
nilTraceID trace.TraceID
|
||||
nilSpanID trace.SpanID
|
||||
)
|
||||
|
||||
func hasValidSpanContext[N int64 | float64](e metricdata.Exemplar[N]) bool {
|
||||
return !bytes.Equal(e.TraceID[:], nilTraceID[:]) && !bytes.Equal(e.SpanID[:], nilSpanID[:])
|
||||
}
|
||||
|
||||
func setSumOfSquaredDeviation[N int64 | float64](hist metricdata.HistogramDataPoint[N], dist *distribution.Distribution) {
|
||||
var prevBound float64
|
||||
// Calculate the sum of squared deviation.
|
||||
for i := 0; i < len(hist.Bounds); i++ {
|
||||
// Assume all points in the bucket occur at the middle of the bucket range
|
||||
middleOfBucket := (prevBound + hist.Bounds[i]) / 2
|
||||
dist.SumOfSquaredDeviation += float64(dist.BucketCounts[i]) * (middleOfBucket - dist.Mean) * (middleOfBucket - dist.Mean)
|
||||
prevBound = hist.Bounds[i]
|
||||
}
|
||||
// The infinity bucket is an implicit +Inf bound after the list of explicit bounds.
|
||||
// Assume points in the infinity bucket are at the top of the previous bucket
|
||||
middleOfInfBucket := prevBound
|
||||
if len(dist.BucketCounts) > 0 {
|
||||
dist.SumOfSquaredDeviation += float64(dist.BucketCounts[len(dist.BucketCounts)-1]) * (middleOfInfBucket - dist.Mean) * (middleOfInfBucket - dist.Mean)
|
||||
}
|
||||
}
|
||||
|
||||
func numberDataPointToValue[N int64 | float64](
|
||||
point metricdata.DataPoint[N],
|
||||
) (*monitoringpb.TypedValue, googlemetricpb.MetricDescriptor_ValueType) {
|
||||
switch v := any(point.Value).(type) {
|
||||
case int64:
|
||||
return &monitoringpb.TypedValue{Value: &monitoringpb.TypedValue_Int64Value{
|
||||
Int64Value: v,
|
||||
}},
|
||||
googlemetricpb.MetricDescriptor_INT64
|
||||
case float64:
|
||||
return &monitoringpb.TypedValue{Value: &monitoringpb.TypedValue_DoubleValue{
|
||||
DoubleValue: v,
|
||||
}},
|
||||
googlemetricpb.MetricDescriptor_DOUBLE
|
||||
}
|
||||
// It is impossible to reach this statement
|
||||
return nil, googlemetricpb.MetricDescriptor_INT64
|
||||
}
|
||||
|
||||
// https://github.com/googleapis/googleapis/blob/c4c562f89acce603fb189679836712d08c7f8584/google/api/metric.proto#L149
|
||||
//
|
||||
// > The label key name must follow:
|
||||
// >
|
||||
// > * Only upper and lower-case letters, digits and underscores (_) are
|
||||
// > allowed.
|
||||
// > * Label name must start with a letter or digit.
|
||||
// > * The maximum length of a label name is 100 characters.
|
||||
//
|
||||
// Note: this does not truncate if a label is too long.
|
||||
func normalizeLabelKey(s string) string {
|
||||
if len(s) == 0 {
|
||||
return s
|
||||
}
|
||||
s = strings.Map(sanitizeRune, s)
|
||||
if unicode.IsDigit(rune(s[0])) {
|
||||
s = "key_" + s
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// converts anything that is not a letter or digit to an underscore.
|
||||
func sanitizeRune(r rune) rune {
|
||||
if unicode.IsLetter(r) || unicode.IsDigit(r) {
|
||||
return r
|
||||
}
|
||||
// Everything else turns into an underscore
|
||||
return '_'
|
||||
}
|
||||
201
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go
generated
vendored
Normal file
201
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go
generated
vendored
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
// Copyright 2020-2021 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package metric
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/sdk/metric/metricdata"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.24.0"
|
||||
|
||||
apioption "google.golang.org/api/option"
|
||||
)
|
||||
|
||||
var userAgent = fmt.Sprintf("opentelemetry-go %s; google-cloud-metric-exporter %s", otel.Version(), Version())
|
||||
|
||||
// MonitoredResourceDescription is the struct which holds information required to map OTel resource to specific
|
||||
// Google Cloud MonitoredResource.
|
||||
type MonitoredResourceDescription struct {
|
||||
mrLabels map[string]struct{}
|
||||
mrType string
|
||||
}
|
||||
|
||||
// Option is function type that is passed to the exporter initialization function.
|
||||
type Option func(*options)
|
||||
|
||||
// options is the struct to hold options for metricExporter and its client instance.
|
||||
type options struct {
|
||||
// context allows you to provide a custom context for API calls.
|
||||
//
|
||||
// This context will be used several times: first, to create Cloud Monitoring
|
||||
// clients, and then every time a new batch of metrics needs to be uploaded.
|
||||
//
|
||||
// If unset, context.Background() will be used.
|
||||
context context.Context
|
||||
// metricDescriptorTypeFormatter is the custom formtter for the MetricDescriptor.Type.
|
||||
// By default, the format string is "workload.googleapis.com/[metric name]".
|
||||
metricDescriptorTypeFormatter func(metricdata.Metrics) string
|
||||
// resourceAttributeFilter determinies which resource attributes to
|
||||
// add to metrics as metric labels. By default, it adds service.name,
|
||||
// service.namespace, and service.instance.id.
|
||||
resourceAttributeFilter attribute.Filter
|
||||
// monitoredResourceDescription sets whether to attempt mapping the OTel Resource to a specific
|
||||
// Google Cloud Monitored Resource. When provided, the exporter attempts to map only to the provided
|
||||
// monitored resource type.
|
||||
monitoredResourceDescription MonitoredResourceDescription
|
||||
// projectID is the identifier of the Cloud Monitoring
|
||||
// project the user is uploading the stats data to.
|
||||
// If not set, this will default to your "Application Default Credentials".
|
||||
// For details see: https://developers.google.com/accounts/docs/application-default-credentials.
|
||||
//
|
||||
// It will be used in the project_id label of a Google Cloud Monitoring monitored
|
||||
// resource if the resource does not inherently belong to a specific
|
||||
// project, e.g. on-premise resource like k8s_container or generic_task.
|
||||
projectID string
|
||||
// compression enables gzip compression on gRPC calls.
|
||||
compression string
|
||||
// monitoringClientOptions are additional options to be passed
|
||||
// to the underlying Stackdriver Monitoring API client.
|
||||
// Optional.
|
||||
monitoringClientOptions []apioption.ClientOption
|
||||
// destinationProjectQuota sets whether the request should use quota from
|
||||
// the destination project for the request.
|
||||
destinationProjectQuota bool
|
||||
|
||||
// disableCreateMetricDescriptors disables automatic MetricDescriptor creation
|
||||
disableCreateMetricDescriptors bool
|
||||
|
||||
// enableSumOfSquaredDeviation enables calculation of an estimated sum of squared
|
||||
// deviation. It isn't correct, so we don't send it by default.
|
||||
enableSumOfSquaredDeviation bool
|
||||
|
||||
// createServiceTimeSeries sets whether to create timeseries using `CreateServiceTimeSeries`.
|
||||
// Implicitly, this sets `disableCreateMetricDescriptors` to true.
|
||||
createServiceTimeSeries bool
|
||||
}
|
||||
|
||||
// WithProjectID sets Google Cloud Platform project as projectID.
|
||||
// Without using this option, it automatically detects the project ID
|
||||
// from the default credential detection process.
|
||||
// Please find the detailed order of the default credentail detection proecess on the doc:
|
||||
// https://godoc.org/golang.org/x/oauth2/google#FindDefaultCredentials
|
||||
func WithProjectID(id string) func(o *options) {
|
||||
return func(o *options) {
|
||||
o.projectID = id
|
||||
}
|
||||
}
|
||||
|
||||
// WithDestinationProjectQuota enables per-request usage of the destination
|
||||
// project's quota. For example, when setting gcp.project.id on a metric.
|
||||
func WithDestinationProjectQuota() func(o *options) {
|
||||
return func(o *options) {
|
||||
o.destinationProjectQuota = true
|
||||
}
|
||||
}
|
||||
|
||||
// WithMonitoringClientOptions add the options for Cloud Monitoring client instance.
|
||||
// Available options are defined in.
|
||||
func WithMonitoringClientOptions(opts ...apioption.ClientOption) func(o *options) {
|
||||
return func(o *options) {
|
||||
o.monitoringClientOptions = append(o.monitoringClientOptions, opts...)
|
||||
}
|
||||
}
|
||||
|
||||
// WithMetricDescriptorTypeFormatter sets the custom formatter for MetricDescriptor.
|
||||
// Note that the format has to follow the convention defined in the official document.
|
||||
// The default is "workload.googleapis.com/[metric name]".
|
||||
// ref. https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom_metric_names
|
||||
func WithMetricDescriptorTypeFormatter(f func(metricdata.Metrics) string) func(o *options) {
|
||||
return func(o *options) {
|
||||
o.metricDescriptorTypeFormatter = f
|
||||
}
|
||||
}
|
||||
|
||||
// WithFilteredResourceAttributes determinies which resource attributes to
|
||||
// add to metrics as metric labels. By default, it adds service.name,
|
||||
// service.namespace, and service.instance.id. This is recommended to avoid
|
||||
// writing duplicate timeseries against the same monitored resource. Use
|
||||
// WithFilteredResourceAttributes(NoAttributes()) to disable the addition of
|
||||
// resource attributes to metric labels.
|
||||
func WithFilteredResourceAttributes(filter attribute.Filter) func(o *options) {
|
||||
return func(o *options) {
|
||||
o.resourceAttributeFilter = filter
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultResourceAttributesFilter is the default filter applied to resource
|
||||
// attributes.
|
||||
func DefaultResourceAttributesFilter(kv attribute.KeyValue) bool {
|
||||
return (kv.Key == semconv.ServiceNameKey ||
|
||||
kv.Key == semconv.ServiceNamespaceKey ||
|
||||
kv.Key == semconv.ServiceInstanceIDKey) && len(kv.Value.AsString()) > 0
|
||||
}
|
||||
|
||||
// NoAttributes can be passed to WithFilteredResourceAttributes to disable
|
||||
// adding resource attributes as metric labels.
|
||||
func NoAttributes(attribute.KeyValue) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// WithDisableCreateMetricDescriptors will disable the automatic creation of
|
||||
// MetricDescriptors when an unknown metric is set to be exported.
|
||||
func WithDisableCreateMetricDescriptors() func(o *options) {
|
||||
return func(o *options) {
|
||||
o.disableCreateMetricDescriptors = true
|
||||
}
|
||||
}
|
||||
|
||||
// WithCompression sets the compression to use for gRPC requests.
|
||||
func WithCompression(c string) func(o *options) {
|
||||
return func(o *options) {
|
||||
o.compression = c
|
||||
}
|
||||
}
|
||||
|
||||
// WithSumOfSquaredDeviation sets the SumOfSquaredDeviation field on histograms.
|
||||
// It is an estimate, and is not the actual sum of squared deviations.
|
||||
func WithSumOfSquaredDeviation() func(o *options) {
|
||||
return func(o *options) {
|
||||
o.enableSumOfSquaredDeviation = true
|
||||
}
|
||||
}
|
||||
|
||||
// WithCreateServiceTimeSeries configures the exporter to use `CreateServiceTimeSeries` for creating timeseries.
|
||||
// If this is used, metric descriptors are not exported.
|
||||
func WithCreateServiceTimeSeries() func(o *options) {
|
||||
return func(o *options) {
|
||||
o.createServiceTimeSeries = true
|
||||
o.disableCreateMetricDescriptors = true
|
||||
}
|
||||
}
|
||||
|
||||
// WithMonitoredResourceDescription configures the exporter to attempt to map the OpenTelemetry Resource to the provided
|
||||
// Google MonitoredResource. The provided mrLabels would be searched for in the OpenTelemetry Resource Attributes and if
|
||||
// found, would be included in the MonitoredResource labels.
|
||||
func WithMonitoredResourceDescription(mrType string, mrLabels []string) func(o *options) {
|
||||
return func(o *options) {
|
||||
mrLabelSet := make(map[string]struct{})
|
||||
for _, label := range mrLabels {
|
||||
mrLabelSet[label] = struct{}{}
|
||||
}
|
||||
o.monitoredResourceDescription = MonitoredResourceDescription{
|
||||
mrType: mrType,
|
||||
mrLabels: mrLabelSet,
|
||||
}
|
||||
}
|
||||
}
|
||||
21
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go
generated
vendored
Normal file
21
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package metric
|
||||
|
||||
// Version is the current release version of the OpenTelemetry
|
||||
// Operations Metric Exporter in use.
|
||||
func Version() string {
|
||||
return "0.48.1"
|
||||
}
|
||||
202
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/LICENSE
generated
vendored
Normal file
202
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
286
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/resourcemapping.go
generated
vendored
Normal file
286
vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/resourcemapping.go
generated
vendored
Normal file
|
|
@ -0,0 +1,286 @@
|
|||
// Copyright 2022 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package resourcemapping
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.24.0"
|
||||
monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres"
|
||||
)
|
||||
|
||||
const (
|
||||
ProjectIDAttributeKey = "gcp.project.id"
|
||||
|
||||
awsAccount = "aws_account"
|
||||
awsEc2Instance = "aws_ec2_instance"
|
||||
clusterName = "cluster_name"
|
||||
containerName = "container_name"
|
||||
gceInstance = "gce_instance"
|
||||
genericNode = "generic_node"
|
||||
genericTask = "generic_task"
|
||||
instanceID = "instance_id"
|
||||
job = "job"
|
||||
k8sCluster = "k8s_cluster"
|
||||
k8sContainer = "k8s_container"
|
||||
k8sNode = "k8s_node"
|
||||
k8sPod = "k8s_pod"
|
||||
location = "location"
|
||||
namespace = "namespace"
|
||||
namespaceName = "namespace_name"
|
||||
nodeID = "node_id"
|
||||
nodeName = "node_name"
|
||||
podName = "pod_name"
|
||||
region = "region"
|
||||
taskID = "task_id"
|
||||
zone = "zone"
|
||||
gaeInstance = "gae_instance"
|
||||
gaeApp = "gae_app"
|
||||
gaeModuleID = "module_id"
|
||||
gaeVersionID = "version_id"
|
||||
cloudRunRevision = "cloud_run_revision"
|
||||
cloudFunction = "cloud_function"
|
||||
cloudFunctionName = "function_name"
|
||||
serviceName = "service_name"
|
||||
configurationName = "configuration_name"
|
||||
revisionName = "revision_name"
|
||||
bmsInstance = "baremetalsolution.googleapis.com/Instance"
|
||||
unknownServicePrefix = "unknown_service"
|
||||
)
|
||||
|
||||
var (
|
||||
// monitoredResourceMappings contains mappings of GCM resource label keys onto mapping config from OTel
|
||||
// resource for a given monitored resource type.
|
||||
monitoredResourceMappings = map[string]map[string]struct {
|
||||
// If none of the otelKeys are present in the Resource, fallback to this literal value
|
||||
fallbackLiteral string
|
||||
// OTel resource keys to try and populate the resource label from. For entries with
|
||||
// multiple OTel resource keys, the keys' values will be coalesced in order until there
|
||||
// is a non-empty value.
|
||||
otelKeys []string
|
||||
}{
|
||||
gceInstance: {
|
||||
zone: {otelKeys: []string{string(semconv.CloudAvailabilityZoneKey)}},
|
||||
instanceID: {otelKeys: []string{string(semconv.HostIDKey)}},
|
||||
},
|
||||
k8sContainer: {
|
||||
location: {otelKeys: []string{
|
||||
string(semconv.CloudAvailabilityZoneKey),
|
||||
string(semconv.CloudRegionKey),
|
||||
}},
|
||||
clusterName: {otelKeys: []string{string(semconv.K8SClusterNameKey)}},
|
||||
namespaceName: {otelKeys: []string{string(semconv.K8SNamespaceNameKey)}},
|
||||
podName: {otelKeys: []string{string(semconv.K8SPodNameKey)}},
|
||||
containerName: {otelKeys: []string{string(semconv.K8SContainerNameKey)}},
|
||||
},
|
||||
k8sPod: {
|
||||
location: {otelKeys: []string{
|
||||
string(semconv.CloudAvailabilityZoneKey),
|
||||
string(semconv.CloudRegionKey),
|
||||
}},
|
||||
clusterName: {otelKeys: []string{string(semconv.K8SClusterNameKey)}},
|
||||
namespaceName: {otelKeys: []string{string(semconv.K8SNamespaceNameKey)}},
|
||||
podName: {otelKeys: []string{string(semconv.K8SPodNameKey)}},
|
||||
},
|
||||
k8sNode: {
|
||||
location: {otelKeys: []string{
|
||||
string(semconv.CloudAvailabilityZoneKey),
|
||||
string(semconv.CloudRegionKey),
|
||||
}},
|
||||
clusterName: {otelKeys: []string{string(semconv.K8SClusterNameKey)}},
|
||||
nodeName: {otelKeys: []string{string(semconv.K8SNodeNameKey)}},
|
||||
},
|
||||
k8sCluster: {
|
||||
location: {otelKeys: []string{
|
||||
string(semconv.CloudAvailabilityZoneKey),
|
||||
string(semconv.CloudRegionKey),
|
||||
}},
|
||||
clusterName: {otelKeys: []string{string(semconv.K8SClusterNameKey)}},
|
||||
},
|
||||
gaeInstance: {
|
||||
location: {otelKeys: []string{
|
||||
string(semconv.CloudAvailabilityZoneKey),
|
||||
string(semconv.CloudRegionKey),
|
||||
}},
|
||||
gaeModuleID: {otelKeys: []string{string(semconv.FaaSNameKey)}},
|
||||
gaeVersionID: {otelKeys: []string{string(semconv.FaaSVersionKey)}},
|
||||
instanceID: {otelKeys: []string{string(semconv.FaaSInstanceKey)}},
|
||||
},
|
||||
gaeApp: {
|
||||
location: {otelKeys: []string{
|
||||
string(semconv.CloudAvailabilityZoneKey),
|
||||
string(semconv.CloudRegionKey),
|
||||
}},
|
||||
gaeModuleID: {otelKeys: []string{string(semconv.FaaSNameKey)}},
|
||||
gaeVersionID: {otelKeys: []string{string(semconv.FaaSVersionKey)}},
|
||||
},
|
||||
awsEc2Instance: {
|
||||
instanceID: {otelKeys: []string{string(semconv.HostIDKey)}},
|
||||
region: {
|
||||
otelKeys: []string{
|
||||
string(semconv.CloudAvailabilityZoneKey),
|
||||
string(semconv.CloudRegionKey),
|
||||
},
|
||||
},
|
||||
awsAccount: {otelKeys: []string{string(semconv.CloudAccountIDKey)}},
|
||||
},
|
||||
bmsInstance: {
|
||||
location: {otelKeys: []string{string(semconv.CloudRegionKey)}},
|
||||
instanceID: {otelKeys: []string{string(semconv.HostIDKey)}},
|
||||
},
|
||||
genericTask: {
|
||||
location: {
|
||||
otelKeys: []string{
|
||||
string(semconv.CloudAvailabilityZoneKey),
|
||||
string(semconv.CloudRegionKey),
|
||||
},
|
||||
fallbackLiteral: "global",
|
||||
},
|
||||
namespace: {otelKeys: []string{string(semconv.ServiceNamespaceKey)}},
|
||||
job: {otelKeys: []string{string(semconv.ServiceNameKey), string(semconv.FaaSNameKey)}},
|
||||
taskID: {otelKeys: []string{string(semconv.ServiceInstanceIDKey), string(semconv.FaaSInstanceKey)}},
|
||||
},
|
||||
genericNode: {
|
||||
location: {
|
||||
otelKeys: []string{
|
||||
string(semconv.CloudAvailabilityZoneKey),
|
||||
string(semconv.CloudRegionKey),
|
||||
},
|
||||
fallbackLiteral: "global",
|
||||
},
|
||||
namespace: {otelKeys: []string{string(semconv.ServiceNamespaceKey)}},
|
||||
nodeID: {otelKeys: []string{string(semconv.HostIDKey), string(semconv.HostNameKey)}},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
// ReadOnlyAttributes is an interface to abstract between pulling attributes from PData library or OTEL SDK.
|
||||
type ReadOnlyAttributes interface {
|
||||
GetString(string) (string, bool)
|
||||
}
|
||||
|
||||
// ResourceAttributesToLoggingMonitoredResource converts from a set of OTEL resource attributes into a
|
||||
// GCP monitored resource type and label set for Cloud Logging.
|
||||
// E.g.
|
||||
// This may output `gce_instance` type with appropriate labels.
|
||||
func ResourceAttributesToLoggingMonitoredResource(attrs ReadOnlyAttributes) *monitoredrespb.MonitoredResource {
|
||||
cloudPlatform, _ := attrs.GetString(string(semconv.CloudPlatformKey))
|
||||
switch cloudPlatform {
|
||||
case semconv.CloudPlatformGCPAppEngine.Value.AsString():
|
||||
return createMonitoredResource(gaeApp, attrs)
|
||||
default:
|
||||
return commonResourceAttributesToMonitoredResource(cloudPlatform, attrs)
|
||||
}
|
||||
}
|
||||
|
||||
// ResourceAttributesToMonitoringMonitoredResource converts from a set of OTEL resource attributes into a
|
||||
// GCP monitored resource type and label set for Cloud Monitoring
|
||||
// E.g.
|
||||
// This may output `gce_instance` type with appropriate labels.
|
||||
func ResourceAttributesToMonitoringMonitoredResource(attrs ReadOnlyAttributes) *monitoredrespb.MonitoredResource {
|
||||
cloudPlatform, _ := attrs.GetString(string(semconv.CloudPlatformKey))
|
||||
switch cloudPlatform {
|
||||
case semconv.CloudPlatformGCPAppEngine.Value.AsString():
|
||||
return createMonitoredResource(gaeInstance, attrs)
|
||||
default:
|
||||
return commonResourceAttributesToMonitoredResource(cloudPlatform, attrs)
|
||||
}
|
||||
}
|
||||
|
||||
func commonResourceAttributesToMonitoredResource(cloudPlatform string, attrs ReadOnlyAttributes) *monitoredrespb.MonitoredResource {
|
||||
switch cloudPlatform {
|
||||
case semconv.CloudPlatformGCPComputeEngine.Value.AsString():
|
||||
return createMonitoredResource(gceInstance, attrs)
|
||||
case semconv.CloudPlatformAWSEC2.Value.AsString():
|
||||
return createMonitoredResource(awsEc2Instance, attrs)
|
||||
// TODO(alex-basinov): replace this string literal with semconv.CloudPlatformGCPBareMetalSolution
|
||||
// once https://github.com/open-telemetry/semantic-conventions/pull/64 makes its way
|
||||
// into the semconv module.
|
||||
case "gcp_bare_metal_solution":
|
||||
return createMonitoredResource(bmsInstance, attrs)
|
||||
default:
|
||||
// if k8s.cluster.name is set, pattern match for various k8s resources.
|
||||
// this will also match non-cloud k8s platforms like minikube.
|
||||
if _, ok := attrs.GetString(string(semconv.K8SClusterNameKey)); ok {
|
||||
// Try for most to least specific k8s_container, k8s_pod, etc
|
||||
if _, ok := attrs.GetString(string(semconv.K8SContainerNameKey)); ok {
|
||||
return createMonitoredResource(k8sContainer, attrs)
|
||||
} else if _, ok := attrs.GetString(string(semconv.K8SPodNameKey)); ok {
|
||||
return createMonitoredResource(k8sPod, attrs)
|
||||
} else if _, ok := attrs.GetString(string(semconv.K8SNodeNameKey)); ok {
|
||||
return createMonitoredResource(k8sNode, attrs)
|
||||
} else {
|
||||
return createMonitoredResource(k8sCluster, attrs)
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to generic_task
|
||||
_, hasServiceName := attrs.GetString(string(semconv.ServiceNameKey))
|
||||
_, hasFaaSName := attrs.GetString(string(semconv.FaaSNameKey))
|
||||
_, hasServiceInstanceID := attrs.GetString(string(semconv.ServiceInstanceIDKey))
|
||||
_, hasFaaSInstance := attrs.GetString(string(semconv.FaaSInstanceKey))
|
||||
if (hasServiceName && hasServiceInstanceID) || (hasFaaSInstance && hasFaaSName) {
|
||||
return createMonitoredResource(genericTask, attrs)
|
||||
}
|
||||
|
||||
// Everything else fallback to generic_node
|
||||
return createMonitoredResource(genericNode, attrs)
|
||||
}
|
||||
}
|
||||
|
||||
func createMonitoredResource(
|
||||
monitoredResourceType string,
|
||||
resourceAttrs ReadOnlyAttributes,
|
||||
) *monitoredrespb.MonitoredResource {
|
||||
mappings := monitoredResourceMappings[monitoredResourceType]
|
||||
mrLabels := make(map[string]string, len(mappings))
|
||||
|
||||
for mrKey, mappingConfig := range mappings {
|
||||
mrValue := ""
|
||||
ok := false
|
||||
// Coalesce the possible keys in order
|
||||
for _, otelKey := range mappingConfig.otelKeys {
|
||||
mrValue, ok = resourceAttrs.GetString(otelKey)
|
||||
if mrValue != "" && !strings.HasPrefix(mrValue, unknownServicePrefix) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if mrValue == "" && contains(mappingConfig.otelKeys, string(semconv.ServiceNameKey)) {
|
||||
// the service name started with unknown_service, and was ignored above
|
||||
mrValue, ok = resourceAttrs.GetString(string(semconv.ServiceNameKey))
|
||||
}
|
||||
if !ok || mrValue == "" {
|
||||
mrValue = mappingConfig.fallbackLiteral
|
||||
}
|
||||
mrLabels[mrKey] = sanitizeUTF8(mrValue)
|
||||
}
|
||||
return &monitoredrespb.MonitoredResource{
|
||||
Type: monitoredResourceType,
|
||||
Labels: mrLabels,
|
||||
}
|
||||
}
|
||||
|
||||
func contains(list []string, element string) bool {
|
||||
for _, item := range list {
|
||||
if item == element {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func sanitizeUTF8(s string) string {
|
||||
return strings.ToValidUTF8(s, "<22>")
|
||||
}
|
||||
1
vendor/github.com/census-instrumentation/opencensus-proto/AUTHORS
generated
vendored
Normal file
1
vendor/github.com/census-instrumentation/opencensus-proto/AUTHORS
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
Google Inc.
|
||||
202
vendor/github.com/census-instrumentation/opencensus-proto/LICENSE
generated
vendored
Normal file
202
vendor/github.com/census-instrumentation/opencensus-proto/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
189
vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1/resource.pb.go
generated
vendored
Normal file
189
vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1/resource.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
// Copyright 2018, OpenCensus Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.17.3
|
||||
// source: opencensus/proto/resource/v1/resource.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Resource information.
|
||||
type Resource struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Type identifier for the resource.
|
||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
||||
// Set of labels that describe the resource.
|
||||
Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
}
|
||||
|
||||
func (x *Resource) Reset() {
|
||||
*x = Resource{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_opencensus_proto_resource_v1_resource_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Resource) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Resource) ProtoMessage() {}
|
||||
|
||||
func (x *Resource) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_opencensus_proto_resource_v1_resource_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Resource.ProtoReflect.Descriptor instead.
|
||||
func (*Resource) Descriptor() ([]byte, []int) {
|
||||
return file_opencensus_proto_resource_v1_resource_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Resource) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Resource) GetLabels() map[string]string {
|
||||
if x != nil {
|
||||
return x.Labels
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_opencensus_proto_resource_v1_resource_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_opencensus_proto_resource_v1_resource_proto_rawDesc = []byte{
|
||||
0x0a, 0x2b, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72,
|
||||
0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x6f,
|
||||
0x70, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
|
||||
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x22, 0xa5, 0x01, 0x0a, 0x08,
|
||||
0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4a, 0x0a, 0x06,
|
||||
0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6f,
|
||||
0x70, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
|
||||
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f,
|
||||
0x75, 0x72, 0x63, 0x65, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65,
|
||||
0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
||||
0x02, 0x38, 0x01, 0x42, 0x9b, 0x01, 0x0a, 0x1f, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63,
|
||||
0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f,
|
||||
0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x69, 0x6e, 0x73, 0x74,
|
||||
0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x65, 0x6e,
|
||||
0x63, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e,
|
||||
0x2d, 0x67, 0x6f, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x31, 0xea,
|
||||
0x02, 0x1f, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x3a, 0x3a, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x3a, 0x56,
|
||||
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_opencensus_proto_resource_v1_resource_proto_rawDescOnce sync.Once
|
||||
file_opencensus_proto_resource_v1_resource_proto_rawDescData = file_opencensus_proto_resource_v1_resource_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_opencensus_proto_resource_v1_resource_proto_rawDescGZIP() []byte {
|
||||
file_opencensus_proto_resource_v1_resource_proto_rawDescOnce.Do(func() {
|
||||
file_opencensus_proto_resource_v1_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_opencensus_proto_resource_v1_resource_proto_rawDescData)
|
||||
})
|
||||
return file_opencensus_proto_resource_v1_resource_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_opencensus_proto_resource_v1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_opencensus_proto_resource_v1_resource_proto_goTypes = []interface{}{
|
||||
(*Resource)(nil), // 0: opencensus.proto.resource.v1.Resource
|
||||
nil, // 1: opencensus.proto.resource.v1.Resource.LabelsEntry
|
||||
}
|
||||
var file_opencensus_proto_resource_v1_resource_proto_depIdxs = []int32{
|
||||
1, // 0: opencensus.proto.resource.v1.Resource.labels:type_name -> opencensus.proto.resource.v1.Resource.LabelsEntry
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_opencensus_proto_resource_v1_resource_proto_init() }
|
||||
func file_opencensus_proto_resource_v1_resource_proto_init() {
|
||||
if File_opencensus_proto_resource_v1_resource_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_opencensus_proto_resource_v1_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Resource); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_opencensus_proto_resource_v1_resource_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_opencensus_proto_resource_v1_resource_proto_goTypes,
|
||||
DependencyIndexes: file_opencensus_proto_resource_v1_resource_proto_depIdxs,
|
||||
MessageInfos: file_opencensus_proto_resource_v1_resource_proto_msgTypes,
|
||||
}.Build()
|
||||
File_opencensus_proto_resource_v1_resource_proto = out.File
|
||||
file_opencensus_proto_resource_v1_resource_proto_rawDesc = nil
|
||||
file_opencensus_proto_resource_v1_resource_proto_goTypes = nil
|
||||
file_opencensus_proto_resource_v1_resource_proto_depIdxs = nil
|
||||
}
|
||||
2235
vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace.pb.go
generated
vendored
Normal file
2235
vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
555
vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace_config.pb.go
generated
vendored
Normal file
555
vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace_config.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,555 @@
|
|||
// Copyright 2018, OpenCensus Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.17.3
|
||||
// source: opencensus/proto/trace/v1/trace_config.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// How spans should be sampled:
|
||||
// - Always off
|
||||
// - Always on
|
||||
// - Always follow the parent Span's decision (off if no parent).
|
||||
type ConstantSampler_ConstantDecision int32
|
||||
|
||||
const (
|
||||
ConstantSampler_ALWAYS_OFF ConstantSampler_ConstantDecision = 0
|
||||
ConstantSampler_ALWAYS_ON ConstantSampler_ConstantDecision = 1
|
||||
ConstantSampler_ALWAYS_PARENT ConstantSampler_ConstantDecision = 2
|
||||
)
|
||||
|
||||
// Enum value maps for ConstantSampler_ConstantDecision.
|
||||
var (
|
||||
ConstantSampler_ConstantDecision_name = map[int32]string{
|
||||
0: "ALWAYS_OFF",
|
||||
1: "ALWAYS_ON",
|
||||
2: "ALWAYS_PARENT",
|
||||
}
|
||||
ConstantSampler_ConstantDecision_value = map[string]int32{
|
||||
"ALWAYS_OFF": 0,
|
||||
"ALWAYS_ON": 1,
|
||||
"ALWAYS_PARENT": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ConstantSampler_ConstantDecision) Enum() *ConstantSampler_ConstantDecision {
|
||||
p := new(ConstantSampler_ConstantDecision)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ConstantSampler_ConstantDecision) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ConstantSampler_ConstantDecision) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_opencensus_proto_trace_v1_trace_config_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (ConstantSampler_ConstantDecision) Type() protoreflect.EnumType {
|
||||
return &file_opencensus_proto_trace_v1_trace_config_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x ConstantSampler_ConstantDecision) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ConstantSampler_ConstantDecision.Descriptor instead.
|
||||
func (ConstantSampler_ConstantDecision) EnumDescriptor() ([]byte, []int) {
|
||||
return file_opencensus_proto_trace_v1_trace_config_proto_rawDescGZIP(), []int{2, 0}
|
||||
}
|
||||
|
||||
// Global configuration of the trace service. All fields must be specified, or
|
||||
// the default (zero) values will be used for each type.
|
||||
type TraceConfig struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The global default sampler used to make decisions on span sampling.
|
||||
//
|
||||
// Types that are assignable to Sampler:
|
||||
// *TraceConfig_ProbabilitySampler
|
||||
// *TraceConfig_ConstantSampler
|
||||
// *TraceConfig_RateLimitingSampler
|
||||
Sampler isTraceConfig_Sampler `protobuf_oneof:"sampler"`
|
||||
// The global default max number of attributes per span.
|
||||
MaxNumberOfAttributes int64 `protobuf:"varint,4,opt,name=max_number_of_attributes,json=maxNumberOfAttributes,proto3" json:"max_number_of_attributes,omitempty"`
|
||||
// The global default max number of annotation events per span.
|
||||
MaxNumberOfAnnotations int64 `protobuf:"varint,5,opt,name=max_number_of_annotations,json=maxNumberOfAnnotations,proto3" json:"max_number_of_annotations,omitempty"`
|
||||
// The global default max number of message events per span.
|
||||
MaxNumberOfMessageEvents int64 `protobuf:"varint,6,opt,name=max_number_of_message_events,json=maxNumberOfMessageEvents,proto3" json:"max_number_of_message_events,omitempty"`
|
||||
// The global default max number of link entries per span.
|
||||
MaxNumberOfLinks int64 `protobuf:"varint,7,opt,name=max_number_of_links,json=maxNumberOfLinks,proto3" json:"max_number_of_links,omitempty"`
|
||||
}
|
||||
|
||||
func (x *TraceConfig) Reset() {
|
||||
*x = TraceConfig{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TraceConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TraceConfig) ProtoMessage() {}
|
||||
|
||||
func (x *TraceConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TraceConfig.ProtoReflect.Descriptor instead.
|
||||
func (*TraceConfig) Descriptor() ([]byte, []int) {
|
||||
return file_opencensus_proto_trace_v1_trace_config_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (m *TraceConfig) GetSampler() isTraceConfig_Sampler {
|
||||
if m != nil {
|
||||
return m.Sampler
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TraceConfig) GetProbabilitySampler() *ProbabilitySampler {
|
||||
if x, ok := x.GetSampler().(*TraceConfig_ProbabilitySampler); ok {
|
||||
return x.ProbabilitySampler
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TraceConfig) GetConstantSampler() *ConstantSampler {
|
||||
if x, ok := x.GetSampler().(*TraceConfig_ConstantSampler); ok {
|
||||
return x.ConstantSampler
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TraceConfig) GetRateLimitingSampler() *RateLimitingSampler {
|
||||
if x, ok := x.GetSampler().(*TraceConfig_RateLimitingSampler); ok {
|
||||
return x.RateLimitingSampler
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TraceConfig) GetMaxNumberOfAttributes() int64 {
|
||||
if x != nil {
|
||||
return x.MaxNumberOfAttributes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TraceConfig) GetMaxNumberOfAnnotations() int64 {
|
||||
if x != nil {
|
||||
return x.MaxNumberOfAnnotations
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TraceConfig) GetMaxNumberOfMessageEvents() int64 {
|
||||
if x != nil {
|
||||
return x.MaxNumberOfMessageEvents
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TraceConfig) GetMaxNumberOfLinks() int64 {
|
||||
if x != nil {
|
||||
return x.MaxNumberOfLinks
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type isTraceConfig_Sampler interface {
|
||||
isTraceConfig_Sampler()
|
||||
}
|
||||
|
||||
type TraceConfig_ProbabilitySampler struct {
|
||||
ProbabilitySampler *ProbabilitySampler `protobuf:"bytes,1,opt,name=probability_sampler,json=probabilitySampler,proto3,oneof"`
|
||||
}
|
||||
|
||||
type TraceConfig_ConstantSampler struct {
|
||||
ConstantSampler *ConstantSampler `protobuf:"bytes,2,opt,name=constant_sampler,json=constantSampler,proto3,oneof"`
|
||||
}
|
||||
|
||||
type TraceConfig_RateLimitingSampler struct {
|
||||
RateLimitingSampler *RateLimitingSampler `protobuf:"bytes,3,opt,name=rate_limiting_sampler,json=rateLimitingSampler,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*TraceConfig_ProbabilitySampler) isTraceConfig_Sampler() {}
|
||||
|
||||
func (*TraceConfig_ConstantSampler) isTraceConfig_Sampler() {}
|
||||
|
||||
func (*TraceConfig_RateLimitingSampler) isTraceConfig_Sampler() {}
|
||||
|
||||
// Sampler that tries to uniformly sample traces with a given probability.
|
||||
// The probability of sampling a trace is equal to that of the specified probability.
|
||||
type ProbabilitySampler struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The desired probability of sampling. Must be within [0.0, 1.0].
|
||||
SamplingProbability float64 `protobuf:"fixed64,1,opt,name=samplingProbability,proto3" json:"samplingProbability,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ProbabilitySampler) Reset() {
|
||||
*x = ProbabilitySampler{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ProbabilitySampler) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ProbabilitySampler) ProtoMessage() {}
|
||||
|
||||
func (x *ProbabilitySampler) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ProbabilitySampler.ProtoReflect.Descriptor instead.
|
||||
func (*ProbabilitySampler) Descriptor() ([]byte, []int) {
|
||||
return file_opencensus_proto_trace_v1_trace_config_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ProbabilitySampler) GetSamplingProbability() float64 {
|
||||
if x != nil {
|
||||
return x.SamplingProbability
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Sampler that always makes a constant decision on span sampling.
|
||||
type ConstantSampler struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Decision ConstantSampler_ConstantDecision `protobuf:"varint,1,opt,name=decision,proto3,enum=opencensus.proto.trace.v1.ConstantSampler_ConstantDecision" json:"decision,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ConstantSampler) Reset() {
|
||||
*x = ConstantSampler{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ConstantSampler) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ConstantSampler) ProtoMessage() {}
|
||||
|
||||
func (x *ConstantSampler) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ConstantSampler.ProtoReflect.Descriptor instead.
|
||||
func (*ConstantSampler) Descriptor() ([]byte, []int) {
|
||||
return file_opencensus_proto_trace_v1_trace_config_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ConstantSampler) GetDecision() ConstantSampler_ConstantDecision {
|
||||
if x != nil {
|
||||
return x.Decision
|
||||
}
|
||||
return ConstantSampler_ALWAYS_OFF
|
||||
}
|
||||
|
||||
// Sampler that tries to sample with a rate per time window.
|
||||
type RateLimitingSampler struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Rate per second.
|
||||
Qps int64 `protobuf:"varint,1,opt,name=qps,proto3" json:"qps,omitempty"`
|
||||
}
|
||||
|
||||
func (x *RateLimitingSampler) Reset() {
|
||||
*x = RateLimitingSampler{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RateLimitingSampler) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RateLimitingSampler) ProtoMessage() {}
|
||||
|
||||
func (x *RateLimitingSampler) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RateLimitingSampler.ProtoReflect.Descriptor instead.
|
||||
func (*RateLimitingSampler) Descriptor() ([]byte, []int) {
|
||||
return file_opencensus_proto_trace_v1_trace_config_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *RateLimitingSampler) GetQps() int64 {
|
||||
if x != nil {
|
||||
return x.Qps
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_opencensus_proto_trace_v1_trace_config_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_opencensus_proto_trace_v1_trace_config_proto_rawDesc = []byte{
|
||||
0x0a, 0x2c, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x63,
|
||||
0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19,
|
||||
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x9c, 0x04, 0x0a, 0x0b, 0x54, 0x72,
|
||||
0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x60, 0x0a, 0x13, 0x70, 0x72, 0x6f,
|
||||
0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x65, 0x6e,
|
||||
0x73, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e,
|
||||
0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x61,
|
||||
0x6d, 0x70, 0x6c, 0x65, 0x72, 0x48, 0x00, 0x52, 0x12, 0x70, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69,
|
||||
0x6c, 0x69, 0x74, 0x79, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x12, 0x57, 0x0a, 0x10, 0x63,
|
||||
0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x73,
|
||||
0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76,
|
||||
0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65,
|
||||
0x72, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x53, 0x61, 0x6d,
|
||||
0x70, 0x6c, 0x65, 0x72, 0x12, 0x64, 0x0a, 0x15, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d,
|
||||
0x69, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x73, 0x75, 0x73,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x61, 0x6d, 0x70,
|
||||
0x6c, 0x65, 0x72, 0x48, 0x00, 0x52, 0x13, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74,
|
||||
0x69, 0x6e, 0x67, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x18, 0x6d, 0x61,
|
||||
0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x61, 0x74, 0x74, 0x72,
|
||||
0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x6d, 0x61,
|
||||
0x78, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
|
||||
0x74, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65,
|
||||
0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x6d, 0x61, 0x78, 0x4e, 0x75, 0x6d, 0x62, 0x65,
|
||||
0x72, 0x4f, 0x66, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3e,
|
||||
0x0a, 0x1c, 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f,
|
||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x18, 0x6d, 0x61, 0x78, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f,
|
||||
0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2d,
|
||||
0x0a, 0x13, 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f,
|
||||
0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6d, 0x61, 0x78,
|
||||
0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x42, 0x09, 0x0a,
|
||||
0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x22, 0x46, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x62,
|
||||
0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x12, 0x30,
|
||||
0x0a, 0x13, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x62, 0x61, 0x62,
|
||||
0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x13, 0x73, 0x61, 0x6d,
|
||||
0x70, 0x6c, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
|
||||
0x22, 0xb0, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x53, 0x61, 0x6d,
|
||||
0x70, 0x6c, 0x65, 0x72, 0x12, 0x57, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x65, 0x6e,
|
||||
0x73, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e,
|
||||
0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x53, 0x61, 0x6d, 0x70, 0x6c,
|
||||
0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x44, 0x65, 0x63, 0x69, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x44, 0x0a,
|
||||
0x10, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x4c, 0x57, 0x41, 0x59, 0x53, 0x5f, 0x4f, 0x46, 0x46, 0x10,
|
||||
0x00, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x4c, 0x57, 0x41, 0x59, 0x53, 0x5f, 0x4f, 0x4e, 0x10, 0x01,
|
||||
0x12, 0x11, 0x0a, 0x0d, 0x41, 0x4c, 0x57, 0x41, 0x59, 0x53, 0x5f, 0x50, 0x41, 0x52, 0x45, 0x4e,
|
||||
0x54, 0x10, 0x02, 0x22, 0x27, 0x0a, 0x13, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74,
|
||||
0x69, 0x6e, 0x67, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x71, 0x70,
|
||||
0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x71, 0x70, 0x73, 0x42, 0x95, 0x01, 0x0a,
|
||||
0x1c, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x54,
|
||||
0x72, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
|
||||
0x01, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65,
|
||||
0x6e, 0x73, 0x75, 0x73, 0x2d, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x72, 0x61,
|
||||
0x63, 0x65, 0x2f, 0x76, 0x31, 0xea, 0x02, 0x1c, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x65, 0x6e, 0x73,
|
||||
0x75, 0x73, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x3a, 0x54, 0x72, 0x61, 0x63, 0x65,
|
||||
0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_rawDescOnce sync.Once
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_rawDescData = file_opencensus_proto_trace_v1_trace_config_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_opencensus_proto_trace_v1_trace_config_proto_rawDescGZIP() []byte {
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_rawDescOnce.Do(func() {
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_opencensus_proto_trace_v1_trace_config_proto_rawDescData)
|
||||
})
|
||||
return file_opencensus_proto_trace_v1_trace_config_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_opencensus_proto_trace_v1_trace_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_opencensus_proto_trace_v1_trace_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_opencensus_proto_trace_v1_trace_config_proto_goTypes = []interface{}{
|
||||
(ConstantSampler_ConstantDecision)(0), // 0: opencensus.proto.trace.v1.ConstantSampler.ConstantDecision
|
||||
(*TraceConfig)(nil), // 1: opencensus.proto.trace.v1.TraceConfig
|
||||
(*ProbabilitySampler)(nil), // 2: opencensus.proto.trace.v1.ProbabilitySampler
|
||||
(*ConstantSampler)(nil), // 3: opencensus.proto.trace.v1.ConstantSampler
|
||||
(*RateLimitingSampler)(nil), // 4: opencensus.proto.trace.v1.RateLimitingSampler
|
||||
}
|
||||
var file_opencensus_proto_trace_v1_trace_config_proto_depIdxs = []int32{
|
||||
2, // 0: opencensus.proto.trace.v1.TraceConfig.probability_sampler:type_name -> opencensus.proto.trace.v1.ProbabilitySampler
|
||||
3, // 1: opencensus.proto.trace.v1.TraceConfig.constant_sampler:type_name -> opencensus.proto.trace.v1.ConstantSampler
|
||||
4, // 2: opencensus.proto.trace.v1.TraceConfig.rate_limiting_sampler:type_name -> opencensus.proto.trace.v1.RateLimitingSampler
|
||||
0, // 3: opencensus.proto.trace.v1.ConstantSampler.decision:type_name -> opencensus.proto.trace.v1.ConstantSampler.ConstantDecision
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_opencensus_proto_trace_v1_trace_config_proto_init() }
|
||||
func file_opencensus_proto_trace_v1_trace_config_proto_init() {
|
||||
if File_opencensus_proto_trace_v1_trace_config_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TraceConfig); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProbabilitySampler); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ConstantSampler); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RateLimitingSampler); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_msgTypes[0].OneofWrappers = []interface{}{
|
||||
(*TraceConfig_ProbabilitySampler)(nil),
|
||||
(*TraceConfig_ConstantSampler)(nil),
|
||||
(*TraceConfig_RateLimitingSampler)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_opencensus_proto_trace_v1_trace_config_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_opencensus_proto_trace_v1_trace_config_proto_goTypes,
|
||||
DependencyIndexes: file_opencensus_proto_trace_v1_trace_config_proto_depIdxs,
|
||||
EnumInfos: file_opencensus_proto_trace_v1_trace_config_proto_enumTypes,
|
||||
MessageInfos: file_opencensus_proto_trace_v1_trace_config_proto_msgTypes,
|
||||
}.Build()
|
||||
File_opencensus_proto_trace_v1_trace_config_proto = out.File
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_rawDesc = nil
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_goTypes = nil
|
||||
file_opencensus_proto_trace_v1_trace_config_proto_depIdxs = nil
|
||||
}
|
||||
201
vendor/github.com/cncf/xds/go/LICENSE
generated
vendored
Normal file
201
vendor/github.com/cncf/xds/go/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
411
vendor/github.com/cncf/xds/go/udpa/annotations/migrate.pb.go
generated
vendored
Normal file
411
vendor/github.com/cncf/xds/go/udpa/annotations/migrate.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,411 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: udpa/annotations/migrate.proto
|
||||
|
||||
package annotations
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type MigrateAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rename string `protobuf:"bytes,1,opt,name=rename,proto3" json:"rename,omitempty"`
|
||||
}
|
||||
|
||||
func (x *MigrateAnnotation) Reset() {
|
||||
*x = MigrateAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_udpa_annotations_migrate_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MigrateAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MigrateAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *MigrateAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_udpa_annotations_migrate_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MigrateAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*MigrateAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_udpa_annotations_migrate_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *MigrateAnnotation) GetRename() string {
|
||||
if x != nil {
|
||||
return x.Rename
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type FieldMigrateAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rename string `protobuf:"bytes,1,opt,name=rename,proto3" json:"rename,omitempty"`
|
||||
OneofPromotion string `protobuf:"bytes,2,opt,name=oneof_promotion,json=oneofPromotion,proto3" json:"oneof_promotion,omitempty"`
|
||||
}
|
||||
|
||||
func (x *FieldMigrateAnnotation) Reset() {
|
||||
*x = FieldMigrateAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_udpa_annotations_migrate_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *FieldMigrateAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*FieldMigrateAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *FieldMigrateAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_udpa_annotations_migrate_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use FieldMigrateAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*FieldMigrateAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_udpa_annotations_migrate_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *FieldMigrateAnnotation) GetRename() string {
|
||||
if x != nil {
|
||||
return x.Rename
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *FieldMigrateAnnotation) GetOneofPromotion() string {
|
||||
if x != nil {
|
||||
return x.OneofPromotion
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type FileMigrateAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
MoveToPackage string `protobuf:"bytes,2,opt,name=move_to_package,json=moveToPackage,proto3" json:"move_to_package,omitempty"`
|
||||
}
|
||||
|
||||
func (x *FileMigrateAnnotation) Reset() {
|
||||
*x = FileMigrateAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_udpa_annotations_migrate_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *FileMigrateAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*FileMigrateAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *FileMigrateAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_udpa_annotations_migrate_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use FileMigrateAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*FileMigrateAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_udpa_annotations_migrate_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *FileMigrateAnnotation) GetMoveToPackage() string {
|
||||
if x != nil {
|
||||
return x.MoveToPackage
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var file_udpa_annotations_migrate_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptorpb.MessageOptions)(nil),
|
||||
ExtensionType: (*MigrateAnnotation)(nil),
|
||||
Field: 171962766,
|
||||
Name: "udpa.annotations.message_migrate",
|
||||
Tag: "bytes,171962766,opt,name=message_migrate",
|
||||
Filename: "udpa/annotations/migrate.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtensionType: (*FieldMigrateAnnotation)(nil),
|
||||
Field: 171962766,
|
||||
Name: "udpa.annotations.field_migrate",
|
||||
Tag: "bytes,171962766,opt,name=field_migrate",
|
||||
Filename: "udpa/annotations/migrate.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.EnumOptions)(nil),
|
||||
ExtensionType: (*MigrateAnnotation)(nil),
|
||||
Field: 171962766,
|
||||
Name: "udpa.annotations.enum_migrate",
|
||||
Tag: "bytes,171962766,opt,name=enum_migrate",
|
||||
Filename: "udpa/annotations/migrate.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.EnumValueOptions)(nil),
|
||||
ExtensionType: (*MigrateAnnotation)(nil),
|
||||
Field: 171962766,
|
||||
Name: "udpa.annotations.enum_value_migrate",
|
||||
Tag: "bytes,171962766,opt,name=enum_value_migrate",
|
||||
Filename: "udpa/annotations/migrate.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FileOptions)(nil),
|
||||
ExtensionType: (*FileMigrateAnnotation)(nil),
|
||||
Field: 171962766,
|
||||
Name: "udpa.annotations.file_migrate",
|
||||
Tag: "bytes,171962766,opt,name=file_migrate",
|
||||
Filename: "udpa/annotations/migrate.proto",
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptorpb.MessageOptions.
|
||||
var (
|
||||
// optional udpa.annotations.MigrateAnnotation message_migrate = 171962766;
|
||||
E_MessageMigrate = &file_udpa_annotations_migrate_proto_extTypes[0]
|
||||
)
|
||||
|
||||
// Extension fields to descriptorpb.FieldOptions.
|
||||
var (
|
||||
// optional udpa.annotations.FieldMigrateAnnotation field_migrate = 171962766;
|
||||
E_FieldMigrate = &file_udpa_annotations_migrate_proto_extTypes[1]
|
||||
)
|
||||
|
||||
// Extension fields to descriptorpb.EnumOptions.
|
||||
var (
|
||||
// optional udpa.annotations.MigrateAnnotation enum_migrate = 171962766;
|
||||
E_EnumMigrate = &file_udpa_annotations_migrate_proto_extTypes[2]
|
||||
)
|
||||
|
||||
// Extension fields to descriptorpb.EnumValueOptions.
|
||||
var (
|
||||
// optional udpa.annotations.MigrateAnnotation enum_value_migrate = 171962766;
|
||||
E_EnumValueMigrate = &file_udpa_annotations_migrate_proto_extTypes[3]
|
||||
)
|
||||
|
||||
// Extension fields to descriptorpb.FileOptions.
|
||||
var (
|
||||
// optional udpa.annotations.FileMigrateAnnotation file_migrate = 171962766;
|
||||
E_FileMigrate = &file_udpa_annotations_migrate_proto_extTypes[4]
|
||||
)
|
||||
|
||||
var File_udpa_annotations_migrate_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_udpa_annotations_migrate_proto_rawDesc = []byte{
|
||||
0x0a, 0x1e, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x10, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2b, 0x0a, 0x11, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x41,
|
||||
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x22, 0x59, 0x0a, 0x16, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74,
|
||||
0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72,
|
||||
0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, 0x70, 0x72, 0x6f,
|
||||
0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x6e,
|
||||
0x65, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3f, 0x0a, 0x15,
|
||||
0x46, 0x69, 0x6c, 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x74, 0x6f,
|
||||
0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d,
|
||||
0x6d, 0x6f, 0x76, 0x65, 0x54, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x3a, 0x70, 0x0a,
|
||||
0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65,
|
||||
0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x18, 0x8e, 0xe3, 0xff, 0x51, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x75, 0x64, 0x70,
|
||||
0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4d, 0x69,
|
||||
0x67, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
|
||||
0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x3a,
|
||||
0x6f, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65,
|
||||
0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18,
|
||||
0x8e, 0xe3, 0xff, 0x51, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x75, 0x64, 0x70, 0x61, 0x2e,
|
||||
0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x69, 0x65, 0x6c,
|
||||
0x64, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65,
|
||||
0x3a, 0x67, 0x0a, 0x0c, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65,
|
||||
0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x8e,
|
||||
0xe3, 0xff, 0x51, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x61,
|
||||
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61,
|
||||
0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x65, 0x6e,
|
||||
0x75, 0x6d, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x3a, 0x77, 0x0a, 0x12, 0x65, 0x6e, 0x75,
|
||||
0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x12,
|
||||
0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
|
||||
0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x18, 0x8e, 0xe3, 0xff, 0x51, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x75, 0x64,
|
||||
0x70, 0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4d,
|
||||
0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x52, 0x10, 0x65, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61,
|
||||
0x74, 0x65, 0x3a, 0x6b, 0x0a, 0x0c, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61,
|
||||
0x74, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x18, 0x8e, 0xe3, 0xff, 0x51, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x75, 0x64, 0x70, 0x61,
|
||||
0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x69, 0x6c,
|
||||
0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x52, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x42,
|
||||
0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
|
||||
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61,
|
||||
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_udpa_annotations_migrate_proto_rawDescOnce sync.Once
|
||||
file_udpa_annotations_migrate_proto_rawDescData = file_udpa_annotations_migrate_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_udpa_annotations_migrate_proto_rawDescGZIP() []byte {
|
||||
file_udpa_annotations_migrate_proto_rawDescOnce.Do(func() {
|
||||
file_udpa_annotations_migrate_proto_rawDescData = protoimpl.X.CompressGZIP(file_udpa_annotations_migrate_proto_rawDescData)
|
||||
})
|
||||
return file_udpa_annotations_migrate_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_udpa_annotations_migrate_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_udpa_annotations_migrate_proto_goTypes = []interface{}{
|
||||
(*MigrateAnnotation)(nil), // 0: udpa.annotations.MigrateAnnotation
|
||||
(*FieldMigrateAnnotation)(nil), // 1: udpa.annotations.FieldMigrateAnnotation
|
||||
(*FileMigrateAnnotation)(nil), // 2: udpa.annotations.FileMigrateAnnotation
|
||||
(*descriptorpb.MessageOptions)(nil), // 3: google.protobuf.MessageOptions
|
||||
(*descriptorpb.FieldOptions)(nil), // 4: google.protobuf.FieldOptions
|
||||
(*descriptorpb.EnumOptions)(nil), // 5: google.protobuf.EnumOptions
|
||||
(*descriptorpb.EnumValueOptions)(nil), // 6: google.protobuf.EnumValueOptions
|
||||
(*descriptorpb.FileOptions)(nil), // 7: google.protobuf.FileOptions
|
||||
}
|
||||
var file_udpa_annotations_migrate_proto_depIdxs = []int32{
|
||||
3, // 0: udpa.annotations.message_migrate:extendee -> google.protobuf.MessageOptions
|
||||
4, // 1: udpa.annotations.field_migrate:extendee -> google.protobuf.FieldOptions
|
||||
5, // 2: udpa.annotations.enum_migrate:extendee -> google.protobuf.EnumOptions
|
||||
6, // 3: udpa.annotations.enum_value_migrate:extendee -> google.protobuf.EnumValueOptions
|
||||
7, // 4: udpa.annotations.file_migrate:extendee -> google.protobuf.FileOptions
|
||||
0, // 5: udpa.annotations.message_migrate:type_name -> udpa.annotations.MigrateAnnotation
|
||||
1, // 6: udpa.annotations.field_migrate:type_name -> udpa.annotations.FieldMigrateAnnotation
|
||||
0, // 7: udpa.annotations.enum_migrate:type_name -> udpa.annotations.MigrateAnnotation
|
||||
0, // 8: udpa.annotations.enum_value_migrate:type_name -> udpa.annotations.MigrateAnnotation
|
||||
2, // 9: udpa.annotations.file_migrate:type_name -> udpa.annotations.FileMigrateAnnotation
|
||||
10, // [10:10] is the sub-list for method output_type
|
||||
10, // [10:10] is the sub-list for method input_type
|
||||
5, // [5:10] is the sub-list for extension type_name
|
||||
0, // [0:5] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_udpa_annotations_migrate_proto_init() }
|
||||
func file_udpa_annotations_migrate_proto_init() {
|
||||
if File_udpa_annotations_migrate_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_udpa_annotations_migrate_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MigrateAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_udpa_annotations_migrate_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*FieldMigrateAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_udpa_annotations_migrate_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*FileMigrateAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_udpa_annotations_migrate_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 5,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_udpa_annotations_migrate_proto_goTypes,
|
||||
DependencyIndexes: file_udpa_annotations_migrate_proto_depIdxs,
|
||||
MessageInfos: file_udpa_annotations_migrate_proto_msgTypes,
|
||||
ExtensionInfos: file_udpa_annotations_migrate_proto_extTypes,
|
||||
}.Build()
|
||||
File_udpa_annotations_migrate_proto = out.File
|
||||
file_udpa_annotations_migrate_proto_rawDesc = nil
|
||||
file_udpa_annotations_migrate_proto_goTypes = nil
|
||||
file_udpa_annotations_migrate_proto_depIdxs = nil
|
||||
}
|
||||
350
vendor/github.com/cncf/xds/go/udpa/annotations/migrate.pb.validate.go
generated
vendored
Normal file
350
vendor/github.com/cncf/xds/go/udpa/annotations/migrate.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,350 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: udpa/annotations/migrate.proto
|
||||
|
||||
package annotations
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on MigrateAnnotation with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
func (m *MigrateAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on MigrateAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// MigrateAnnotationMultiError, or nil if none found.
|
||||
func (m *MigrateAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *MigrateAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for Rename
|
||||
|
||||
if len(errors) > 0 {
|
||||
return MigrateAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MigrateAnnotationMultiError is an error wrapping multiple validation errors
|
||||
// returned by MigrateAnnotation.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type MigrateAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m MigrateAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m MigrateAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// MigrateAnnotationValidationError is the validation error returned by
|
||||
// MigrateAnnotation.Validate if the designated constraints aren't met.
|
||||
type MigrateAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e MigrateAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e MigrateAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e MigrateAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e MigrateAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e MigrateAnnotationValidationError) ErrorName() string {
|
||||
return "MigrateAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e MigrateAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sMigrateAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = MigrateAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = MigrateAnnotationValidationError{}
|
||||
|
||||
// Validate checks the field values on FieldMigrateAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *FieldMigrateAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on FieldMigrateAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// FieldMigrateAnnotationMultiError, or nil if none found.
|
||||
func (m *FieldMigrateAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *FieldMigrateAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for Rename
|
||||
|
||||
// no validation rules for OneofPromotion
|
||||
|
||||
if len(errors) > 0 {
|
||||
return FieldMigrateAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// FieldMigrateAnnotationMultiError is an error wrapping multiple validation
|
||||
// errors returned by FieldMigrateAnnotation.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type FieldMigrateAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m FieldMigrateAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m FieldMigrateAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// FieldMigrateAnnotationValidationError is the validation error returned by
|
||||
// FieldMigrateAnnotation.Validate if the designated constraints aren't met.
|
||||
type FieldMigrateAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e FieldMigrateAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e FieldMigrateAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e FieldMigrateAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e FieldMigrateAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e FieldMigrateAnnotationValidationError) ErrorName() string {
|
||||
return "FieldMigrateAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e FieldMigrateAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sFieldMigrateAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = FieldMigrateAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = FieldMigrateAnnotationValidationError{}
|
||||
|
||||
// Validate checks the field values on FileMigrateAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *FileMigrateAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on FileMigrateAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// FileMigrateAnnotationMultiError, or nil if none found.
|
||||
func (m *FileMigrateAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *FileMigrateAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for MoveToPackage
|
||||
|
||||
if len(errors) > 0 {
|
||||
return FileMigrateAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// FileMigrateAnnotationMultiError is an error wrapping multiple validation
|
||||
// errors returned by FileMigrateAnnotation.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type FileMigrateAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m FileMigrateAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m FileMigrateAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// FileMigrateAnnotationValidationError is the validation error returned by
|
||||
// FileMigrateAnnotation.Validate if the designated constraints aren't met.
|
||||
type FileMigrateAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e FileMigrateAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e FileMigrateAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e FileMigrateAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e FileMigrateAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e FileMigrateAnnotationValidationError) ErrorName() string {
|
||||
return "FileMigrateAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e FileMigrateAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sFileMigrateAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = FileMigrateAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = FileMigrateAnnotationValidationError{}
|
||||
196
vendor/github.com/cncf/xds/go/udpa/annotations/security.pb.go
generated
vendored
Normal file
196
vendor/github.com/cncf/xds/go/udpa/annotations/security.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,196 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: udpa/annotations/security.proto
|
||||
|
||||
package annotations
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type FieldSecurityAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ConfigureForUntrustedDownstream bool `protobuf:"varint,1,opt,name=configure_for_untrusted_downstream,json=configureForUntrustedDownstream,proto3" json:"configure_for_untrusted_downstream,omitempty"`
|
||||
ConfigureForUntrustedUpstream bool `protobuf:"varint,2,opt,name=configure_for_untrusted_upstream,json=configureForUntrustedUpstream,proto3" json:"configure_for_untrusted_upstream,omitempty"`
|
||||
}
|
||||
|
||||
func (x *FieldSecurityAnnotation) Reset() {
|
||||
*x = FieldSecurityAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_udpa_annotations_security_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *FieldSecurityAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*FieldSecurityAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *FieldSecurityAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_udpa_annotations_security_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use FieldSecurityAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*FieldSecurityAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_udpa_annotations_security_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *FieldSecurityAnnotation) GetConfigureForUntrustedDownstream() bool {
|
||||
if x != nil {
|
||||
return x.ConfigureForUntrustedDownstream
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *FieldSecurityAnnotation) GetConfigureForUntrustedUpstream() bool {
|
||||
if x != nil {
|
||||
return x.ConfigureForUntrustedUpstream
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var file_udpa_annotations_security_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtensionType: (*FieldSecurityAnnotation)(nil),
|
||||
Field: 11122993,
|
||||
Name: "udpa.annotations.security",
|
||||
Tag: "bytes,11122993,opt,name=security",
|
||||
Filename: "udpa/annotations/security.proto",
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptorpb.FieldOptions.
|
||||
var (
|
||||
// optional udpa.annotations.FieldSecurityAnnotation security = 11122993;
|
||||
E_Security = &file_udpa_annotations_security_proto_extTypes[0]
|
||||
)
|
||||
|
||||
var File_udpa_annotations_security_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_udpa_annotations_security_proto_rawDesc = []byte{
|
||||
0x0a, 0x1f, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x10, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x73, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x01, 0x0a, 0x17, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x65,
|
||||
0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x12, 0x4b, 0x0a, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x5f, 0x66, 0x6f,
|
||||
0x72, 0x5f, 0x75, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x6f, 0x77, 0x6e,
|
||||
0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1f, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x46, 0x6f, 0x72, 0x55, 0x6e, 0x74, 0x72, 0x75, 0x73,
|
||||
0x74, 0x65, 0x64, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x47, 0x0a,
|
||||
0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x75,
|
||||
0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61,
|
||||
0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75,
|
||||
0x72, 0x65, 0x46, 0x6f, 0x72, 0x55, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x55, 0x70,
|
||||
0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x3a, 0x67, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69,
|
||||
0x74, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x18, 0xb1, 0xf2, 0xa6, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x75, 0x64, 0x70,
|
||||
0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x69,
|
||||
0x65, 0x6c, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x41, 0x6e, 0x6e, 0x6f, 0x74,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x42,
|
||||
0x31, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x08, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75,
|
||||
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67,
|
||||
0x6f, 0x2f, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_udpa_annotations_security_proto_rawDescOnce sync.Once
|
||||
file_udpa_annotations_security_proto_rawDescData = file_udpa_annotations_security_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_udpa_annotations_security_proto_rawDescGZIP() []byte {
|
||||
file_udpa_annotations_security_proto_rawDescOnce.Do(func() {
|
||||
file_udpa_annotations_security_proto_rawDescData = protoimpl.X.CompressGZIP(file_udpa_annotations_security_proto_rawDescData)
|
||||
})
|
||||
return file_udpa_annotations_security_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_udpa_annotations_security_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_udpa_annotations_security_proto_goTypes = []interface{}{
|
||||
(*FieldSecurityAnnotation)(nil), // 0: udpa.annotations.FieldSecurityAnnotation
|
||||
(*descriptorpb.FieldOptions)(nil), // 1: google.protobuf.FieldOptions
|
||||
}
|
||||
var file_udpa_annotations_security_proto_depIdxs = []int32{
|
||||
1, // 0: udpa.annotations.security:extendee -> google.protobuf.FieldOptions
|
||||
0, // 1: udpa.annotations.security:type_name -> udpa.annotations.FieldSecurityAnnotation
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
1, // [1:2] is the sub-list for extension type_name
|
||||
0, // [0:1] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_udpa_annotations_security_proto_init() }
|
||||
func file_udpa_annotations_security_proto_init() {
|
||||
if File_udpa_annotations_security_proto != nil {
|
||||
return
|
||||
}
|
||||
file_udpa_annotations_status_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_udpa_annotations_security_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*FieldSecurityAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_udpa_annotations_security_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 1,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_udpa_annotations_security_proto_goTypes,
|
||||
DependencyIndexes: file_udpa_annotations_security_proto_depIdxs,
|
||||
MessageInfos: file_udpa_annotations_security_proto_msgTypes,
|
||||
ExtensionInfos: file_udpa_annotations_security_proto_extTypes,
|
||||
}.Build()
|
||||
File_udpa_annotations_security_proto = out.File
|
||||
file_udpa_annotations_security_proto_rawDesc = nil
|
||||
file_udpa_annotations_security_proto_goTypes = nil
|
||||
file_udpa_annotations_security_proto_depIdxs = nil
|
||||
}
|
||||
142
vendor/github.com/cncf/xds/go/udpa/annotations/security.pb.validate.go
generated
vendored
Normal file
142
vendor/github.com/cncf/xds/go/udpa/annotations/security.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: udpa/annotations/security.proto
|
||||
|
||||
package annotations
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on FieldSecurityAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *FieldSecurityAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on FieldSecurityAnnotation with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// FieldSecurityAnnotationMultiError, or nil if none found.
|
||||
func (m *FieldSecurityAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *FieldSecurityAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for ConfigureForUntrustedDownstream
|
||||
|
||||
// no validation rules for ConfigureForUntrustedUpstream
|
||||
|
||||
if len(errors) > 0 {
|
||||
return FieldSecurityAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// FieldSecurityAnnotationMultiError is an error wrapping multiple validation
|
||||
// errors returned by FieldSecurityAnnotation.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type FieldSecurityAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m FieldSecurityAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m FieldSecurityAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// FieldSecurityAnnotationValidationError is the validation error returned by
|
||||
// FieldSecurityAnnotation.Validate if the designated constraints aren't met.
|
||||
type FieldSecurityAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e FieldSecurityAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e FieldSecurityAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e FieldSecurityAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e FieldSecurityAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e FieldSecurityAnnotationValidationError) ErrorName() string {
|
||||
return "FieldSecurityAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e FieldSecurityAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sFieldSecurityAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = FieldSecurityAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = FieldSecurityAnnotationValidationError{}
|
||||
93
vendor/github.com/cncf/xds/go/udpa/annotations/sensitive.pb.go
generated
vendored
Normal file
93
vendor/github.com/cncf/xds/go/udpa/annotations/sensitive.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: udpa/annotations/sensitive.proto
|
||||
|
||||
package annotations
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
var file_udpa_annotations_sensitive_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtensionType: (*bool)(nil),
|
||||
Field: 76569463,
|
||||
Name: "udpa.annotations.sensitive",
|
||||
Tag: "varint,76569463,opt,name=sensitive",
|
||||
Filename: "udpa/annotations/sensitive.proto",
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptorpb.FieldOptions.
|
||||
var (
|
||||
// optional bool sensitive = 76569463;
|
||||
E_Sensitive = &file_udpa_annotations_sensitive_proto_extTypes[0]
|
||||
)
|
||||
|
||||
var File_udpa_annotations_sensitive_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_udpa_annotations_sensitive_proto_rawDesc = []byte{
|
||||
0x0a, 0x20, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x10, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x3e, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74,
|
||||
0x69, 0x76, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x18, 0xf7, 0xb6, 0xc1, 0x24, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x65, 0x6e,
|
||||
0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f,
|
||||
0x2f, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_udpa_annotations_sensitive_proto_goTypes = []interface{}{
|
||||
(*descriptorpb.FieldOptions)(nil), // 0: google.protobuf.FieldOptions
|
||||
}
|
||||
var file_udpa_annotations_sensitive_proto_depIdxs = []int32{
|
||||
0, // 0: udpa.annotations.sensitive:extendee -> google.protobuf.FieldOptions
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
0, // [0:1] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_udpa_annotations_sensitive_proto_init() }
|
||||
func file_udpa_annotations_sensitive_proto_init() {
|
||||
if File_udpa_annotations_sensitive_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_udpa_annotations_sensitive_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 1,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_udpa_annotations_sensitive_proto_goTypes,
|
||||
DependencyIndexes: file_udpa_annotations_sensitive_proto_depIdxs,
|
||||
ExtensionInfos: file_udpa_annotations_sensitive_proto_extTypes,
|
||||
}.Build()
|
||||
File_udpa_annotations_sensitive_proto = out.File
|
||||
file_udpa_annotations_sensitive_proto_rawDesc = nil
|
||||
file_udpa_annotations_sensitive_proto_goTypes = nil
|
||||
file_udpa_annotations_sensitive_proto_depIdxs = nil
|
||||
}
|
||||
36
vendor/github.com/cncf/xds/go/udpa/annotations/sensitive.pb.validate.go
generated
vendored
Normal file
36
vendor/github.com/cncf/xds/go/udpa/annotations/sensitive.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: udpa/annotations/sensitive.proto
|
||||
|
||||
package annotations
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
253
vendor/github.com/cncf/xds/go/udpa/annotations/status.pb.go
generated
vendored
Normal file
253
vendor/github.com/cncf/xds/go/udpa/annotations/status.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,253 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: udpa/annotations/status.proto
|
||||
|
||||
package annotations
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type PackageVersionStatus int32
|
||||
|
||||
const (
|
||||
PackageVersionStatus_UNKNOWN PackageVersionStatus = 0
|
||||
PackageVersionStatus_FROZEN PackageVersionStatus = 1
|
||||
PackageVersionStatus_ACTIVE PackageVersionStatus = 2
|
||||
PackageVersionStatus_NEXT_MAJOR_VERSION_CANDIDATE PackageVersionStatus = 3
|
||||
)
|
||||
|
||||
// Enum value maps for PackageVersionStatus.
|
||||
var (
|
||||
PackageVersionStatus_name = map[int32]string{
|
||||
0: "UNKNOWN",
|
||||
1: "FROZEN",
|
||||
2: "ACTIVE",
|
||||
3: "NEXT_MAJOR_VERSION_CANDIDATE",
|
||||
}
|
||||
PackageVersionStatus_value = map[string]int32{
|
||||
"UNKNOWN": 0,
|
||||
"FROZEN": 1,
|
||||
"ACTIVE": 2,
|
||||
"NEXT_MAJOR_VERSION_CANDIDATE": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x PackageVersionStatus) Enum() *PackageVersionStatus {
|
||||
p := new(PackageVersionStatus)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x PackageVersionStatus) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (PackageVersionStatus) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_udpa_annotations_status_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (PackageVersionStatus) Type() protoreflect.EnumType {
|
||||
return &file_udpa_annotations_status_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x PackageVersionStatus) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PackageVersionStatus.Descriptor instead.
|
||||
func (PackageVersionStatus) EnumDescriptor() ([]byte, []int) {
|
||||
return file_udpa_annotations_status_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type StatusAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
WorkInProgress bool `protobuf:"varint,1,opt,name=work_in_progress,json=workInProgress,proto3" json:"work_in_progress,omitempty"`
|
||||
PackageVersionStatus PackageVersionStatus `protobuf:"varint,2,opt,name=package_version_status,json=packageVersionStatus,proto3,enum=udpa.annotations.PackageVersionStatus" json:"package_version_status,omitempty"`
|
||||
}
|
||||
|
||||
func (x *StatusAnnotation) Reset() {
|
||||
*x = StatusAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_udpa_annotations_status_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *StatusAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StatusAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *StatusAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_udpa_annotations_status_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*StatusAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_udpa_annotations_status_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *StatusAnnotation) GetWorkInProgress() bool {
|
||||
if x != nil {
|
||||
return x.WorkInProgress
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *StatusAnnotation) GetPackageVersionStatus() PackageVersionStatus {
|
||||
if x != nil {
|
||||
return x.PackageVersionStatus
|
||||
}
|
||||
return PackageVersionStatus_UNKNOWN
|
||||
}
|
||||
|
||||
var file_udpa_annotations_status_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FileOptions)(nil),
|
||||
ExtensionType: (*StatusAnnotation)(nil),
|
||||
Field: 222707719,
|
||||
Name: "udpa.annotations.file_status",
|
||||
Tag: "bytes,222707719,opt,name=file_status",
|
||||
Filename: "udpa/annotations/status.proto",
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptorpb.FileOptions.
|
||||
var (
|
||||
// optional udpa.annotations.StatusAnnotation file_status = 222707719;
|
||||
E_FileStatus = &file_udpa_annotations_status_proto_extTypes[0]
|
||||
)
|
||||
|
||||
var File_udpa_annotations_status_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_udpa_annotations_status_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x10, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x41, 0x6e,
|
||||
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b,
|
||||
0x5f, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65,
|
||||
0x73, 0x73, 0x12, 0x5c, 0x0a, 0x16, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x76, 0x65,
|
||||
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0e, 0x32, 0x26, 0x2e, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 0x65, 0x72,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x14, 0x70, 0x61, 0x63, 0x6b,
|
||||
0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x2a, 0x5d, 0x0a, 0x14, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e,
|
||||
0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x52, 0x4f, 0x5a, 0x45, 0x4e, 0x10,
|
||||
0x01, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x20, 0x0a,
|
||||
0x1c, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x4d, 0x41, 0x4a, 0x4f, 0x52, 0x5f, 0x56, 0x45, 0x52, 0x53,
|
||||
0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x41, 0x4e, 0x44, 0x49, 0x44, 0x41, 0x54, 0x45, 0x10, 0x03, 0x3a,
|
||||
0x64, 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x87, 0x80, 0x99,
|
||||
0x6a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x61, 0x6e, 0x6e,
|
||||
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x41,
|
||||
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x53,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f,
|
||||
0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_udpa_annotations_status_proto_rawDescOnce sync.Once
|
||||
file_udpa_annotations_status_proto_rawDescData = file_udpa_annotations_status_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_udpa_annotations_status_proto_rawDescGZIP() []byte {
|
||||
file_udpa_annotations_status_proto_rawDescOnce.Do(func() {
|
||||
file_udpa_annotations_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_udpa_annotations_status_proto_rawDescData)
|
||||
})
|
||||
return file_udpa_annotations_status_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_udpa_annotations_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_udpa_annotations_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_udpa_annotations_status_proto_goTypes = []interface{}{
|
||||
(PackageVersionStatus)(0), // 0: udpa.annotations.PackageVersionStatus
|
||||
(*StatusAnnotation)(nil), // 1: udpa.annotations.StatusAnnotation
|
||||
(*descriptorpb.FileOptions)(nil), // 2: google.protobuf.FileOptions
|
||||
}
|
||||
var file_udpa_annotations_status_proto_depIdxs = []int32{
|
||||
0, // 0: udpa.annotations.StatusAnnotation.package_version_status:type_name -> udpa.annotations.PackageVersionStatus
|
||||
2, // 1: udpa.annotations.file_status:extendee -> google.protobuf.FileOptions
|
||||
1, // 2: udpa.annotations.file_status:type_name -> udpa.annotations.StatusAnnotation
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
2, // [2:3] is the sub-list for extension type_name
|
||||
1, // [1:2] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_udpa_annotations_status_proto_init() }
|
||||
func file_udpa_annotations_status_proto_init() {
|
||||
if File_udpa_annotations_status_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_udpa_annotations_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StatusAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_udpa_annotations_status_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 1,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_udpa_annotations_status_proto_goTypes,
|
||||
DependencyIndexes: file_udpa_annotations_status_proto_depIdxs,
|
||||
EnumInfos: file_udpa_annotations_status_proto_enumTypes,
|
||||
MessageInfos: file_udpa_annotations_status_proto_msgTypes,
|
||||
ExtensionInfos: file_udpa_annotations_status_proto_extTypes,
|
||||
}.Build()
|
||||
File_udpa_annotations_status_proto = out.File
|
||||
file_udpa_annotations_status_proto_rawDesc = nil
|
||||
file_udpa_annotations_status_proto_goTypes = nil
|
||||
file_udpa_annotations_status_proto_depIdxs = nil
|
||||
}
|
||||
140
vendor/github.com/cncf/xds/go/udpa/annotations/status.pb.validate.go
generated
vendored
Normal file
140
vendor/github.com/cncf/xds/go/udpa/annotations/status.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: udpa/annotations/status.proto
|
||||
|
||||
package annotations
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on StatusAnnotation with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
func (m *StatusAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on StatusAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// StatusAnnotationMultiError, or nil if none found.
|
||||
func (m *StatusAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *StatusAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for WorkInProgress
|
||||
|
||||
// no validation rules for PackageVersionStatus
|
||||
|
||||
if len(errors) > 0 {
|
||||
return StatusAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// StatusAnnotationMultiError is an error wrapping multiple validation errors
|
||||
// returned by StatusAnnotation.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type StatusAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m StatusAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m StatusAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// StatusAnnotationValidationError is the validation error returned by
|
||||
// StatusAnnotation.Validate if the designated constraints aren't met.
|
||||
type StatusAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e StatusAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e StatusAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e StatusAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e StatusAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e StatusAnnotationValidationError) ErrorName() string { return "StatusAnnotationValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e StatusAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sStatusAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = StatusAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = StatusAnnotationValidationError{}
|
||||
179
vendor/github.com/cncf/xds/go/udpa/annotations/versioning.pb.go
generated
vendored
Normal file
179
vendor/github.com/cncf/xds/go/udpa/annotations/versioning.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: udpa/annotations/versioning.proto
|
||||
|
||||
package annotations
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type VersioningAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
PreviousMessageType string `protobuf:"bytes,1,opt,name=previous_message_type,json=previousMessageType,proto3" json:"previous_message_type,omitempty"`
|
||||
}
|
||||
|
||||
func (x *VersioningAnnotation) Reset() {
|
||||
*x = VersioningAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_udpa_annotations_versioning_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *VersioningAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*VersioningAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *VersioningAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_udpa_annotations_versioning_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use VersioningAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*VersioningAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_udpa_annotations_versioning_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *VersioningAnnotation) GetPreviousMessageType() string {
|
||||
if x != nil {
|
||||
return x.PreviousMessageType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var file_udpa_annotations_versioning_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptorpb.MessageOptions)(nil),
|
||||
ExtensionType: (*VersioningAnnotation)(nil),
|
||||
Field: 7881811,
|
||||
Name: "udpa.annotations.versioning",
|
||||
Tag: "bytes,7881811,opt,name=versioning",
|
||||
Filename: "udpa/annotations/versioning.proto",
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptorpb.MessageOptions.
|
||||
var (
|
||||
// optional udpa.annotations.VersioningAnnotation versioning = 7881811;
|
||||
E_Versioning = &file_udpa_annotations_versioning_proto_extTypes[0]
|
||||
)
|
||||
|
||||
var File_udpa_annotations_versioning_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_udpa_annotations_versioning_proto_rawDesc = []byte{
|
||||
0x0a, 0x21, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x10, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
|
||||
0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4a, 0x0a, 0x14, 0x56, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12,
|
||||
0x32, 0x0a, 0x15, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13,
|
||||
0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54,
|
||||
0x79, 0x70, 0x65, 0x3a, 0x6a, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e,
|
||||
0x67, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x18, 0xd3, 0x88, 0xe1, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x75, 0x64,
|
||||
0x70, 0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56,
|
||||
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x42,
|
||||
0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
|
||||
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61,
|
||||
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_udpa_annotations_versioning_proto_rawDescOnce sync.Once
|
||||
file_udpa_annotations_versioning_proto_rawDescData = file_udpa_annotations_versioning_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_udpa_annotations_versioning_proto_rawDescGZIP() []byte {
|
||||
file_udpa_annotations_versioning_proto_rawDescOnce.Do(func() {
|
||||
file_udpa_annotations_versioning_proto_rawDescData = protoimpl.X.CompressGZIP(file_udpa_annotations_versioning_proto_rawDescData)
|
||||
})
|
||||
return file_udpa_annotations_versioning_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_udpa_annotations_versioning_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_udpa_annotations_versioning_proto_goTypes = []interface{}{
|
||||
(*VersioningAnnotation)(nil), // 0: udpa.annotations.VersioningAnnotation
|
||||
(*descriptorpb.MessageOptions)(nil), // 1: google.protobuf.MessageOptions
|
||||
}
|
||||
var file_udpa_annotations_versioning_proto_depIdxs = []int32{
|
||||
1, // 0: udpa.annotations.versioning:extendee -> google.protobuf.MessageOptions
|
||||
0, // 1: udpa.annotations.versioning:type_name -> udpa.annotations.VersioningAnnotation
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
1, // [1:2] is the sub-list for extension type_name
|
||||
0, // [0:1] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_udpa_annotations_versioning_proto_init() }
|
||||
func file_udpa_annotations_versioning_proto_init() {
|
||||
if File_udpa_annotations_versioning_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_udpa_annotations_versioning_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*VersioningAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_udpa_annotations_versioning_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 1,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_udpa_annotations_versioning_proto_goTypes,
|
||||
DependencyIndexes: file_udpa_annotations_versioning_proto_depIdxs,
|
||||
MessageInfos: file_udpa_annotations_versioning_proto_msgTypes,
|
||||
ExtensionInfos: file_udpa_annotations_versioning_proto_extTypes,
|
||||
}.Build()
|
||||
File_udpa_annotations_versioning_proto = out.File
|
||||
file_udpa_annotations_versioning_proto_rawDesc = nil
|
||||
file_udpa_annotations_versioning_proto_goTypes = nil
|
||||
file_udpa_annotations_versioning_proto_depIdxs = nil
|
||||
}
|
||||
140
vendor/github.com/cncf/xds/go/udpa/annotations/versioning.pb.validate.go
generated
vendored
Normal file
140
vendor/github.com/cncf/xds/go/udpa/annotations/versioning.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: udpa/annotations/versioning.proto
|
||||
|
||||
package annotations
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on VersioningAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *VersioningAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on VersioningAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// VersioningAnnotationMultiError, or nil if none found.
|
||||
func (m *VersioningAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *VersioningAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for PreviousMessageType
|
||||
|
||||
if len(errors) > 0 {
|
||||
return VersioningAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// VersioningAnnotationMultiError is an error wrapping multiple validation
|
||||
// errors returned by VersioningAnnotation.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type VersioningAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m VersioningAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m VersioningAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// VersioningAnnotationValidationError is the validation error returned by
|
||||
// VersioningAnnotation.Validate if the designated constraints aren't met.
|
||||
type VersioningAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e VersioningAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e VersioningAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e VersioningAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e VersioningAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e VersioningAnnotationValidationError) ErrorName() string {
|
||||
return "VersioningAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e VersioningAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sVersioningAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = VersioningAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = VersioningAnnotationValidationError{}
|
||||
164
vendor/github.com/cncf/xds/go/udpa/type/v1/typed_struct.pb.go
generated
vendored
Normal file
164
vendor/github.com/cncf/xds/go/udpa/type/v1/typed_struct.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: udpa/type/v1/typed_struct.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
structpb "google.golang.org/protobuf/types/known/structpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type TypedStruct struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
|
||||
Value *structpb.Struct `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *TypedStruct) Reset() {
|
||||
*x = TypedStruct{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_udpa_type_v1_typed_struct_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TypedStruct) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TypedStruct) ProtoMessage() {}
|
||||
|
||||
func (x *TypedStruct) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_udpa_type_v1_typed_struct_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TypedStruct.ProtoReflect.Descriptor instead.
|
||||
func (*TypedStruct) Descriptor() ([]byte, []int) {
|
||||
return file_udpa_type_v1_typed_struct_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *TypedStruct) GetTypeUrl() string {
|
||||
if x != nil {
|
||||
return x.TypeUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TypedStruct) GetValue() *structpb.Struct {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_udpa_type_v1_typed_struct_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_udpa_type_v1_typed_struct_proto_rawDesc = []byte{
|
||||
0x0a, 0x1f, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74,
|
||||
0x79, 0x70, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x0c, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x1a,
|
||||
0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x57, 0x0a,
|
||||
0x0b, 0x54, 0x79, 0x70, 0x65, 0x64, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x12, 0x19, 0x0a, 0x08,
|
||||
0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||
0x74, 0x79, 0x70, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52,
|
||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x57, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x74,
|
||||
0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x54, 0x79, 0x70, 0x65, 0x64, 0x53, 0x74, 0x72,
|
||||
0x75, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68,
|
||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f,
|
||||
0x67, 0x6f, 0x2f, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x76, 0x31, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_udpa_type_v1_typed_struct_proto_rawDescOnce sync.Once
|
||||
file_udpa_type_v1_typed_struct_proto_rawDescData = file_udpa_type_v1_typed_struct_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_udpa_type_v1_typed_struct_proto_rawDescGZIP() []byte {
|
||||
file_udpa_type_v1_typed_struct_proto_rawDescOnce.Do(func() {
|
||||
file_udpa_type_v1_typed_struct_proto_rawDescData = protoimpl.X.CompressGZIP(file_udpa_type_v1_typed_struct_proto_rawDescData)
|
||||
})
|
||||
return file_udpa_type_v1_typed_struct_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_udpa_type_v1_typed_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_udpa_type_v1_typed_struct_proto_goTypes = []interface{}{
|
||||
(*TypedStruct)(nil), // 0: udpa.type.v1.TypedStruct
|
||||
(*structpb.Struct)(nil), // 1: google.protobuf.Struct
|
||||
}
|
||||
var file_udpa_type_v1_typed_struct_proto_depIdxs = []int32{
|
||||
1, // 0: udpa.type.v1.TypedStruct.value:type_name -> google.protobuf.Struct
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_udpa_type_v1_typed_struct_proto_init() }
|
||||
func file_udpa_type_v1_typed_struct_proto_init() {
|
||||
if File_udpa_type_v1_typed_struct_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_udpa_type_v1_typed_struct_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TypedStruct); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_udpa_type_v1_typed_struct_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_udpa_type_v1_typed_struct_proto_goTypes,
|
||||
DependencyIndexes: file_udpa_type_v1_typed_struct_proto_depIdxs,
|
||||
MessageInfos: file_udpa_type_v1_typed_struct_proto_msgTypes,
|
||||
}.Build()
|
||||
File_udpa_type_v1_typed_struct_proto = out.File
|
||||
file_udpa_type_v1_typed_struct_proto_rawDesc = nil
|
||||
file_udpa_type_v1_typed_struct_proto_goTypes = nil
|
||||
file_udpa_type_v1_typed_struct_proto_depIdxs = nil
|
||||
}
|
||||
166
vendor/github.com/cncf/xds/go/udpa/type/v1/typed_struct.pb.validate.go
generated
vendored
Normal file
166
vendor/github.com/cncf/xds/go/udpa/type/v1/typed_struct.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: udpa/type/v1/typed_struct.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on TypedStruct with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *TypedStruct) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on TypedStruct with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in TypedStructMultiError, or
|
||||
// nil if none found.
|
||||
func (m *TypedStruct) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *TypedStruct) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for TypeUrl
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetValue()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, TypedStructValidationError{
|
||||
field: "Value",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, TypedStructValidationError{
|
||||
field: "Value",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return TypedStructValidationError{
|
||||
field: "Value",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return TypedStructMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// TypedStructMultiError is an error wrapping multiple validation errors
|
||||
// returned by TypedStruct.ValidateAll() if the designated constraints aren't met.
|
||||
type TypedStructMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m TypedStructMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m TypedStructMultiError) AllErrors() []error { return m }
|
||||
|
||||
// TypedStructValidationError is the validation error returned by
|
||||
// TypedStruct.Validate if the designated constraints aren't met.
|
||||
type TypedStructValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e TypedStructValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e TypedStructValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e TypedStructValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e TypedStructValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e TypedStructValidationError) ErrorName() string { return "TypedStructValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e TypedStructValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sTypedStruct.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = TypedStructValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = TypedStructValidationError{}
|
||||
412
vendor/github.com/cncf/xds/go/xds/annotations/v3/migrate.pb.go
generated
vendored
Normal file
412
vendor/github.com/cncf/xds/go/xds/annotations/v3/migrate.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,412 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/annotations/v3/migrate.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type MigrateAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rename string `protobuf:"bytes,1,opt,name=rename,proto3" json:"rename,omitempty"`
|
||||
}
|
||||
|
||||
func (x *MigrateAnnotation) Reset() {
|
||||
*x = MigrateAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_annotations_v3_migrate_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MigrateAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MigrateAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *MigrateAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_annotations_v3_migrate_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MigrateAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*MigrateAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_xds_annotations_v3_migrate_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *MigrateAnnotation) GetRename() string {
|
||||
if x != nil {
|
||||
return x.Rename
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type FieldMigrateAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rename string `protobuf:"bytes,1,opt,name=rename,proto3" json:"rename,omitempty"`
|
||||
OneofPromotion string `protobuf:"bytes,2,opt,name=oneof_promotion,json=oneofPromotion,proto3" json:"oneof_promotion,omitempty"`
|
||||
}
|
||||
|
||||
func (x *FieldMigrateAnnotation) Reset() {
|
||||
*x = FieldMigrateAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_annotations_v3_migrate_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *FieldMigrateAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*FieldMigrateAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *FieldMigrateAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_annotations_v3_migrate_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use FieldMigrateAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*FieldMigrateAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_xds_annotations_v3_migrate_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *FieldMigrateAnnotation) GetRename() string {
|
||||
if x != nil {
|
||||
return x.Rename
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *FieldMigrateAnnotation) GetOneofPromotion() string {
|
||||
if x != nil {
|
||||
return x.OneofPromotion
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type FileMigrateAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
MoveToPackage string `protobuf:"bytes,2,opt,name=move_to_package,json=moveToPackage,proto3" json:"move_to_package,omitempty"`
|
||||
}
|
||||
|
||||
func (x *FileMigrateAnnotation) Reset() {
|
||||
*x = FileMigrateAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_annotations_v3_migrate_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *FileMigrateAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*FileMigrateAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *FileMigrateAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_annotations_v3_migrate_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use FileMigrateAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*FileMigrateAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_xds_annotations_v3_migrate_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *FileMigrateAnnotation) GetMoveToPackage() string {
|
||||
if x != nil {
|
||||
return x.MoveToPackage
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var file_xds_annotations_v3_migrate_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptorpb.MessageOptions)(nil),
|
||||
ExtensionType: (*MigrateAnnotation)(nil),
|
||||
Field: 112948430,
|
||||
Name: "xds.annotations.v3.message_migrate",
|
||||
Tag: "bytes,112948430,opt,name=message_migrate",
|
||||
Filename: "xds/annotations/v3/migrate.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtensionType: (*FieldMigrateAnnotation)(nil),
|
||||
Field: 112948430,
|
||||
Name: "xds.annotations.v3.field_migrate",
|
||||
Tag: "bytes,112948430,opt,name=field_migrate",
|
||||
Filename: "xds/annotations/v3/migrate.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.EnumOptions)(nil),
|
||||
ExtensionType: (*MigrateAnnotation)(nil),
|
||||
Field: 112948430,
|
||||
Name: "xds.annotations.v3.enum_migrate",
|
||||
Tag: "bytes,112948430,opt,name=enum_migrate",
|
||||
Filename: "xds/annotations/v3/migrate.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.EnumValueOptions)(nil),
|
||||
ExtensionType: (*MigrateAnnotation)(nil),
|
||||
Field: 112948430,
|
||||
Name: "xds.annotations.v3.enum_value_migrate",
|
||||
Tag: "bytes,112948430,opt,name=enum_value_migrate",
|
||||
Filename: "xds/annotations/v3/migrate.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FileOptions)(nil),
|
||||
ExtensionType: (*FileMigrateAnnotation)(nil),
|
||||
Field: 112948430,
|
||||
Name: "xds.annotations.v3.file_migrate",
|
||||
Tag: "bytes,112948430,opt,name=file_migrate",
|
||||
Filename: "xds/annotations/v3/migrate.proto",
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptorpb.MessageOptions.
|
||||
var (
|
||||
// optional xds.annotations.v3.MigrateAnnotation message_migrate = 112948430;
|
||||
E_MessageMigrate = &file_xds_annotations_v3_migrate_proto_extTypes[0]
|
||||
)
|
||||
|
||||
// Extension fields to descriptorpb.FieldOptions.
|
||||
var (
|
||||
// optional xds.annotations.v3.FieldMigrateAnnotation field_migrate = 112948430;
|
||||
E_FieldMigrate = &file_xds_annotations_v3_migrate_proto_extTypes[1]
|
||||
)
|
||||
|
||||
// Extension fields to descriptorpb.EnumOptions.
|
||||
var (
|
||||
// optional xds.annotations.v3.MigrateAnnotation enum_migrate = 112948430;
|
||||
E_EnumMigrate = &file_xds_annotations_v3_migrate_proto_extTypes[2]
|
||||
)
|
||||
|
||||
// Extension fields to descriptorpb.EnumValueOptions.
|
||||
var (
|
||||
// optional xds.annotations.v3.MigrateAnnotation enum_value_migrate = 112948430;
|
||||
E_EnumValueMigrate = &file_xds_annotations_v3_migrate_proto_extTypes[3]
|
||||
)
|
||||
|
||||
// Extension fields to descriptorpb.FileOptions.
|
||||
var (
|
||||
// optional xds.annotations.v3.FileMigrateAnnotation file_migrate = 112948430;
|
||||
E_FileMigrate = &file_xds_annotations_v3_migrate_proto_extTypes[4]
|
||||
)
|
||||
|
||||
var File_xds_annotations_v3_migrate_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_annotations_v3_migrate_proto_rawDesc = []byte{
|
||||
0x0a, 0x20, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x12, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x33, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
|
||||
0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2b, 0x0a, 0x11, 0x4d, 0x69, 0x67, 0x72,
|
||||
0x61, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72,
|
||||
0x65, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x59, 0x0a, 0x16, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x69,
|
||||
0x67, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x06, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x6e, 0x65, 0x6f, 0x66,
|
||||
0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x0e, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x22, 0x3f, 0x0a, 0x15, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x41,
|
||||
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x6f, 0x76,
|
||||
0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x0d, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67,
|
||||
0x65, 0x3a, 0x72, 0x0a, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x69, 0x67,
|
||||
0x72, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xce, 0xe9, 0xed, 0x35, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25,
|
||||
0x2e, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4d, 0x69,
|
||||
0x67, 0x72, 0x61, 0x74, 0x65, 0x3a, 0x71, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d,
|
||||
0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xce, 0xe9, 0xed, 0x35, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a,
|
||||
0x2e, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65,
|
||||
0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c,
|
||||
0x64, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x3a, 0x69, 0x0a, 0x0c, 0x65, 0x6e, 0x75, 0x6d,
|
||||
0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f,
|
||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xce, 0xe9, 0xed, 0x35, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x25, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f,
|
||||
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x65, 0x6e, 0x75, 0x6d, 0x4d, 0x69, 0x67, 0x72,
|
||||
0x61, 0x74, 0x65, 0x3a, 0x79, 0x0a, 0x12, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d,
|
||||
0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xce, 0xe9, 0xed,
|
||||
0x35, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f,
|
||||
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61,
|
||||
0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x65, 0x6e,
|
||||
0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x3a, 0x6d,
|
||||
0x0a, 0x0c, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x12, 0x1c,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xce, 0xe9, 0xed,
|
||||
0x35, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f,
|
||||
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4d,
|
||||
0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x52, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x42, 0x2b, 0x5a,
|
||||
0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66,
|
||||
0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f,
|
||||
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_annotations_v3_migrate_proto_rawDescOnce sync.Once
|
||||
file_xds_annotations_v3_migrate_proto_rawDescData = file_xds_annotations_v3_migrate_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_annotations_v3_migrate_proto_rawDescGZIP() []byte {
|
||||
file_xds_annotations_v3_migrate_proto_rawDescOnce.Do(func() {
|
||||
file_xds_annotations_v3_migrate_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_annotations_v3_migrate_proto_rawDescData)
|
||||
})
|
||||
return file_xds_annotations_v3_migrate_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_annotations_v3_migrate_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_xds_annotations_v3_migrate_proto_goTypes = []interface{}{
|
||||
(*MigrateAnnotation)(nil), // 0: xds.annotations.v3.MigrateAnnotation
|
||||
(*FieldMigrateAnnotation)(nil), // 1: xds.annotations.v3.FieldMigrateAnnotation
|
||||
(*FileMigrateAnnotation)(nil), // 2: xds.annotations.v3.FileMigrateAnnotation
|
||||
(*descriptorpb.MessageOptions)(nil), // 3: google.protobuf.MessageOptions
|
||||
(*descriptorpb.FieldOptions)(nil), // 4: google.protobuf.FieldOptions
|
||||
(*descriptorpb.EnumOptions)(nil), // 5: google.protobuf.EnumOptions
|
||||
(*descriptorpb.EnumValueOptions)(nil), // 6: google.protobuf.EnumValueOptions
|
||||
(*descriptorpb.FileOptions)(nil), // 7: google.protobuf.FileOptions
|
||||
}
|
||||
var file_xds_annotations_v3_migrate_proto_depIdxs = []int32{
|
||||
3, // 0: xds.annotations.v3.message_migrate:extendee -> google.protobuf.MessageOptions
|
||||
4, // 1: xds.annotations.v3.field_migrate:extendee -> google.protobuf.FieldOptions
|
||||
5, // 2: xds.annotations.v3.enum_migrate:extendee -> google.protobuf.EnumOptions
|
||||
6, // 3: xds.annotations.v3.enum_value_migrate:extendee -> google.protobuf.EnumValueOptions
|
||||
7, // 4: xds.annotations.v3.file_migrate:extendee -> google.protobuf.FileOptions
|
||||
0, // 5: xds.annotations.v3.message_migrate:type_name -> xds.annotations.v3.MigrateAnnotation
|
||||
1, // 6: xds.annotations.v3.field_migrate:type_name -> xds.annotations.v3.FieldMigrateAnnotation
|
||||
0, // 7: xds.annotations.v3.enum_migrate:type_name -> xds.annotations.v3.MigrateAnnotation
|
||||
0, // 8: xds.annotations.v3.enum_value_migrate:type_name -> xds.annotations.v3.MigrateAnnotation
|
||||
2, // 9: xds.annotations.v3.file_migrate:type_name -> xds.annotations.v3.FileMigrateAnnotation
|
||||
10, // [10:10] is the sub-list for method output_type
|
||||
10, // [10:10] is the sub-list for method input_type
|
||||
5, // [5:10] is the sub-list for extension type_name
|
||||
0, // [0:5] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_annotations_v3_migrate_proto_init() }
|
||||
func file_xds_annotations_v3_migrate_proto_init() {
|
||||
if File_xds_annotations_v3_migrate_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_annotations_v3_migrate_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MigrateAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_annotations_v3_migrate_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*FieldMigrateAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_annotations_v3_migrate_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*FileMigrateAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_annotations_v3_migrate_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 5,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_annotations_v3_migrate_proto_goTypes,
|
||||
DependencyIndexes: file_xds_annotations_v3_migrate_proto_depIdxs,
|
||||
MessageInfos: file_xds_annotations_v3_migrate_proto_msgTypes,
|
||||
ExtensionInfos: file_xds_annotations_v3_migrate_proto_extTypes,
|
||||
}.Build()
|
||||
File_xds_annotations_v3_migrate_proto = out.File
|
||||
file_xds_annotations_v3_migrate_proto_rawDesc = nil
|
||||
file_xds_annotations_v3_migrate_proto_goTypes = nil
|
||||
file_xds_annotations_v3_migrate_proto_depIdxs = nil
|
||||
}
|
||||
350
vendor/github.com/cncf/xds/go/xds/annotations/v3/migrate.pb.validate.go
generated
vendored
Normal file
350
vendor/github.com/cncf/xds/go/xds/annotations/v3/migrate.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,350 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/annotations/v3/migrate.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on MigrateAnnotation with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
func (m *MigrateAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on MigrateAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// MigrateAnnotationMultiError, or nil if none found.
|
||||
func (m *MigrateAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *MigrateAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for Rename
|
||||
|
||||
if len(errors) > 0 {
|
||||
return MigrateAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MigrateAnnotationMultiError is an error wrapping multiple validation errors
|
||||
// returned by MigrateAnnotation.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type MigrateAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m MigrateAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m MigrateAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// MigrateAnnotationValidationError is the validation error returned by
|
||||
// MigrateAnnotation.Validate if the designated constraints aren't met.
|
||||
type MigrateAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e MigrateAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e MigrateAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e MigrateAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e MigrateAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e MigrateAnnotationValidationError) ErrorName() string {
|
||||
return "MigrateAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e MigrateAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sMigrateAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = MigrateAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = MigrateAnnotationValidationError{}
|
||||
|
||||
// Validate checks the field values on FieldMigrateAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *FieldMigrateAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on FieldMigrateAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// FieldMigrateAnnotationMultiError, or nil if none found.
|
||||
func (m *FieldMigrateAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *FieldMigrateAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for Rename
|
||||
|
||||
// no validation rules for OneofPromotion
|
||||
|
||||
if len(errors) > 0 {
|
||||
return FieldMigrateAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// FieldMigrateAnnotationMultiError is an error wrapping multiple validation
|
||||
// errors returned by FieldMigrateAnnotation.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type FieldMigrateAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m FieldMigrateAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m FieldMigrateAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// FieldMigrateAnnotationValidationError is the validation error returned by
|
||||
// FieldMigrateAnnotation.Validate if the designated constraints aren't met.
|
||||
type FieldMigrateAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e FieldMigrateAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e FieldMigrateAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e FieldMigrateAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e FieldMigrateAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e FieldMigrateAnnotationValidationError) ErrorName() string {
|
||||
return "FieldMigrateAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e FieldMigrateAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sFieldMigrateAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = FieldMigrateAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = FieldMigrateAnnotationValidationError{}
|
||||
|
||||
// Validate checks the field values on FileMigrateAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *FileMigrateAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on FileMigrateAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// FileMigrateAnnotationMultiError, or nil if none found.
|
||||
func (m *FileMigrateAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *FileMigrateAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for MoveToPackage
|
||||
|
||||
if len(errors) > 0 {
|
||||
return FileMigrateAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// FileMigrateAnnotationMultiError is an error wrapping multiple validation
|
||||
// errors returned by FileMigrateAnnotation.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type FileMigrateAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m FileMigrateAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m FileMigrateAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// FileMigrateAnnotationValidationError is the validation error returned by
|
||||
// FileMigrateAnnotation.Validate if the designated constraints aren't met.
|
||||
type FileMigrateAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e FileMigrateAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e FileMigrateAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e FileMigrateAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e FileMigrateAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e FileMigrateAnnotationValidationError) ErrorName() string {
|
||||
return "FileMigrateAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e FileMigrateAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sFileMigrateAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = FileMigrateAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = FileMigrateAnnotationValidationError{}
|
||||
197
vendor/github.com/cncf/xds/go/xds/annotations/v3/security.pb.go
generated
vendored
Normal file
197
vendor/github.com/cncf/xds/go/xds/annotations/v3/security.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/annotations/v3/security.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type FieldSecurityAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ConfigureForUntrustedDownstream bool `protobuf:"varint,1,opt,name=configure_for_untrusted_downstream,json=configureForUntrustedDownstream,proto3" json:"configure_for_untrusted_downstream,omitempty"`
|
||||
ConfigureForUntrustedUpstream bool `protobuf:"varint,2,opt,name=configure_for_untrusted_upstream,json=configureForUntrustedUpstream,proto3" json:"configure_for_untrusted_upstream,omitempty"`
|
||||
}
|
||||
|
||||
func (x *FieldSecurityAnnotation) Reset() {
|
||||
*x = FieldSecurityAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_annotations_v3_security_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *FieldSecurityAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*FieldSecurityAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *FieldSecurityAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_annotations_v3_security_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use FieldSecurityAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*FieldSecurityAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_xds_annotations_v3_security_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *FieldSecurityAnnotation) GetConfigureForUntrustedDownstream() bool {
|
||||
if x != nil {
|
||||
return x.ConfigureForUntrustedDownstream
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *FieldSecurityAnnotation) GetConfigureForUntrustedUpstream() bool {
|
||||
if x != nil {
|
||||
return x.ConfigureForUntrustedUpstream
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var file_xds_annotations_v3_security_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtensionType: (*FieldSecurityAnnotation)(nil),
|
||||
Field: 99044135,
|
||||
Name: "xds.annotations.v3.security",
|
||||
Tag: "bytes,99044135,opt,name=security",
|
||||
Filename: "xds/annotations/v3/security.proto",
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptorpb.FieldOptions.
|
||||
var (
|
||||
// optional xds.annotations.v3.FieldSecurityAnnotation security = 99044135;
|
||||
E_Security = &file_xds_annotations_v3_security_proto_extTypes[0]
|
||||
)
|
||||
|
||||
var File_xds_annotations_v3_security_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_annotations_v3_security_proto_rawDesc = []byte{
|
||||
0x0a, 0x21, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x12, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e,
|
||||
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
|
||||
0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x01, 0x0a, 0x17, 0x46,
|
||||
0x69, 0x65, 0x6c, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x41, 0x6e, 0x6e, 0x6f,
|
||||
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4b, 0x0a, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x75, 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x75, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65,
|
||||
0x64, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x1f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x46, 0x6f, 0x72,
|
||||
0x55, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72,
|
||||
0x65, 0x61, 0x6d, 0x12, 0x47, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65,
|
||||
0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x75, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x75,
|
||||
0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1d, 0x63,
|
||||
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x46, 0x6f, 0x72, 0x55, 0x6e, 0x74, 0x72, 0x75,
|
||||
0x73, 0x74, 0x65, 0x64, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x3a, 0x69, 0x0a, 0x08,
|
||||
0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64,
|
||||
0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa7, 0x96, 0x9d, 0x2f, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x2b, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72,
|
||||
0x69, 0x74, 0x79, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x73,
|
||||
0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x42, 0x33, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08,
|
||||
0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
|
||||
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e,
|
||||
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_annotations_v3_security_proto_rawDescOnce sync.Once
|
||||
file_xds_annotations_v3_security_proto_rawDescData = file_xds_annotations_v3_security_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_annotations_v3_security_proto_rawDescGZIP() []byte {
|
||||
file_xds_annotations_v3_security_proto_rawDescOnce.Do(func() {
|
||||
file_xds_annotations_v3_security_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_annotations_v3_security_proto_rawDescData)
|
||||
})
|
||||
return file_xds_annotations_v3_security_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_annotations_v3_security_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_xds_annotations_v3_security_proto_goTypes = []interface{}{
|
||||
(*FieldSecurityAnnotation)(nil), // 0: xds.annotations.v3.FieldSecurityAnnotation
|
||||
(*descriptorpb.FieldOptions)(nil), // 1: google.protobuf.FieldOptions
|
||||
}
|
||||
var file_xds_annotations_v3_security_proto_depIdxs = []int32{
|
||||
1, // 0: xds.annotations.v3.security:extendee -> google.protobuf.FieldOptions
|
||||
0, // 1: xds.annotations.v3.security:type_name -> xds.annotations.v3.FieldSecurityAnnotation
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
1, // [1:2] is the sub-list for extension type_name
|
||||
0, // [0:1] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_annotations_v3_security_proto_init() }
|
||||
func file_xds_annotations_v3_security_proto_init() {
|
||||
if File_xds_annotations_v3_security_proto != nil {
|
||||
return
|
||||
}
|
||||
file_xds_annotations_v3_status_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_annotations_v3_security_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*FieldSecurityAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_annotations_v3_security_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 1,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_annotations_v3_security_proto_goTypes,
|
||||
DependencyIndexes: file_xds_annotations_v3_security_proto_depIdxs,
|
||||
MessageInfos: file_xds_annotations_v3_security_proto_msgTypes,
|
||||
ExtensionInfos: file_xds_annotations_v3_security_proto_extTypes,
|
||||
}.Build()
|
||||
File_xds_annotations_v3_security_proto = out.File
|
||||
file_xds_annotations_v3_security_proto_rawDesc = nil
|
||||
file_xds_annotations_v3_security_proto_goTypes = nil
|
||||
file_xds_annotations_v3_security_proto_depIdxs = nil
|
||||
}
|
||||
142
vendor/github.com/cncf/xds/go/xds/annotations/v3/security.pb.validate.go
generated
vendored
Normal file
142
vendor/github.com/cncf/xds/go/xds/annotations/v3/security.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/annotations/v3/security.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on FieldSecurityAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *FieldSecurityAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on FieldSecurityAnnotation with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// FieldSecurityAnnotationMultiError, or nil if none found.
|
||||
func (m *FieldSecurityAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *FieldSecurityAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for ConfigureForUntrustedDownstream
|
||||
|
||||
// no validation rules for ConfigureForUntrustedUpstream
|
||||
|
||||
if len(errors) > 0 {
|
||||
return FieldSecurityAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// FieldSecurityAnnotationMultiError is an error wrapping multiple validation
|
||||
// errors returned by FieldSecurityAnnotation.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type FieldSecurityAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m FieldSecurityAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m FieldSecurityAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// FieldSecurityAnnotationValidationError is the validation error returned by
|
||||
// FieldSecurityAnnotation.Validate if the designated constraints aren't met.
|
||||
type FieldSecurityAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e FieldSecurityAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e FieldSecurityAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e FieldSecurityAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e FieldSecurityAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e FieldSecurityAnnotationValidationError) ErrorName() string {
|
||||
return "FieldSecurityAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e FieldSecurityAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sFieldSecurityAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = FieldSecurityAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = FieldSecurityAnnotationValidationError{}
|
||||
93
vendor/github.com/cncf/xds/go/xds/annotations/v3/sensitive.pb.go
generated
vendored
Normal file
93
vendor/github.com/cncf/xds/go/xds/annotations/v3/sensitive.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/annotations/v3/sensitive.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
var file_xds_annotations_v3_sensitive_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtensionType: (*bool)(nil),
|
||||
Field: 61008053,
|
||||
Name: "xds.annotations.v3.sensitive",
|
||||
Tag: "varint,61008053,opt,name=sensitive",
|
||||
Filename: "xds/annotations/v3/sensitive.proto",
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptorpb.FieldOptions.
|
||||
var (
|
||||
// optional bool sensitive = 61008053;
|
||||
E_Sensitive = &file_xds_annotations_v3_sensitive_proto_extTypes[0]
|
||||
)
|
||||
|
||||
var File_xds_annotations_v3_sensitive_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_annotations_v3_sensitive_proto_rawDesc = []byte{
|
||||
0x0a, 0x22, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x33, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
|
||||
0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x3e, 0x0a, 0x09, 0x73, 0x65,
|
||||
0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f,
|
||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb5, 0xd1, 0x8b, 0x1d, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||
0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64,
|
||||
0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_xds_annotations_v3_sensitive_proto_goTypes = []interface{}{
|
||||
(*descriptorpb.FieldOptions)(nil), // 0: google.protobuf.FieldOptions
|
||||
}
|
||||
var file_xds_annotations_v3_sensitive_proto_depIdxs = []int32{
|
||||
0, // 0: xds.annotations.v3.sensitive:extendee -> google.protobuf.FieldOptions
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
0, // [0:1] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_annotations_v3_sensitive_proto_init() }
|
||||
func file_xds_annotations_v3_sensitive_proto_init() {
|
||||
if File_xds_annotations_v3_sensitive_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_annotations_v3_sensitive_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 1,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_annotations_v3_sensitive_proto_goTypes,
|
||||
DependencyIndexes: file_xds_annotations_v3_sensitive_proto_depIdxs,
|
||||
ExtensionInfos: file_xds_annotations_v3_sensitive_proto_extTypes,
|
||||
}.Build()
|
||||
File_xds_annotations_v3_sensitive_proto = out.File
|
||||
file_xds_annotations_v3_sensitive_proto_rawDesc = nil
|
||||
file_xds_annotations_v3_sensitive_proto_goTypes = nil
|
||||
file_xds_annotations_v3_sensitive_proto_depIdxs = nil
|
||||
}
|
||||
36
vendor/github.com/cncf/xds/go/xds/annotations/v3/sensitive.pb.validate.go
generated
vendored
Normal file
36
vendor/github.com/cncf/xds/go/xds/annotations/v3/sensitive.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/annotations/v3/sensitive.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
495
vendor/github.com/cncf/xds/go/xds/annotations/v3/status.pb.go
generated
vendored
Normal file
495
vendor/github.com/cncf/xds/go/xds/annotations/v3/status.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,495 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/annotations/v3/status.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type PackageVersionStatus int32
|
||||
|
||||
const (
|
||||
PackageVersionStatus_UNKNOWN PackageVersionStatus = 0
|
||||
PackageVersionStatus_FROZEN PackageVersionStatus = 1
|
||||
PackageVersionStatus_ACTIVE PackageVersionStatus = 2
|
||||
PackageVersionStatus_NEXT_MAJOR_VERSION_CANDIDATE PackageVersionStatus = 3
|
||||
)
|
||||
|
||||
// Enum value maps for PackageVersionStatus.
|
||||
var (
|
||||
PackageVersionStatus_name = map[int32]string{
|
||||
0: "UNKNOWN",
|
||||
1: "FROZEN",
|
||||
2: "ACTIVE",
|
||||
3: "NEXT_MAJOR_VERSION_CANDIDATE",
|
||||
}
|
||||
PackageVersionStatus_value = map[string]int32{
|
||||
"UNKNOWN": 0,
|
||||
"FROZEN": 1,
|
||||
"ACTIVE": 2,
|
||||
"NEXT_MAJOR_VERSION_CANDIDATE": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x PackageVersionStatus) Enum() *PackageVersionStatus {
|
||||
p := new(PackageVersionStatus)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x PackageVersionStatus) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (PackageVersionStatus) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_xds_annotations_v3_status_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (PackageVersionStatus) Type() protoreflect.EnumType {
|
||||
return &file_xds_annotations_v3_status_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x PackageVersionStatus) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PackageVersionStatus.Descriptor instead.
|
||||
func (PackageVersionStatus) EnumDescriptor() ([]byte, []int) {
|
||||
return file_xds_annotations_v3_status_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type FileStatusAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
WorkInProgress bool `protobuf:"varint,1,opt,name=work_in_progress,json=workInProgress,proto3" json:"work_in_progress,omitempty"`
|
||||
}
|
||||
|
||||
func (x *FileStatusAnnotation) Reset() {
|
||||
*x = FileStatusAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_annotations_v3_status_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *FileStatusAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*FileStatusAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *FileStatusAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_annotations_v3_status_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use FileStatusAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*FileStatusAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_xds_annotations_v3_status_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *FileStatusAnnotation) GetWorkInProgress() bool {
|
||||
if x != nil {
|
||||
return x.WorkInProgress
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type MessageStatusAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
WorkInProgress bool `protobuf:"varint,1,opt,name=work_in_progress,json=workInProgress,proto3" json:"work_in_progress,omitempty"`
|
||||
}
|
||||
|
||||
func (x *MessageStatusAnnotation) Reset() {
|
||||
*x = MessageStatusAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_annotations_v3_status_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MessageStatusAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MessageStatusAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *MessageStatusAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_annotations_v3_status_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MessageStatusAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*MessageStatusAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_xds_annotations_v3_status_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *MessageStatusAnnotation) GetWorkInProgress() bool {
|
||||
if x != nil {
|
||||
return x.WorkInProgress
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type FieldStatusAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
WorkInProgress bool `protobuf:"varint,1,opt,name=work_in_progress,json=workInProgress,proto3" json:"work_in_progress,omitempty"`
|
||||
}
|
||||
|
||||
func (x *FieldStatusAnnotation) Reset() {
|
||||
*x = FieldStatusAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_annotations_v3_status_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *FieldStatusAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*FieldStatusAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *FieldStatusAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_annotations_v3_status_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use FieldStatusAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*FieldStatusAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_xds_annotations_v3_status_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *FieldStatusAnnotation) GetWorkInProgress() bool {
|
||||
if x != nil {
|
||||
return x.WorkInProgress
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type StatusAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
WorkInProgress bool `protobuf:"varint,1,opt,name=work_in_progress,json=workInProgress,proto3" json:"work_in_progress,omitempty"`
|
||||
PackageVersionStatus PackageVersionStatus `protobuf:"varint,2,opt,name=package_version_status,json=packageVersionStatus,proto3,enum=xds.annotations.v3.PackageVersionStatus" json:"package_version_status,omitempty"`
|
||||
}
|
||||
|
||||
func (x *StatusAnnotation) Reset() {
|
||||
*x = StatusAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_annotations_v3_status_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *StatusAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StatusAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *StatusAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_annotations_v3_status_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*StatusAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_xds_annotations_v3_status_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *StatusAnnotation) GetWorkInProgress() bool {
|
||||
if x != nil {
|
||||
return x.WorkInProgress
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *StatusAnnotation) GetPackageVersionStatus() PackageVersionStatus {
|
||||
if x != nil {
|
||||
return x.PackageVersionStatus
|
||||
}
|
||||
return PackageVersionStatus_UNKNOWN
|
||||
}
|
||||
|
||||
var file_xds_annotations_v3_status_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FileOptions)(nil),
|
||||
ExtensionType: (*FileStatusAnnotation)(nil),
|
||||
Field: 226829418,
|
||||
Name: "xds.annotations.v3.file_status",
|
||||
Tag: "bytes,226829418,opt,name=file_status",
|
||||
Filename: "xds/annotations/v3/status.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.MessageOptions)(nil),
|
||||
ExtensionType: (*MessageStatusAnnotation)(nil),
|
||||
Field: 226829418,
|
||||
Name: "xds.annotations.v3.message_status",
|
||||
Tag: "bytes,226829418,opt,name=message_status",
|
||||
Filename: "xds/annotations/v3/status.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtensionType: (*FieldStatusAnnotation)(nil),
|
||||
Field: 226829418,
|
||||
Name: "xds.annotations.v3.field_status",
|
||||
Tag: "bytes,226829418,opt,name=field_status",
|
||||
Filename: "xds/annotations/v3/status.proto",
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptorpb.FileOptions.
|
||||
var (
|
||||
// optional xds.annotations.v3.FileStatusAnnotation file_status = 226829418;
|
||||
E_FileStatus = &file_xds_annotations_v3_status_proto_extTypes[0]
|
||||
)
|
||||
|
||||
// Extension fields to descriptorpb.MessageOptions.
|
||||
var (
|
||||
// optional xds.annotations.v3.MessageStatusAnnotation message_status = 226829418;
|
||||
E_MessageStatus = &file_xds_annotations_v3_status_proto_extTypes[1]
|
||||
)
|
||||
|
||||
// Extension fields to descriptorpb.FieldOptions.
|
||||
var (
|
||||
// optional xds.annotations.v3.FieldStatusAnnotation field_status = 226829418;
|
||||
E_FieldStatus = &file_xds_annotations_v3_status_proto_extTypes[2]
|
||||
)
|
||||
|
||||
var File_xds_annotations_v3_status_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_annotations_v3_status_proto_rawDesc = []byte{
|
||||
0x0a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x12, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2e, 0x76, 0x33, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
|
||||
0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x40, 0x0a, 0x14, 0x46, 0x69, 0x6c, 0x65, 0x53,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12,
|
||||
0x28, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72,
|
||||
0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x49,
|
||||
0x6e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x43, 0x0a, 0x17, 0x4d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x6e, 0x5f,
|
||||
0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e,
|
||||
0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x41,
|
||||
0x0a, 0x15, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x41, 0x6e, 0x6e,
|
||||
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x5f,
|
||||
0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73,
|
||||
0x73, 0x22, 0x9c, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x41, 0x6e, 0x6e, 0x6f,
|
||||
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69,
|
||||
0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
|
||||
0x52, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73,
|
||||
0x12, 0x5e, 0x0a, 0x16, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,
|
||||
0x32, 0x28, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 0x65, 0x72,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x14, 0x70, 0x61, 0x63, 0x6b,
|
||||
0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x2a, 0x5d, 0x0a, 0x14, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e,
|
||||
0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x52, 0x4f, 0x5a, 0x45, 0x4e, 0x10,
|
||||
0x01, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x20, 0x0a,
|
||||
0x1c, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x4d, 0x41, 0x4a, 0x4f, 0x52, 0x5f, 0x56, 0x45, 0x52, 0x53,
|
||||
0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x41, 0x4e, 0x44, 0x49, 0x44, 0x41, 0x54, 0x45, 0x10, 0x03, 0x3a,
|
||||
0x6a, 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xea, 0xc8, 0x94,
|
||||
0x6c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f,
|
||||
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
|
||||
0x0a, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x76, 0x0a, 0x0e, 0x6d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xea,
|
||||
0xc8, 0x94, 0x6c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e,
|
||||
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x3a, 0x6e, 0x0a, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x73, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x18, 0xea, 0xc8, 0x94, 0x6c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x64,
|
||||
0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x33,
|
||||
0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x41, 0x6e, 0x6e, 0x6f,
|
||||
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64,
|
||||
0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_annotations_v3_status_proto_rawDescOnce sync.Once
|
||||
file_xds_annotations_v3_status_proto_rawDescData = file_xds_annotations_v3_status_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_annotations_v3_status_proto_rawDescGZIP() []byte {
|
||||
file_xds_annotations_v3_status_proto_rawDescOnce.Do(func() {
|
||||
file_xds_annotations_v3_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_annotations_v3_status_proto_rawDescData)
|
||||
})
|
||||
return file_xds_annotations_v3_status_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_annotations_v3_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_xds_annotations_v3_status_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_xds_annotations_v3_status_proto_goTypes = []interface{}{
|
||||
(PackageVersionStatus)(0), // 0: xds.annotations.v3.PackageVersionStatus
|
||||
(*FileStatusAnnotation)(nil), // 1: xds.annotations.v3.FileStatusAnnotation
|
||||
(*MessageStatusAnnotation)(nil), // 2: xds.annotations.v3.MessageStatusAnnotation
|
||||
(*FieldStatusAnnotation)(nil), // 3: xds.annotations.v3.FieldStatusAnnotation
|
||||
(*StatusAnnotation)(nil), // 4: xds.annotations.v3.StatusAnnotation
|
||||
(*descriptorpb.FileOptions)(nil), // 5: google.protobuf.FileOptions
|
||||
(*descriptorpb.MessageOptions)(nil), // 6: google.protobuf.MessageOptions
|
||||
(*descriptorpb.FieldOptions)(nil), // 7: google.protobuf.FieldOptions
|
||||
}
|
||||
var file_xds_annotations_v3_status_proto_depIdxs = []int32{
|
||||
0, // 0: xds.annotations.v3.StatusAnnotation.package_version_status:type_name -> xds.annotations.v3.PackageVersionStatus
|
||||
5, // 1: xds.annotations.v3.file_status:extendee -> google.protobuf.FileOptions
|
||||
6, // 2: xds.annotations.v3.message_status:extendee -> google.protobuf.MessageOptions
|
||||
7, // 3: xds.annotations.v3.field_status:extendee -> google.protobuf.FieldOptions
|
||||
1, // 4: xds.annotations.v3.file_status:type_name -> xds.annotations.v3.FileStatusAnnotation
|
||||
2, // 5: xds.annotations.v3.message_status:type_name -> xds.annotations.v3.MessageStatusAnnotation
|
||||
3, // 6: xds.annotations.v3.field_status:type_name -> xds.annotations.v3.FieldStatusAnnotation
|
||||
7, // [7:7] is the sub-list for method output_type
|
||||
7, // [7:7] is the sub-list for method input_type
|
||||
4, // [4:7] is the sub-list for extension type_name
|
||||
1, // [1:4] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_annotations_v3_status_proto_init() }
|
||||
func file_xds_annotations_v3_status_proto_init() {
|
||||
if File_xds_annotations_v3_status_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_annotations_v3_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*FileStatusAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_annotations_v3_status_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MessageStatusAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_annotations_v3_status_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*FieldStatusAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_annotations_v3_status_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StatusAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_annotations_v3_status_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 3,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_annotations_v3_status_proto_goTypes,
|
||||
DependencyIndexes: file_xds_annotations_v3_status_proto_depIdxs,
|
||||
EnumInfos: file_xds_annotations_v3_status_proto_enumTypes,
|
||||
MessageInfos: file_xds_annotations_v3_status_proto_msgTypes,
|
||||
ExtensionInfos: file_xds_annotations_v3_status_proto_extTypes,
|
||||
}.Build()
|
||||
File_xds_annotations_v3_status_proto = out.File
|
||||
file_xds_annotations_v3_status_proto_rawDesc = nil
|
||||
file_xds_annotations_v3_status_proto_goTypes = nil
|
||||
file_xds_annotations_v3_status_proto_depIdxs = nil
|
||||
}
|
||||
452
vendor/github.com/cncf/xds/go/xds/annotations/v3/status.pb.validate.go
generated
vendored
Normal file
452
vendor/github.com/cncf/xds/go/xds/annotations/v3/status.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,452 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/annotations/v3/status.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on FileStatusAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *FileStatusAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on FileStatusAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// FileStatusAnnotationMultiError, or nil if none found.
|
||||
func (m *FileStatusAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *FileStatusAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for WorkInProgress
|
||||
|
||||
if len(errors) > 0 {
|
||||
return FileStatusAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// FileStatusAnnotationMultiError is an error wrapping multiple validation
|
||||
// errors returned by FileStatusAnnotation.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type FileStatusAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m FileStatusAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m FileStatusAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// FileStatusAnnotationValidationError is the validation error returned by
|
||||
// FileStatusAnnotation.Validate if the designated constraints aren't met.
|
||||
type FileStatusAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e FileStatusAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e FileStatusAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e FileStatusAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e FileStatusAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e FileStatusAnnotationValidationError) ErrorName() string {
|
||||
return "FileStatusAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e FileStatusAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sFileStatusAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = FileStatusAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = FileStatusAnnotationValidationError{}
|
||||
|
||||
// Validate checks the field values on MessageStatusAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *MessageStatusAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on MessageStatusAnnotation with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// MessageStatusAnnotationMultiError, or nil if none found.
|
||||
func (m *MessageStatusAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *MessageStatusAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for WorkInProgress
|
||||
|
||||
if len(errors) > 0 {
|
||||
return MessageStatusAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MessageStatusAnnotationMultiError is an error wrapping multiple validation
|
||||
// errors returned by MessageStatusAnnotation.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type MessageStatusAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m MessageStatusAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m MessageStatusAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// MessageStatusAnnotationValidationError is the validation error returned by
|
||||
// MessageStatusAnnotation.Validate if the designated constraints aren't met.
|
||||
type MessageStatusAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e MessageStatusAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e MessageStatusAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e MessageStatusAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e MessageStatusAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e MessageStatusAnnotationValidationError) ErrorName() string {
|
||||
return "MessageStatusAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e MessageStatusAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sMessageStatusAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = MessageStatusAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = MessageStatusAnnotationValidationError{}
|
||||
|
||||
// Validate checks the field values on FieldStatusAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *FieldStatusAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on FieldStatusAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// FieldStatusAnnotationMultiError, or nil if none found.
|
||||
func (m *FieldStatusAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *FieldStatusAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for WorkInProgress
|
||||
|
||||
if len(errors) > 0 {
|
||||
return FieldStatusAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// FieldStatusAnnotationMultiError is an error wrapping multiple validation
|
||||
// errors returned by FieldStatusAnnotation.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type FieldStatusAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m FieldStatusAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m FieldStatusAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// FieldStatusAnnotationValidationError is the validation error returned by
|
||||
// FieldStatusAnnotation.Validate if the designated constraints aren't met.
|
||||
type FieldStatusAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e FieldStatusAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e FieldStatusAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e FieldStatusAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e FieldStatusAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e FieldStatusAnnotationValidationError) ErrorName() string {
|
||||
return "FieldStatusAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e FieldStatusAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sFieldStatusAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = FieldStatusAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = FieldStatusAnnotationValidationError{}
|
||||
|
||||
// Validate checks the field values on StatusAnnotation with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
func (m *StatusAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on StatusAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// StatusAnnotationMultiError, or nil if none found.
|
||||
func (m *StatusAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *StatusAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for WorkInProgress
|
||||
|
||||
// no validation rules for PackageVersionStatus
|
||||
|
||||
if len(errors) > 0 {
|
||||
return StatusAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// StatusAnnotationMultiError is an error wrapping multiple validation errors
|
||||
// returned by StatusAnnotation.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type StatusAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m StatusAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m StatusAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// StatusAnnotationValidationError is the validation error returned by
|
||||
// StatusAnnotation.Validate if the designated constraints aren't met.
|
||||
type StatusAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e StatusAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e StatusAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e StatusAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e StatusAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e StatusAnnotationValidationError) ErrorName() string { return "StatusAnnotationValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e StatusAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sStatusAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = StatusAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = StatusAnnotationValidationError{}
|
||||
179
vendor/github.com/cncf/xds/go/xds/annotations/v3/versioning.pb.go
generated
vendored
Normal file
179
vendor/github.com/cncf/xds/go/xds/annotations/v3/versioning.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/annotations/v3/versioning.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type VersioningAnnotation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
PreviousMessageType string `protobuf:"bytes,1,opt,name=previous_message_type,json=previousMessageType,proto3" json:"previous_message_type,omitempty"`
|
||||
}
|
||||
|
||||
func (x *VersioningAnnotation) Reset() {
|
||||
*x = VersioningAnnotation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_annotations_v3_versioning_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *VersioningAnnotation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*VersioningAnnotation) ProtoMessage() {}
|
||||
|
||||
func (x *VersioningAnnotation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_annotations_v3_versioning_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use VersioningAnnotation.ProtoReflect.Descriptor instead.
|
||||
func (*VersioningAnnotation) Descriptor() ([]byte, []int) {
|
||||
return file_xds_annotations_v3_versioning_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *VersioningAnnotation) GetPreviousMessageType() string {
|
||||
if x != nil {
|
||||
return x.PreviousMessageType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var file_xds_annotations_v3_versioning_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptorpb.MessageOptions)(nil),
|
||||
ExtensionType: (*VersioningAnnotation)(nil),
|
||||
Field: 92389011,
|
||||
Name: "xds.annotations.v3.versioning",
|
||||
Tag: "bytes,92389011,opt,name=versioning",
|
||||
Filename: "xds/annotations/v3/versioning.proto",
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptorpb.MessageOptions.
|
||||
var (
|
||||
// optional xds.annotations.v3.VersioningAnnotation versioning = 92389011;
|
||||
E_Versioning = &file_xds_annotations_v3_versioning_proto_extTypes[0]
|
||||
)
|
||||
|
||||
var File_xds_annotations_v3_versioning_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_annotations_v3_versioning_proto_rawDesc = []byte{
|
||||
0x0a, 0x23, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x2f, 0x76, 0x33, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x33, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||
0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72,
|
||||
0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4a, 0x0a, 0x14, 0x56,
|
||||
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f,
|
||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x13, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x6c, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f,
|
||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x93, 0xfd, 0x86, 0x2c, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x28, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x2e, 0x76, 0x33, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x41,
|
||||
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f,
|
||||
0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f,
|
||||
0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_annotations_v3_versioning_proto_rawDescOnce sync.Once
|
||||
file_xds_annotations_v3_versioning_proto_rawDescData = file_xds_annotations_v3_versioning_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_annotations_v3_versioning_proto_rawDescGZIP() []byte {
|
||||
file_xds_annotations_v3_versioning_proto_rawDescOnce.Do(func() {
|
||||
file_xds_annotations_v3_versioning_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_annotations_v3_versioning_proto_rawDescData)
|
||||
})
|
||||
return file_xds_annotations_v3_versioning_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_annotations_v3_versioning_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_xds_annotations_v3_versioning_proto_goTypes = []interface{}{
|
||||
(*VersioningAnnotation)(nil), // 0: xds.annotations.v3.VersioningAnnotation
|
||||
(*descriptorpb.MessageOptions)(nil), // 1: google.protobuf.MessageOptions
|
||||
}
|
||||
var file_xds_annotations_v3_versioning_proto_depIdxs = []int32{
|
||||
1, // 0: xds.annotations.v3.versioning:extendee -> google.protobuf.MessageOptions
|
||||
0, // 1: xds.annotations.v3.versioning:type_name -> xds.annotations.v3.VersioningAnnotation
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
1, // [1:2] is the sub-list for extension type_name
|
||||
0, // [0:1] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_annotations_v3_versioning_proto_init() }
|
||||
func file_xds_annotations_v3_versioning_proto_init() {
|
||||
if File_xds_annotations_v3_versioning_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_annotations_v3_versioning_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*VersioningAnnotation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_annotations_v3_versioning_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 1,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_annotations_v3_versioning_proto_goTypes,
|
||||
DependencyIndexes: file_xds_annotations_v3_versioning_proto_depIdxs,
|
||||
MessageInfos: file_xds_annotations_v3_versioning_proto_msgTypes,
|
||||
ExtensionInfos: file_xds_annotations_v3_versioning_proto_extTypes,
|
||||
}.Build()
|
||||
File_xds_annotations_v3_versioning_proto = out.File
|
||||
file_xds_annotations_v3_versioning_proto_rawDesc = nil
|
||||
file_xds_annotations_v3_versioning_proto_goTypes = nil
|
||||
file_xds_annotations_v3_versioning_proto_depIdxs = nil
|
||||
}
|
||||
140
vendor/github.com/cncf/xds/go/xds/annotations/v3/versioning.pb.validate.go
generated
vendored
Normal file
140
vendor/github.com/cncf/xds/go/xds/annotations/v3/versioning.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/annotations/v3/versioning.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on VersioningAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *VersioningAnnotation) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on VersioningAnnotation with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// VersioningAnnotationMultiError, or nil if none found.
|
||||
func (m *VersioningAnnotation) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *VersioningAnnotation) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for PreviousMessageType
|
||||
|
||||
if len(errors) > 0 {
|
||||
return VersioningAnnotationMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// VersioningAnnotationMultiError is an error wrapping multiple validation
|
||||
// errors returned by VersioningAnnotation.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type VersioningAnnotationMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m VersioningAnnotationMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m VersioningAnnotationMultiError) AllErrors() []error { return m }
|
||||
|
||||
// VersioningAnnotationValidationError is the validation error returned by
|
||||
// VersioningAnnotation.Validate if the designated constraints aren't met.
|
||||
type VersioningAnnotationValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e VersioningAnnotationValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e VersioningAnnotationValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e VersioningAnnotationValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e VersioningAnnotationValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e VersioningAnnotationValidationError) ErrorName() string {
|
||||
return "VersioningAnnotationValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e VersioningAnnotationValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sVersioningAnnotation.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = VersioningAnnotationValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = VersioningAnnotationValidationError{}
|
||||
153
vendor/github.com/cncf/xds/go/xds/core/v3/authority.pb.go
generated
vendored
Normal file
153
vendor/github.com/cncf/xds/go/xds/core/v3/authority.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/core/v3/authority.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/cncf/xds/go/xds/annotations/v3"
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Authority struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Authority) Reset() {
|
||||
*x = Authority{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_core_v3_authority_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Authority) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authority) ProtoMessage() {}
|
||||
|
||||
func (x *Authority) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_core_v3_authority_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authority.ProtoReflect.Descriptor instead.
|
||||
func (*Authority) Descriptor() ([]byte, []int) {
|
||||
return file_xds_core_v3_authority_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Authority) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_xds_core_v3_authority_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_core_v3_authority_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x75,
|
||||
0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x78,
|
||||
0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f,
|
||||
0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c,
|
||||
0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74,
|
||||
0x79, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
|
||||
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x56,
|
||||
0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33,
|
||||
0x42, 0x0e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63,
|
||||
0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63,
|
||||
0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_core_v3_authority_proto_rawDescOnce sync.Once
|
||||
file_xds_core_v3_authority_proto_rawDescData = file_xds_core_v3_authority_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_core_v3_authority_proto_rawDescGZIP() []byte {
|
||||
file_xds_core_v3_authority_proto_rawDescOnce.Do(func() {
|
||||
file_xds_core_v3_authority_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_core_v3_authority_proto_rawDescData)
|
||||
})
|
||||
return file_xds_core_v3_authority_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_core_v3_authority_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_xds_core_v3_authority_proto_goTypes = []interface{}{
|
||||
(*Authority)(nil), // 0: xds.core.v3.Authority
|
||||
}
|
||||
var file_xds_core_v3_authority_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_core_v3_authority_proto_init() }
|
||||
func file_xds_core_v3_authority_proto_init() {
|
||||
if File_xds_core_v3_authority_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_core_v3_authority_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Authority); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_core_v3_authority_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_core_v3_authority_proto_goTypes,
|
||||
DependencyIndexes: file_xds_core_v3_authority_proto_depIdxs,
|
||||
MessageInfos: file_xds_core_v3_authority_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_core_v3_authority_proto = out.File
|
||||
file_xds_core_v3_authority_proto_rawDesc = nil
|
||||
file_xds_core_v3_authority_proto_goTypes = nil
|
||||
file_xds_core_v3_authority_proto_depIdxs = nil
|
||||
}
|
||||
146
vendor/github.com/cncf/xds/go/xds/core/v3/authority.pb.validate.go
generated
vendored
Normal file
146
vendor/github.com/cncf/xds/go/xds/core/v3/authority.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/core/v3/authority.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on Authority with the rules defined in the
|
||||
// proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *Authority) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on Authority with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in AuthorityMultiError, or nil
|
||||
// if none found.
|
||||
func (m *Authority) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *Authority) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if utf8.RuneCountInString(m.GetName()) < 1 {
|
||||
err := AuthorityValidationError{
|
||||
field: "Name",
|
||||
reason: "value length must be at least 1 runes",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return AuthorityMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// AuthorityMultiError is an error wrapping multiple validation errors returned
|
||||
// by Authority.ValidateAll() if the designated constraints aren't met.
|
||||
type AuthorityMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m AuthorityMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m AuthorityMultiError) AllErrors() []error { return m }
|
||||
|
||||
// AuthorityValidationError is the validation error returned by
|
||||
// Authority.Validate if the designated constraints aren't met.
|
||||
type AuthorityValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e AuthorityValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e AuthorityValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e AuthorityValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e AuthorityValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e AuthorityValidationError) ErrorName() string { return "AuthorityValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e AuthorityValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sAuthority.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = AuthorityValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = AuthorityValidationError{}
|
||||
172
vendor/github.com/cncf/xds/go/xds/core/v3/cidr.pb.go
generated
vendored
Normal file
172
vendor/github.com/cncf/xds/go/xds/core/v3/cidr.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/core/v3/cidr.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/cncf/xds/go/xds/annotations/v3"
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type CidrRange struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
AddressPrefix string `protobuf:"bytes,1,opt,name=address_prefix,json=addressPrefix,proto3" json:"address_prefix,omitempty"`
|
||||
PrefixLen *wrapperspb.UInt32Value `protobuf:"bytes,2,opt,name=prefix_len,json=prefixLen,proto3" json:"prefix_len,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CidrRange) Reset() {
|
||||
*x = CidrRange{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_core_v3_cidr_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CidrRange) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CidrRange) ProtoMessage() {}
|
||||
|
||||
func (x *CidrRange) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_core_v3_cidr_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CidrRange.ProtoReflect.Descriptor instead.
|
||||
func (*CidrRange) Descriptor() ([]byte, []int) {
|
||||
return file_xds_core_v3_cidr_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CidrRange) GetAddressPrefix() string {
|
||||
if x != nil {
|
||||
return x.AddressPrefix
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CidrRange) GetPrefixLen() *wrapperspb.UInt32Value {
|
||||
if x != nil {
|
||||
return x.PrefixLen
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_xds_core_v3_cidr_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_core_v3_cidr_proto_rawDesc = []byte{
|
||||
0x0a, 0x16, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x69,
|
||||
0x64, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f,
|
||||
0x72, 0x65, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
|
||||
0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0x82, 0x01, 0x0a, 0x09, 0x43, 0x69, 0x64, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2e, 0x0a,
|
||||
0x0e, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0d,
|
||||
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x45, 0x0a,
|
||||
0x0a, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42,
|
||||
0x08, 0xfa, 0x42, 0x05, 0x2a, 0x03, 0x18, 0x80, 0x01, 0x52, 0x09, 0x70, 0x72, 0x65, 0x66, 0x69,
|
||||
0x78, 0x4c, 0x65, 0x6e, 0x42, 0x56, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16,
|
||||
0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63,
|
||||
0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x0e, 0x43, 0x69, 0x64, 0x72, 0x52, 0x61, 0x6e, 0x67,
|
||||
0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f,
|
||||
0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_core_v3_cidr_proto_rawDescOnce sync.Once
|
||||
file_xds_core_v3_cidr_proto_rawDescData = file_xds_core_v3_cidr_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_core_v3_cidr_proto_rawDescGZIP() []byte {
|
||||
file_xds_core_v3_cidr_proto_rawDescOnce.Do(func() {
|
||||
file_xds_core_v3_cidr_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_core_v3_cidr_proto_rawDescData)
|
||||
})
|
||||
return file_xds_core_v3_cidr_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_core_v3_cidr_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_xds_core_v3_cidr_proto_goTypes = []interface{}{
|
||||
(*CidrRange)(nil), // 0: xds.core.v3.CidrRange
|
||||
(*wrapperspb.UInt32Value)(nil), // 1: google.protobuf.UInt32Value
|
||||
}
|
||||
var file_xds_core_v3_cidr_proto_depIdxs = []int32{
|
||||
1, // 0: xds.core.v3.CidrRange.prefix_len:type_name -> google.protobuf.UInt32Value
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_core_v3_cidr_proto_init() }
|
||||
func file_xds_core_v3_cidr_proto_init() {
|
||||
if File_xds_core_v3_cidr_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_core_v3_cidr_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CidrRange); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_core_v3_cidr_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_core_v3_cidr_proto_goTypes,
|
||||
DependencyIndexes: file_xds_core_v3_cidr_proto_depIdxs,
|
||||
MessageInfos: file_xds_core_v3_cidr_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_core_v3_cidr_proto = out.File
|
||||
file_xds_core_v3_cidr_proto_rawDesc = nil
|
||||
file_xds_core_v3_cidr_proto_goTypes = nil
|
||||
file_xds_core_v3_cidr_proto_depIdxs = nil
|
||||
}
|
||||
161
vendor/github.com/cncf/xds/go/xds/core/v3/cidr.pb.validate.go
generated
vendored
Normal file
161
vendor/github.com/cncf/xds/go/xds/core/v3/cidr.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/core/v3/cidr.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on CidrRange with the rules defined in the
|
||||
// proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *CidrRange) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on CidrRange with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in CidrRangeMultiError, or nil
|
||||
// if none found.
|
||||
func (m *CidrRange) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *CidrRange) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if utf8.RuneCountInString(m.GetAddressPrefix()) < 1 {
|
||||
err := CidrRangeValidationError{
|
||||
field: "AddressPrefix",
|
||||
reason: "value length must be at least 1 runes",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if wrapper := m.GetPrefixLen(); wrapper != nil {
|
||||
|
||||
if wrapper.GetValue() > 128 {
|
||||
err := CidrRangeValidationError{
|
||||
field: "PrefixLen",
|
||||
reason: "value must be less than or equal to 128",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return CidrRangeMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CidrRangeMultiError is an error wrapping multiple validation errors returned
|
||||
// by CidrRange.ValidateAll() if the designated constraints aren't met.
|
||||
type CidrRangeMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m CidrRangeMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m CidrRangeMultiError) AllErrors() []error { return m }
|
||||
|
||||
// CidrRangeValidationError is the validation error returned by
|
||||
// CidrRange.Validate if the designated constraints aren't met.
|
||||
type CidrRangeValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e CidrRangeValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e CidrRangeValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e CidrRangeValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e CidrRangeValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e CidrRangeValidationError) ErrorName() string { return "CidrRangeValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e CidrRangeValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sCidrRange.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = CidrRangeValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = CidrRangeValidationError{}
|
||||
297
vendor/github.com/cncf/xds/go/xds/core/v3/collection_entry.pb.go
generated
vendored
Normal file
297
vendor/github.com/cncf/xds/go/xds/core/v3/collection_entry.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,297 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/core/v3/collection_entry.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/cncf/xds/go/xds/annotations/v3"
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
anypb "google.golang.org/protobuf/types/known/anypb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type CollectionEntry struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to ResourceSpecifier:
|
||||
//
|
||||
// *CollectionEntry_Locator
|
||||
// *CollectionEntry_InlineEntry_
|
||||
ResourceSpecifier isCollectionEntry_ResourceSpecifier `protobuf_oneof:"resource_specifier"`
|
||||
}
|
||||
|
||||
func (x *CollectionEntry) Reset() {
|
||||
*x = CollectionEntry{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_core_v3_collection_entry_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CollectionEntry) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CollectionEntry) ProtoMessage() {}
|
||||
|
||||
func (x *CollectionEntry) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_core_v3_collection_entry_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CollectionEntry.ProtoReflect.Descriptor instead.
|
||||
func (*CollectionEntry) Descriptor() ([]byte, []int) {
|
||||
return file_xds_core_v3_collection_entry_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (m *CollectionEntry) GetResourceSpecifier() isCollectionEntry_ResourceSpecifier {
|
||||
if m != nil {
|
||||
return m.ResourceSpecifier
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CollectionEntry) GetLocator() *ResourceLocator {
|
||||
if x, ok := x.GetResourceSpecifier().(*CollectionEntry_Locator); ok {
|
||||
return x.Locator
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CollectionEntry) GetInlineEntry() *CollectionEntry_InlineEntry {
|
||||
if x, ok := x.GetResourceSpecifier().(*CollectionEntry_InlineEntry_); ok {
|
||||
return x.InlineEntry
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isCollectionEntry_ResourceSpecifier interface {
|
||||
isCollectionEntry_ResourceSpecifier()
|
||||
}
|
||||
|
||||
type CollectionEntry_Locator struct {
|
||||
Locator *ResourceLocator `protobuf:"bytes,1,opt,name=locator,proto3,oneof"`
|
||||
}
|
||||
|
||||
type CollectionEntry_InlineEntry_ struct {
|
||||
InlineEntry *CollectionEntry_InlineEntry `protobuf:"bytes,2,opt,name=inline_entry,json=inlineEntry,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*CollectionEntry_Locator) isCollectionEntry_ResourceSpecifier() {}
|
||||
|
||||
func (*CollectionEntry_InlineEntry_) isCollectionEntry_ResourceSpecifier() {}
|
||||
|
||||
type CollectionEntry_InlineEntry struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
|
||||
Resource *anypb.Any `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CollectionEntry_InlineEntry) Reset() {
|
||||
*x = CollectionEntry_InlineEntry{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_core_v3_collection_entry_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CollectionEntry_InlineEntry) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CollectionEntry_InlineEntry) ProtoMessage() {}
|
||||
|
||||
func (x *CollectionEntry_InlineEntry) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_core_v3_collection_entry_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CollectionEntry_InlineEntry.ProtoReflect.Descriptor instead.
|
||||
func (*CollectionEntry_InlineEntry) Descriptor() ([]byte, []int) {
|
||||
return file_xds_core_v3_collection_entry_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *CollectionEntry_InlineEntry) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CollectionEntry_InlineEntry) GetVersion() string {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CollectionEntry_InlineEntry) GetResource() *anypb.Any {
|
||||
if x != nil {
|
||||
return x.Resource
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_xds_core_v3_collection_entry_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_core_v3_collection_entry_proto_rawDesc = []byte{
|
||||
0x0a, 0x22, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f,
|
||||
0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76,
|
||||
0x33, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x78, 0x64,
|
||||
0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33,
|
||||
0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x78,
|
||||
0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75,
|
||||
0x72, 0x63, 0x65, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69,
|
||||
0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x02, 0x0a, 0x0f, 0x43,
|
||||
0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x38,
|
||||
0x0a, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x1c, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65,
|
||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x00, 0x52,
|
||||
0x07, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x4d, 0x0a, 0x0c, 0x69, 0x6e, 0x6c, 0x69,
|
||||
0x6e, 0x65, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28,
|
||||
0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6c,
|
||||
0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x49, 0x6e, 0x6c,
|
||||
0x69, 0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x69, 0x6e, 0x6c, 0x69,
|
||||
0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x1a, 0x8b, 0x01, 0x0a, 0x0b, 0x49, 0x6e, 0x6c, 0x69,
|
||||
0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1c, 0xfa, 0x42, 0x19, 0x72, 0x17, 0x32, 0x15, 0x5e, 0x5b,
|
||||
0x30, 0x2d, 0x39, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x5f, 0x5c, 0x2d, 0x5c, 0x2e, 0x7e, 0x3a,
|
||||
0x5d, 0x2b, 0x24, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x72, 0x65, 0x73,
|
||||
0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x19, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x03, 0xf8, 0x42, 0x01,
|
||||
0x42, 0x5c, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e,
|
||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e,
|
||||
0x76, 0x33, 0x42, 0x14, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e,
|
||||
0x74, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68,
|
||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f,
|
||||
0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_core_v3_collection_entry_proto_rawDescOnce sync.Once
|
||||
file_xds_core_v3_collection_entry_proto_rawDescData = file_xds_core_v3_collection_entry_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_core_v3_collection_entry_proto_rawDescGZIP() []byte {
|
||||
file_xds_core_v3_collection_entry_proto_rawDescOnce.Do(func() {
|
||||
file_xds_core_v3_collection_entry_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_core_v3_collection_entry_proto_rawDescData)
|
||||
})
|
||||
return file_xds_core_v3_collection_entry_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_core_v3_collection_entry_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_xds_core_v3_collection_entry_proto_goTypes = []interface{}{
|
||||
(*CollectionEntry)(nil), // 0: xds.core.v3.CollectionEntry
|
||||
(*CollectionEntry_InlineEntry)(nil), // 1: xds.core.v3.CollectionEntry.InlineEntry
|
||||
(*ResourceLocator)(nil), // 2: xds.core.v3.ResourceLocator
|
||||
(*anypb.Any)(nil), // 3: google.protobuf.Any
|
||||
}
|
||||
var file_xds_core_v3_collection_entry_proto_depIdxs = []int32{
|
||||
2, // 0: xds.core.v3.CollectionEntry.locator:type_name -> xds.core.v3.ResourceLocator
|
||||
1, // 1: xds.core.v3.CollectionEntry.inline_entry:type_name -> xds.core.v3.CollectionEntry.InlineEntry
|
||||
3, // 2: xds.core.v3.CollectionEntry.InlineEntry.resource:type_name -> google.protobuf.Any
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_core_v3_collection_entry_proto_init() }
|
||||
func file_xds_core_v3_collection_entry_proto_init() {
|
||||
if File_xds_core_v3_collection_entry_proto != nil {
|
||||
return
|
||||
}
|
||||
file_xds_core_v3_resource_locator_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_core_v3_collection_entry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CollectionEntry); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_core_v3_collection_entry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CollectionEntry_InlineEntry); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_xds_core_v3_collection_entry_proto_msgTypes[0].OneofWrappers = []interface{}{
|
||||
(*CollectionEntry_Locator)(nil),
|
||||
(*CollectionEntry_InlineEntry_)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_core_v3_collection_entry_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_core_v3_collection_entry_proto_goTypes,
|
||||
DependencyIndexes: file_xds_core_v3_collection_entry_proto_depIdxs,
|
||||
MessageInfos: file_xds_core_v3_collection_entry_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_core_v3_collection_entry_proto = out.File
|
||||
file_xds_core_v3_collection_entry_proto_rawDesc = nil
|
||||
file_xds_core_v3_collection_entry_proto_goTypes = nil
|
||||
file_xds_core_v3_collection_entry_proto_depIdxs = nil
|
||||
}
|
||||
383
vendor/github.com/cncf/xds/go/xds/core/v3/collection_entry.pb.validate.go
generated
vendored
Normal file
383
vendor/github.com/cncf/xds/go/xds/core/v3/collection_entry.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,383 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/core/v3/collection_entry.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on CollectionEntry with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
func (m *CollectionEntry) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on CollectionEntry with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// CollectionEntryMultiError, or nil if none found.
|
||||
func (m *CollectionEntry) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *CollectionEntry) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
oneofResourceSpecifierPresent := false
|
||||
switch v := m.ResourceSpecifier.(type) {
|
||||
case *CollectionEntry_Locator:
|
||||
if v == nil {
|
||||
err := CollectionEntryValidationError{
|
||||
field: "ResourceSpecifier",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
oneofResourceSpecifierPresent = true
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetLocator()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, CollectionEntryValidationError{
|
||||
field: "Locator",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, CollectionEntryValidationError{
|
||||
field: "Locator",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetLocator()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return CollectionEntryValidationError{
|
||||
field: "Locator",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case *CollectionEntry_InlineEntry_:
|
||||
if v == nil {
|
||||
err := CollectionEntryValidationError{
|
||||
field: "ResourceSpecifier",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
oneofResourceSpecifierPresent = true
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetInlineEntry()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, CollectionEntryValidationError{
|
||||
field: "InlineEntry",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, CollectionEntryValidationError{
|
||||
field: "InlineEntry",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetInlineEntry()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return CollectionEntryValidationError{
|
||||
field: "InlineEntry",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
_ = v // ensures v is used
|
||||
}
|
||||
if !oneofResourceSpecifierPresent {
|
||||
err := CollectionEntryValidationError{
|
||||
field: "ResourceSpecifier",
|
||||
reason: "value is required",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return CollectionEntryMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CollectionEntryMultiError is an error wrapping multiple validation errors
|
||||
// returned by CollectionEntry.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type CollectionEntryMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m CollectionEntryMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m CollectionEntryMultiError) AllErrors() []error { return m }
|
||||
|
||||
// CollectionEntryValidationError is the validation error returned by
|
||||
// CollectionEntry.Validate if the designated constraints aren't met.
|
||||
type CollectionEntryValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e CollectionEntryValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e CollectionEntryValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e CollectionEntryValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e CollectionEntryValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e CollectionEntryValidationError) ErrorName() string { return "CollectionEntryValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e CollectionEntryValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sCollectionEntry.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = CollectionEntryValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = CollectionEntryValidationError{}
|
||||
|
||||
// Validate checks the field values on CollectionEntry_InlineEntry with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *CollectionEntry_InlineEntry) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on CollectionEntry_InlineEntry with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// CollectionEntry_InlineEntryMultiError, or nil if none found.
|
||||
func (m *CollectionEntry_InlineEntry) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *CollectionEntry_InlineEntry) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if !_CollectionEntry_InlineEntry_Name_Pattern.MatchString(m.GetName()) {
|
||||
err := CollectionEntry_InlineEntryValidationError{
|
||||
field: "Name",
|
||||
reason: "value does not match regex pattern \"^[0-9a-zA-Z_\\\\-\\\\.~:]+$\"",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
// no validation rules for Version
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetResource()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, CollectionEntry_InlineEntryValidationError{
|
||||
field: "Resource",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, CollectionEntry_InlineEntryValidationError{
|
||||
field: "Resource",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return CollectionEntry_InlineEntryValidationError{
|
||||
field: "Resource",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return CollectionEntry_InlineEntryMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CollectionEntry_InlineEntryMultiError is an error wrapping multiple
|
||||
// validation errors returned by CollectionEntry_InlineEntry.ValidateAll() if
|
||||
// the designated constraints aren't met.
|
||||
type CollectionEntry_InlineEntryMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m CollectionEntry_InlineEntryMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m CollectionEntry_InlineEntryMultiError) AllErrors() []error { return m }
|
||||
|
||||
// CollectionEntry_InlineEntryValidationError is the validation error returned
|
||||
// by CollectionEntry_InlineEntry.Validate if the designated constraints
|
||||
// aren't met.
|
||||
type CollectionEntry_InlineEntryValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e CollectionEntry_InlineEntryValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e CollectionEntry_InlineEntryValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e CollectionEntry_InlineEntryValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e CollectionEntry_InlineEntryValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e CollectionEntry_InlineEntryValidationError) ErrorName() string {
|
||||
return "CollectionEntry_InlineEntryValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e CollectionEntry_InlineEntryValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sCollectionEntry_InlineEntry.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = CollectionEntry_InlineEntryValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = CollectionEntry_InlineEntryValidationError{}
|
||||
|
||||
var _CollectionEntry_InlineEntry_Name_Pattern = regexp.MustCompile("^[0-9a-zA-Z_\\-\\.~:]+$")
|
||||
160
vendor/github.com/cncf/xds/go/xds/core/v3/context_params.pb.go
generated
vendored
Normal file
160
vendor/github.com/cncf/xds/go/xds/core/v3/context_params.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/core/v3/context_params.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/cncf/xds/go/xds/annotations/v3"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ContextParams struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Params map[string]string `protobuf:"bytes,1,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
}
|
||||
|
||||
func (x *ContextParams) Reset() {
|
||||
*x = ContextParams{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_core_v3_context_params_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ContextParams) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ContextParams) ProtoMessage() {}
|
||||
|
||||
func (x *ContextParams) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_core_v3_context_params_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ContextParams.ProtoReflect.Descriptor instead.
|
||||
func (*ContextParams) Descriptor() ([]byte, []int) {
|
||||
return file_xds_core_v3_context_params_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ContextParams) GetParams() map[string]string {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_xds_core_v3_context_params_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_core_v3_context_params_proto_rawDesc = []byte{
|
||||
0x0a, 0x20, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f,
|
||||
0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x0b, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x1a,
|
||||
0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x22, 0x8a, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x72, 0x61,
|
||||
0x6d, 0x73, 0x12, 0x3e, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33,
|
||||
0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x50,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61,
|
||||
0x6d, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72,
|
||||
0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x5a, 0xd2,
|
||||
0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74,
|
||||
0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42,
|
||||
0x12, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64,
|
||||
0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_core_v3_context_params_proto_rawDescOnce sync.Once
|
||||
file_xds_core_v3_context_params_proto_rawDescData = file_xds_core_v3_context_params_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_core_v3_context_params_proto_rawDescGZIP() []byte {
|
||||
file_xds_core_v3_context_params_proto_rawDescOnce.Do(func() {
|
||||
file_xds_core_v3_context_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_core_v3_context_params_proto_rawDescData)
|
||||
})
|
||||
return file_xds_core_v3_context_params_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_core_v3_context_params_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_xds_core_v3_context_params_proto_goTypes = []interface{}{
|
||||
(*ContextParams)(nil), // 0: xds.core.v3.ContextParams
|
||||
nil, // 1: xds.core.v3.ContextParams.ParamsEntry
|
||||
}
|
||||
var file_xds_core_v3_context_params_proto_depIdxs = []int32{
|
||||
1, // 0: xds.core.v3.ContextParams.params:type_name -> xds.core.v3.ContextParams.ParamsEntry
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_core_v3_context_params_proto_init() }
|
||||
func file_xds_core_v3_context_params_proto_init() {
|
||||
if File_xds_core_v3_context_params_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_core_v3_context_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ContextParams); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_core_v3_context_params_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_core_v3_context_params_proto_goTypes,
|
||||
DependencyIndexes: file_xds_core_v3_context_params_proto_depIdxs,
|
||||
MessageInfos: file_xds_core_v3_context_params_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_core_v3_context_params_proto = out.File
|
||||
file_xds_core_v3_context_params_proto_rawDesc = nil
|
||||
file_xds_core_v3_context_params_proto_goTypes = nil
|
||||
file_xds_core_v3_context_params_proto_depIdxs = nil
|
||||
}
|
||||
138
vendor/github.com/cncf/xds/go/xds/core/v3/context_params.pb.validate.go
generated
vendored
Normal file
138
vendor/github.com/cncf/xds/go/xds/core/v3/context_params.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/core/v3/context_params.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on ContextParams with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *ContextParams) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on ContextParams with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in ContextParamsMultiError, or
|
||||
// nil if none found.
|
||||
func (m *ContextParams) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *ContextParams) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for Params
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ContextParamsMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextParamsMultiError is an error wrapping multiple validation errors
|
||||
// returned by ContextParams.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type ContextParamsMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ContextParamsMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ContextParamsMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ContextParamsValidationError is the validation error returned by
|
||||
// ContextParams.Validate if the designated constraints aren't met.
|
||||
type ContextParamsValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ContextParamsValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ContextParamsValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ContextParamsValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ContextParamsValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ContextParamsValidationError) ErrorName() string { return "ContextParamsValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ContextParamsValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sContextParams.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ContextParamsValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ContextParamsValidationError{}
|
||||
167
vendor/github.com/cncf/xds/go/xds/core/v3/extension.pb.go
generated
vendored
Normal file
167
vendor/github.com/cncf/xds/go/xds/core/v3/extension.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/core/v3/extension.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
anypb "google.golang.org/protobuf/types/known/anypb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type TypedExtensionConfig struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
TypedConfig *anypb.Any `protobuf:"bytes,2,opt,name=typed_config,json=typedConfig,proto3" json:"typed_config,omitempty"`
|
||||
}
|
||||
|
||||
func (x *TypedExtensionConfig) Reset() {
|
||||
*x = TypedExtensionConfig{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_core_v3_extension_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TypedExtensionConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TypedExtensionConfig) ProtoMessage() {}
|
||||
|
||||
func (x *TypedExtensionConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_core_v3_extension_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TypedExtensionConfig.ProtoReflect.Descriptor instead.
|
||||
func (*TypedExtensionConfig) Descriptor() ([]byte, []int) {
|
||||
return file_xds_core_v3_extension_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *TypedExtensionConfig) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TypedExtensionConfig) GetTypedConfig() *anypb.Any {
|
||||
if x != nil {
|
||||
return x.TypedConfig
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_xds_core_v3_extension_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_core_v3_extension_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x78,
|
||||
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x78,
|
||||
0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69,
|
||||
0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x76,
|
||||
0x0a, 0x14, 0x54, 0x79, 0x70, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e,
|
||||
0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42,
|
||||
0x08, 0xfa, 0x42, 0x05, 0xa2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x64,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x4e, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33,
|
||||
0x42, 0x0e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63,
|
||||
0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63,
|
||||
0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_core_v3_extension_proto_rawDescOnce sync.Once
|
||||
file_xds_core_v3_extension_proto_rawDescData = file_xds_core_v3_extension_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_core_v3_extension_proto_rawDescGZIP() []byte {
|
||||
file_xds_core_v3_extension_proto_rawDescOnce.Do(func() {
|
||||
file_xds_core_v3_extension_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_core_v3_extension_proto_rawDescData)
|
||||
})
|
||||
return file_xds_core_v3_extension_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_core_v3_extension_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_xds_core_v3_extension_proto_goTypes = []interface{}{
|
||||
(*TypedExtensionConfig)(nil), // 0: xds.core.v3.TypedExtensionConfig
|
||||
(*anypb.Any)(nil), // 1: google.protobuf.Any
|
||||
}
|
||||
var file_xds_core_v3_extension_proto_depIdxs = []int32{
|
||||
1, // 0: xds.core.v3.TypedExtensionConfig.typed_config:type_name -> google.protobuf.Any
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_core_v3_extension_proto_init() }
|
||||
func file_xds_core_v3_extension_proto_init() {
|
||||
if File_xds_core_v3_extension_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_core_v3_extension_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TypedExtensionConfig); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_core_v3_extension_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_core_v3_extension_proto_goTypes,
|
||||
DependencyIndexes: file_xds_core_v3_extension_proto_depIdxs,
|
||||
MessageInfos: file_xds_core_v3_extension_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_core_v3_extension_proto = out.File
|
||||
file_xds_core_v3_extension_proto_rawDesc = nil
|
||||
file_xds_core_v3_extension_proto_goTypes = nil
|
||||
file_xds_core_v3_extension_proto_depIdxs = nil
|
||||
}
|
||||
164
vendor/github.com/cncf/xds/go/xds/core/v3/extension.pb.validate.go
generated
vendored
Normal file
164
vendor/github.com/cncf/xds/go/xds/core/v3/extension.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/core/v3/extension.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on TypedExtensionConfig with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *TypedExtensionConfig) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on TypedExtensionConfig with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// TypedExtensionConfigMultiError, or nil if none found.
|
||||
func (m *TypedExtensionConfig) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *TypedExtensionConfig) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if utf8.RuneCountInString(m.GetName()) < 1 {
|
||||
err := TypedExtensionConfigValidationError{
|
||||
field: "Name",
|
||||
reason: "value length must be at least 1 runes",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if m.GetTypedConfig() == nil {
|
||||
err := TypedExtensionConfigValidationError{
|
||||
field: "TypedConfig",
|
||||
reason: "value is required",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if a := m.GetTypedConfig(); a != nil {
|
||||
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return TypedExtensionConfigMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// TypedExtensionConfigMultiError is an error wrapping multiple validation
|
||||
// errors returned by TypedExtensionConfig.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type TypedExtensionConfigMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m TypedExtensionConfigMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m TypedExtensionConfigMultiError) AllErrors() []error { return m }
|
||||
|
||||
// TypedExtensionConfigValidationError is the validation error returned by
|
||||
// TypedExtensionConfig.Validate if the designated constraints aren't met.
|
||||
type TypedExtensionConfigValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e TypedExtensionConfigValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e TypedExtensionConfigValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e TypedExtensionConfigValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e TypedExtensionConfigValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e TypedExtensionConfigValidationError) ErrorName() string {
|
||||
return "TypedExtensionConfigValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e TypedExtensionConfigValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sTypedExtensionConfig.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = TypedExtensionConfigValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = TypedExtensionConfigValidationError{}
|
||||
182
vendor/github.com/cncf/xds/go/xds/core/v3/resource.pb.go
generated
vendored
Normal file
182
vendor/github.com/cncf/xds/go/xds/core/v3/resource.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/core/v3/resource.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/cncf/xds/go/xds/annotations/v3"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
anypb "google.golang.org/protobuf/types/known/anypb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Resource struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name *ResourceName `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
|
||||
Resource *anypb.Any `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Resource) Reset() {
|
||||
*x = Resource{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_core_v3_resource_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Resource) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Resource) ProtoMessage() {}
|
||||
|
||||
func (x *Resource) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_core_v3_resource_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Resource.ProtoReflect.Descriptor instead.
|
||||
func (*Resource) Descriptor() ([]byte, []int) {
|
||||
return file_xds_core_v3_resource_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Resource) GetName() *ResourceName {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Resource) GetVersion() string {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Resource) GetResource() *anypb.Any {
|
||||
if x != nil {
|
||||
return x.Resource
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_xds_core_v3_resource_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_core_v3_resource_proto_rawDesc = []byte{
|
||||
0x0a, 0x1a, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x65,
|
||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x78, 0x64,
|
||||
0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||
0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f,
|
||||
0x76, 0x33, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75,
|
||||
0x72, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x19, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e,
|
||||
0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61,
|
||||
0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x08,
|
||||
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x55,
|
||||
0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33,
|
||||
0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
|
||||
0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
|
||||
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f,
|
||||
0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_core_v3_resource_proto_rawDescOnce sync.Once
|
||||
file_xds_core_v3_resource_proto_rawDescData = file_xds_core_v3_resource_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_core_v3_resource_proto_rawDescGZIP() []byte {
|
||||
file_xds_core_v3_resource_proto_rawDescOnce.Do(func() {
|
||||
file_xds_core_v3_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_core_v3_resource_proto_rawDescData)
|
||||
})
|
||||
return file_xds_core_v3_resource_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_core_v3_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_xds_core_v3_resource_proto_goTypes = []interface{}{
|
||||
(*Resource)(nil), // 0: xds.core.v3.Resource
|
||||
(*ResourceName)(nil), // 1: xds.core.v3.ResourceName
|
||||
(*anypb.Any)(nil), // 2: google.protobuf.Any
|
||||
}
|
||||
var file_xds_core_v3_resource_proto_depIdxs = []int32{
|
||||
1, // 0: xds.core.v3.Resource.name:type_name -> xds.core.v3.ResourceName
|
||||
2, // 1: xds.core.v3.Resource.resource:type_name -> google.protobuf.Any
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_core_v3_resource_proto_init() }
|
||||
func file_xds_core_v3_resource_proto_init() {
|
||||
if File_xds_core_v3_resource_proto != nil {
|
||||
return
|
||||
}
|
||||
file_xds_core_v3_resource_name_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_core_v3_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Resource); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_core_v3_resource_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_core_v3_resource_proto_goTypes,
|
||||
DependencyIndexes: file_xds_core_v3_resource_proto_depIdxs,
|
||||
MessageInfos: file_xds_core_v3_resource_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_core_v3_resource_proto = out.File
|
||||
file_xds_core_v3_resource_proto_rawDesc = nil
|
||||
file_xds_core_v3_resource_proto_goTypes = nil
|
||||
file_xds_core_v3_resource_proto_depIdxs = nil
|
||||
}
|
||||
195
vendor/github.com/cncf/xds/go/xds/core/v3/resource.pb.validate.go
generated
vendored
Normal file
195
vendor/github.com/cncf/xds/go/xds/core/v3/resource.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/core/v3/resource.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on Resource with the rules defined in the
|
||||
// proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *Resource) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on Resource with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in ResourceMultiError, or nil
|
||||
// if none found.
|
||||
func (m *Resource) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *Resource) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetName()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, ResourceValidationError{
|
||||
field: "Name",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, ResourceValidationError{
|
||||
field: "Name",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetName()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ResourceValidationError{
|
||||
field: "Name",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// no validation rules for Version
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetResource()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, ResourceValidationError{
|
||||
field: "Resource",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, ResourceValidationError{
|
||||
field: "Resource",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ResourceValidationError{
|
||||
field: "Resource",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ResourceMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ResourceMultiError is an error wrapping multiple validation errors returned
|
||||
// by Resource.ValidateAll() if the designated constraints aren't met.
|
||||
type ResourceMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ResourceMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ResourceMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ResourceValidationError is the validation error returned by
|
||||
// Resource.Validate if the designated constraints aren't met.
|
||||
type ResourceValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ResourceValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ResourceValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ResourceValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ResourceValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ResourceValidationError) ErrorName() string { return "ResourceValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ResourceValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sResource.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ResourceValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ResourceValidationError{}
|
||||
406
vendor/github.com/cncf/xds/go/xds/core/v3/resource_locator.pb.go
generated
vendored
Normal file
406
vendor/github.com/cncf/xds/go/xds/core/v3/resource_locator.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,406 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/core/v3/resource_locator.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/cncf/xds/go/xds/annotations/v3"
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ResourceLocator_Scheme int32
|
||||
|
||||
const (
|
||||
ResourceLocator_XDSTP ResourceLocator_Scheme = 0
|
||||
ResourceLocator_HTTP ResourceLocator_Scheme = 1
|
||||
ResourceLocator_FILE ResourceLocator_Scheme = 2
|
||||
)
|
||||
|
||||
// Enum value maps for ResourceLocator_Scheme.
|
||||
var (
|
||||
ResourceLocator_Scheme_name = map[int32]string{
|
||||
0: "XDSTP",
|
||||
1: "HTTP",
|
||||
2: "FILE",
|
||||
}
|
||||
ResourceLocator_Scheme_value = map[string]int32{
|
||||
"XDSTP": 0,
|
||||
"HTTP": 1,
|
||||
"FILE": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ResourceLocator_Scheme) Enum() *ResourceLocator_Scheme {
|
||||
p := new(ResourceLocator_Scheme)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ResourceLocator_Scheme) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ResourceLocator_Scheme) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_xds_core_v3_resource_locator_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (ResourceLocator_Scheme) Type() protoreflect.EnumType {
|
||||
return &file_xds_core_v3_resource_locator_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x ResourceLocator_Scheme) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ResourceLocator_Scheme.Descriptor instead.
|
||||
func (ResourceLocator_Scheme) EnumDescriptor() ([]byte, []int) {
|
||||
return file_xds_core_v3_resource_locator_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
type ResourceLocator struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Scheme ResourceLocator_Scheme `protobuf:"varint,1,opt,name=scheme,proto3,enum=xds.core.v3.ResourceLocator_Scheme" json:"scheme,omitempty"`
|
||||
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||
ResourceType string `protobuf:"bytes,4,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"`
|
||||
// Types that are assignable to ContextParamSpecifier:
|
||||
//
|
||||
// *ResourceLocator_ExactContext
|
||||
ContextParamSpecifier isResourceLocator_ContextParamSpecifier `protobuf_oneof:"context_param_specifier"`
|
||||
Directives []*ResourceLocator_Directive `protobuf:"bytes,6,rep,name=directives,proto3" json:"directives,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ResourceLocator) Reset() {
|
||||
*x = ResourceLocator{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_core_v3_resource_locator_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ResourceLocator) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ResourceLocator) ProtoMessage() {}
|
||||
|
||||
func (x *ResourceLocator) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_core_v3_resource_locator_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ResourceLocator.ProtoReflect.Descriptor instead.
|
||||
func (*ResourceLocator) Descriptor() ([]byte, []int) {
|
||||
return file_xds_core_v3_resource_locator_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ResourceLocator) GetScheme() ResourceLocator_Scheme {
|
||||
if x != nil {
|
||||
return x.Scheme
|
||||
}
|
||||
return ResourceLocator_XDSTP
|
||||
}
|
||||
|
||||
func (x *ResourceLocator) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ResourceLocator) GetAuthority() string {
|
||||
if x != nil {
|
||||
return x.Authority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ResourceLocator) GetResourceType() string {
|
||||
if x != nil {
|
||||
return x.ResourceType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *ResourceLocator) GetContextParamSpecifier() isResourceLocator_ContextParamSpecifier {
|
||||
if m != nil {
|
||||
return m.ContextParamSpecifier
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ResourceLocator) GetExactContext() *ContextParams {
|
||||
if x, ok := x.GetContextParamSpecifier().(*ResourceLocator_ExactContext); ok {
|
||||
return x.ExactContext
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ResourceLocator) GetDirectives() []*ResourceLocator_Directive {
|
||||
if x != nil {
|
||||
return x.Directives
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isResourceLocator_ContextParamSpecifier interface {
|
||||
isResourceLocator_ContextParamSpecifier()
|
||||
}
|
||||
|
||||
type ResourceLocator_ExactContext struct {
|
||||
ExactContext *ContextParams `protobuf:"bytes,5,opt,name=exact_context,json=exactContext,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*ResourceLocator_ExactContext) isResourceLocator_ContextParamSpecifier() {}
|
||||
|
||||
type ResourceLocator_Directive struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to Directive:
|
||||
//
|
||||
// *ResourceLocator_Directive_Alt
|
||||
// *ResourceLocator_Directive_Entry
|
||||
Directive isResourceLocator_Directive_Directive `protobuf_oneof:"directive"`
|
||||
}
|
||||
|
||||
func (x *ResourceLocator_Directive) Reset() {
|
||||
*x = ResourceLocator_Directive{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_core_v3_resource_locator_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ResourceLocator_Directive) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ResourceLocator_Directive) ProtoMessage() {}
|
||||
|
||||
func (x *ResourceLocator_Directive) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_core_v3_resource_locator_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ResourceLocator_Directive.ProtoReflect.Descriptor instead.
|
||||
func (*ResourceLocator_Directive) Descriptor() ([]byte, []int) {
|
||||
return file_xds_core_v3_resource_locator_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (m *ResourceLocator_Directive) GetDirective() isResourceLocator_Directive_Directive {
|
||||
if m != nil {
|
||||
return m.Directive
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ResourceLocator_Directive) GetAlt() *ResourceLocator {
|
||||
if x, ok := x.GetDirective().(*ResourceLocator_Directive_Alt); ok {
|
||||
return x.Alt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ResourceLocator_Directive) GetEntry() string {
|
||||
if x, ok := x.GetDirective().(*ResourceLocator_Directive_Entry); ok {
|
||||
return x.Entry
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type isResourceLocator_Directive_Directive interface {
|
||||
isResourceLocator_Directive_Directive()
|
||||
}
|
||||
|
||||
type ResourceLocator_Directive_Alt struct {
|
||||
Alt *ResourceLocator `protobuf:"bytes,1,opt,name=alt,proto3,oneof"`
|
||||
}
|
||||
|
||||
type ResourceLocator_Directive_Entry struct {
|
||||
Entry string `protobuf:"bytes,2,opt,name=entry,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*ResourceLocator_Directive_Alt) isResourceLocator_Directive_Directive() {}
|
||||
|
||||
func (*ResourceLocator_Directive_Entry) isResourceLocator_Directive_Directive() {}
|
||||
|
||||
var File_xds_core_v3_resource_locator_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_core_v3_resource_locator_proto_rawDesc = []byte{
|
||||
0x0a, 0x22, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x65,
|
||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76,
|
||||
0x33, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x1a, 0x20, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f,
|
||||
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76,
|
||||
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x04,
|
||||
0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f,
|
||||
0x72, 0x12, 0x45, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0e, 0x32, 0x23, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e,
|
||||
0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x2e,
|
||||
0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01,
|
||||
0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68,
|
||||
0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74,
|
||||
0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2c, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
|
||||
0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa,
|
||||
0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||
0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x63, 0x6f,
|
||||
0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x64,
|
||||
0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78,
|
||||
0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x65, 0x78, 0x61, 0x63, 0x74,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x64, 0x69, 0x72, 0x65, 0x63,
|
||||
0x74, 0x69, 0x76, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x64,
|
||||
0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72,
|
||||
0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74,
|
||||
0x69, 0x76, 0x65, 0x52, 0x0a, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x1a,
|
||||
0x88, 0x01, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x30, 0x0a,
|
||||
0x03, 0x61, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x64, 0x73,
|
||||
0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x03, 0x61, 0x6c, 0x74, 0x12,
|
||||
0x37, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f,
|
||||
0xfa, 0x42, 0x1c, 0x72, 0x1a, 0x10, 0x01, 0x32, 0x16, 0x5e, 0x5b, 0x30, 0x2d, 0x39, 0x61, 0x2d,
|
||||
0x7a, 0x41, 0x2d, 0x5a, 0x5f, 0x5c, 0x2d, 0x5c, 0x2e, 0x2f, 0x7e, 0x3a, 0x5d, 0x2b, 0x24, 0x48,
|
||||
0x00, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x10, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65,
|
||||
0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x27, 0x0a, 0x06, 0x53, 0x63,
|
||||
0x68, 0x65, 0x6d, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x58, 0x44, 0x53, 0x54, 0x50, 0x10, 0x00, 0x12,
|
||||
0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x49, 0x4c,
|
||||
0x45, 0x10, 0x02, 0x42, 0x19, 0x0a, 0x17, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x70,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x72, 0x42, 0x5c,
|
||||
0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33,
|
||||
0x42, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f,
|
||||
0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f,
|
||||
0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_core_v3_resource_locator_proto_rawDescOnce sync.Once
|
||||
file_xds_core_v3_resource_locator_proto_rawDescData = file_xds_core_v3_resource_locator_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_core_v3_resource_locator_proto_rawDescGZIP() []byte {
|
||||
file_xds_core_v3_resource_locator_proto_rawDescOnce.Do(func() {
|
||||
file_xds_core_v3_resource_locator_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_core_v3_resource_locator_proto_rawDescData)
|
||||
})
|
||||
return file_xds_core_v3_resource_locator_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_core_v3_resource_locator_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_xds_core_v3_resource_locator_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_xds_core_v3_resource_locator_proto_goTypes = []interface{}{
|
||||
(ResourceLocator_Scheme)(0), // 0: xds.core.v3.ResourceLocator.Scheme
|
||||
(*ResourceLocator)(nil), // 1: xds.core.v3.ResourceLocator
|
||||
(*ResourceLocator_Directive)(nil), // 2: xds.core.v3.ResourceLocator.Directive
|
||||
(*ContextParams)(nil), // 3: xds.core.v3.ContextParams
|
||||
}
|
||||
var file_xds_core_v3_resource_locator_proto_depIdxs = []int32{
|
||||
0, // 0: xds.core.v3.ResourceLocator.scheme:type_name -> xds.core.v3.ResourceLocator.Scheme
|
||||
3, // 1: xds.core.v3.ResourceLocator.exact_context:type_name -> xds.core.v3.ContextParams
|
||||
2, // 2: xds.core.v3.ResourceLocator.directives:type_name -> xds.core.v3.ResourceLocator.Directive
|
||||
1, // 3: xds.core.v3.ResourceLocator.Directive.alt:type_name -> xds.core.v3.ResourceLocator
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_core_v3_resource_locator_proto_init() }
|
||||
func file_xds_core_v3_resource_locator_proto_init() {
|
||||
if File_xds_core_v3_resource_locator_proto != nil {
|
||||
return
|
||||
}
|
||||
file_xds_core_v3_context_params_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_core_v3_resource_locator_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ResourceLocator); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_core_v3_resource_locator_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ResourceLocator_Directive); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_xds_core_v3_resource_locator_proto_msgTypes[0].OneofWrappers = []interface{}{
|
||||
(*ResourceLocator_ExactContext)(nil),
|
||||
}
|
||||
file_xds_core_v3_resource_locator_proto_msgTypes[1].OneofWrappers = []interface{}{
|
||||
(*ResourceLocator_Directive_Alt)(nil),
|
||||
(*ResourceLocator_Directive_Entry)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_core_v3_resource_locator_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_core_v3_resource_locator_proto_goTypes,
|
||||
DependencyIndexes: file_xds_core_v3_resource_locator_proto_depIdxs,
|
||||
EnumInfos: file_xds_core_v3_resource_locator_proto_enumTypes,
|
||||
MessageInfos: file_xds_core_v3_resource_locator_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_core_v3_resource_locator_proto = out.File
|
||||
file_xds_core_v3_resource_locator_proto_rawDesc = nil
|
||||
file_xds_core_v3_resource_locator_proto_goTypes = nil
|
||||
file_xds_core_v3_resource_locator_proto_depIdxs = nil
|
||||
}
|
||||
439
vendor/github.com/cncf/xds/go/xds/core/v3/resource_locator.pb.validate.go
generated
vendored
Normal file
439
vendor/github.com/cncf/xds/go/xds/core/v3/resource_locator.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,439 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/core/v3/resource_locator.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on ResourceLocator with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
func (m *ResourceLocator) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on ResourceLocator with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// ResourceLocatorMultiError, or nil if none found.
|
||||
func (m *ResourceLocator) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *ResourceLocator) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if _, ok := ResourceLocator_Scheme_name[int32(m.GetScheme())]; !ok {
|
||||
err := ResourceLocatorValidationError{
|
||||
field: "Scheme",
|
||||
reason: "value must be one of the defined enum values",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
// no validation rules for Id
|
||||
|
||||
// no validation rules for Authority
|
||||
|
||||
if utf8.RuneCountInString(m.GetResourceType()) < 1 {
|
||||
err := ResourceLocatorValidationError{
|
||||
field: "ResourceType",
|
||||
reason: "value length must be at least 1 runes",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
for idx, item := range m.GetDirectives() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, ResourceLocatorValidationError{
|
||||
field: fmt.Sprintf("Directives[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, ResourceLocatorValidationError{
|
||||
field: fmt.Sprintf("Directives[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ResourceLocatorValidationError{
|
||||
field: fmt.Sprintf("Directives[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
switch v := m.ContextParamSpecifier.(type) {
|
||||
case *ResourceLocator_ExactContext:
|
||||
if v == nil {
|
||||
err := ResourceLocatorValidationError{
|
||||
field: "ContextParamSpecifier",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetExactContext()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, ResourceLocatorValidationError{
|
||||
field: "ExactContext",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, ResourceLocatorValidationError{
|
||||
field: "ExactContext",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetExactContext()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ResourceLocatorValidationError{
|
||||
field: "ExactContext",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
_ = v // ensures v is used
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ResourceLocatorMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ResourceLocatorMultiError is an error wrapping multiple validation errors
|
||||
// returned by ResourceLocator.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type ResourceLocatorMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ResourceLocatorMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ResourceLocatorMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ResourceLocatorValidationError is the validation error returned by
|
||||
// ResourceLocator.Validate if the designated constraints aren't met.
|
||||
type ResourceLocatorValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ResourceLocatorValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ResourceLocatorValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ResourceLocatorValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ResourceLocatorValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ResourceLocatorValidationError) ErrorName() string { return "ResourceLocatorValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ResourceLocatorValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sResourceLocator.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ResourceLocatorValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ResourceLocatorValidationError{}
|
||||
|
||||
// Validate checks the field values on ResourceLocator_Directive with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *ResourceLocator_Directive) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on ResourceLocator_Directive with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// ResourceLocator_DirectiveMultiError, or nil if none found.
|
||||
func (m *ResourceLocator_Directive) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *ResourceLocator_Directive) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
oneofDirectivePresent := false
|
||||
switch v := m.Directive.(type) {
|
||||
case *ResourceLocator_Directive_Alt:
|
||||
if v == nil {
|
||||
err := ResourceLocator_DirectiveValidationError{
|
||||
field: "Directive",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
oneofDirectivePresent = true
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetAlt()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, ResourceLocator_DirectiveValidationError{
|
||||
field: "Alt",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, ResourceLocator_DirectiveValidationError{
|
||||
field: "Alt",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetAlt()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ResourceLocator_DirectiveValidationError{
|
||||
field: "Alt",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case *ResourceLocator_Directive_Entry:
|
||||
if v == nil {
|
||||
err := ResourceLocator_DirectiveValidationError{
|
||||
field: "Directive",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
oneofDirectivePresent = true
|
||||
|
||||
if utf8.RuneCountInString(m.GetEntry()) < 1 {
|
||||
err := ResourceLocator_DirectiveValidationError{
|
||||
field: "Entry",
|
||||
reason: "value length must be at least 1 runes",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if !_ResourceLocator_Directive_Entry_Pattern.MatchString(m.GetEntry()) {
|
||||
err := ResourceLocator_DirectiveValidationError{
|
||||
field: "Entry",
|
||||
reason: "value does not match regex pattern \"^[0-9a-zA-Z_\\\\-\\\\./~:]+$\"",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
default:
|
||||
_ = v // ensures v is used
|
||||
}
|
||||
if !oneofDirectivePresent {
|
||||
err := ResourceLocator_DirectiveValidationError{
|
||||
field: "Directive",
|
||||
reason: "value is required",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ResourceLocator_DirectiveMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ResourceLocator_DirectiveMultiError is an error wrapping multiple validation
|
||||
// errors returned by ResourceLocator_Directive.ValidateAll() if the
|
||||
// designated constraints aren't met.
|
||||
type ResourceLocator_DirectiveMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ResourceLocator_DirectiveMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ResourceLocator_DirectiveMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ResourceLocator_DirectiveValidationError is the validation error returned by
|
||||
// ResourceLocator_Directive.Validate if the designated constraints aren't met.
|
||||
type ResourceLocator_DirectiveValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ResourceLocator_DirectiveValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ResourceLocator_DirectiveValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ResourceLocator_DirectiveValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ResourceLocator_DirectiveValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ResourceLocator_DirectiveValidationError) ErrorName() string {
|
||||
return "ResourceLocator_DirectiveValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ResourceLocator_DirectiveValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sResourceLocator_Directive.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ResourceLocator_DirectiveValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ResourceLocator_DirectiveValidationError{}
|
||||
|
||||
var _ResourceLocator_Directive_Entry_Pattern = regexp.MustCompile("^[0-9a-zA-Z_\\-\\./~:]+$")
|
||||
190
vendor/github.com/cncf/xds/go/xds/core/v3/resource_name.pb.go
generated
vendored
Normal file
190
vendor/github.com/cncf/xds/go/xds/core/v3/resource_name.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/core/v3/resource_name.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/cncf/xds/go/xds/annotations/v3"
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ResourceName struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||
ResourceType string `protobuf:"bytes,3,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"`
|
||||
Context *ContextParams `protobuf:"bytes,4,opt,name=context,proto3" json:"context,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ResourceName) Reset() {
|
||||
*x = ResourceName{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_core_v3_resource_name_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ResourceName) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ResourceName) ProtoMessage() {}
|
||||
|
||||
func (x *ResourceName) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_core_v3_resource_name_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ResourceName.ProtoReflect.Descriptor instead.
|
||||
func (*ResourceName) Descriptor() ([]byte, []int) {
|
||||
return file_xds_core_v3_resource_name_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ResourceName) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ResourceName) GetAuthority() string {
|
||||
if x != nil {
|
||||
return x.Authority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ResourceName) GetResourceType() string {
|
||||
if x != nil {
|
||||
return x.ResourceType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ResourceName) GetContext() *ContextParams {
|
||||
if x != nil {
|
||||
return x.Context
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_xds_core_v3_resource_name_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_core_v3_resource_name_proto_rawDesc = []byte{
|
||||
0x0a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x65,
|
||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x0b, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x1a, 0x1f,
|
||||
0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f,
|
||||
0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
|
||||
0x20, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6e,
|
||||
0x74, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69,
|
||||
0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa0, 0x01, 0x0a, 0x0c, 0x52,
|
||||
0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61,
|
||||
0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
|
||||
0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2c, 0x0a, 0x0d, 0x72, 0x65, 0x73,
|
||||
0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
|
||||
0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75,
|
||||
0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
|
||||
0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63,
|
||||
0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x73, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x42, 0x59, 0xd2,
|
||||
0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74,
|
||||
0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42,
|
||||
0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73,
|
||||
0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_core_v3_resource_name_proto_rawDescOnce sync.Once
|
||||
file_xds_core_v3_resource_name_proto_rawDescData = file_xds_core_v3_resource_name_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_core_v3_resource_name_proto_rawDescGZIP() []byte {
|
||||
file_xds_core_v3_resource_name_proto_rawDescOnce.Do(func() {
|
||||
file_xds_core_v3_resource_name_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_core_v3_resource_name_proto_rawDescData)
|
||||
})
|
||||
return file_xds_core_v3_resource_name_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_core_v3_resource_name_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_xds_core_v3_resource_name_proto_goTypes = []interface{}{
|
||||
(*ResourceName)(nil), // 0: xds.core.v3.ResourceName
|
||||
(*ContextParams)(nil), // 1: xds.core.v3.ContextParams
|
||||
}
|
||||
var file_xds_core_v3_resource_name_proto_depIdxs = []int32{
|
||||
1, // 0: xds.core.v3.ResourceName.context:type_name -> xds.core.v3.ContextParams
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_core_v3_resource_name_proto_init() }
|
||||
func file_xds_core_v3_resource_name_proto_init() {
|
||||
if File_xds_core_v3_resource_name_proto != nil {
|
||||
return
|
||||
}
|
||||
file_xds_core_v3_context_params_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_core_v3_resource_name_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ResourceName); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_core_v3_resource_name_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_core_v3_resource_name_proto_goTypes,
|
||||
DependencyIndexes: file_xds_core_v3_resource_name_proto_depIdxs,
|
||||
MessageInfos: file_xds_core_v3_resource_name_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_core_v3_resource_name_proto = out.File
|
||||
file_xds_core_v3_resource_name_proto_rawDesc = nil
|
||||
file_xds_core_v3_resource_name_proto_goTypes = nil
|
||||
file_xds_core_v3_resource_name_proto_depIdxs = nil
|
||||
}
|
||||
179
vendor/github.com/cncf/xds/go/xds/core/v3/resource_name.pb.validate.go
generated
vendored
Normal file
179
vendor/github.com/cncf/xds/go/xds/core/v3/resource_name.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/core/v3/resource_name.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on ResourceName with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *ResourceName) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on ResourceName with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in ResourceNameMultiError, or
|
||||
// nil if none found.
|
||||
func (m *ResourceName) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *ResourceName) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for Id
|
||||
|
||||
// no validation rules for Authority
|
||||
|
||||
if utf8.RuneCountInString(m.GetResourceType()) < 1 {
|
||||
err := ResourceNameValidationError{
|
||||
field: "ResourceType",
|
||||
reason: "value length must be at least 1 runes",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetContext()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, ResourceNameValidationError{
|
||||
field: "Context",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, ResourceNameValidationError{
|
||||
field: "Context",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ResourceNameValidationError{
|
||||
field: "Context",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ResourceNameMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ResourceNameMultiError is an error wrapping multiple validation errors
|
||||
// returned by ResourceName.ValidateAll() if the designated constraints aren't met.
|
||||
type ResourceNameMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ResourceNameMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ResourceNameMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ResourceNameValidationError is the validation error returned by
|
||||
// ResourceName.Validate if the designated constraints aren't met.
|
||||
type ResourceNameValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ResourceNameValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ResourceNameValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ResourceNameValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ResourceNameValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ResourceNameValidationError) ErrorName() string { return "ResourceNameValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ResourceNameValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sResourceName.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ResourceNameValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ResourceNameValidationError{}
|
||||
272
vendor/github.com/cncf/xds/go/xds/data/orca/v3/orca_load_report.pb.go
generated
vendored
Normal file
272
vendor/github.com/cncf/xds/go/xds/data/orca/v3/orca_load_report.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,272 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/data/orca/v3/orca_load_report.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type OrcaLoadReport struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
CpuUtilization float64 `protobuf:"fixed64,1,opt,name=cpu_utilization,json=cpuUtilization,proto3" json:"cpu_utilization,omitempty"`
|
||||
MemUtilization float64 `protobuf:"fixed64,2,opt,name=mem_utilization,json=memUtilization,proto3" json:"mem_utilization,omitempty"`
|
||||
// Deprecated: Marked as deprecated in xds/data/orca/v3/orca_load_report.proto.
|
||||
Rps uint64 `protobuf:"varint,3,opt,name=rps,proto3" json:"rps,omitempty"`
|
||||
RequestCost map[string]float64 `protobuf:"bytes,4,rep,name=request_cost,json=requestCost,proto3" json:"request_cost,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"`
|
||||
Utilization map[string]float64 `protobuf:"bytes,5,rep,name=utilization,proto3" json:"utilization,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"`
|
||||
RpsFractional float64 `protobuf:"fixed64,6,opt,name=rps_fractional,json=rpsFractional,proto3" json:"rps_fractional,omitempty"`
|
||||
Eps float64 `protobuf:"fixed64,7,opt,name=eps,proto3" json:"eps,omitempty"`
|
||||
NamedMetrics map[string]float64 `protobuf:"bytes,8,rep,name=named_metrics,json=namedMetrics,proto3" json:"named_metrics,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"`
|
||||
ApplicationUtilization float64 `protobuf:"fixed64,9,opt,name=application_utilization,json=applicationUtilization,proto3" json:"application_utilization,omitempty"`
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReport) Reset() {
|
||||
*x = OrcaLoadReport{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_data_orca_v3_orca_load_report_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReport) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*OrcaLoadReport) ProtoMessage() {}
|
||||
|
||||
func (x *OrcaLoadReport) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_data_orca_v3_orca_load_report_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use OrcaLoadReport.ProtoReflect.Descriptor instead.
|
||||
func (*OrcaLoadReport) Descriptor() ([]byte, []int) {
|
||||
return file_xds_data_orca_v3_orca_load_report_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReport) GetCpuUtilization() float64 {
|
||||
if x != nil {
|
||||
return x.CpuUtilization
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReport) GetMemUtilization() float64 {
|
||||
if x != nil {
|
||||
return x.MemUtilization
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Marked as deprecated in xds/data/orca/v3/orca_load_report.proto.
|
||||
func (x *OrcaLoadReport) GetRps() uint64 {
|
||||
if x != nil {
|
||||
return x.Rps
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReport) GetRequestCost() map[string]float64 {
|
||||
if x != nil {
|
||||
return x.RequestCost
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReport) GetUtilization() map[string]float64 {
|
||||
if x != nil {
|
||||
return x.Utilization
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReport) GetRpsFractional() float64 {
|
||||
if x != nil {
|
||||
return x.RpsFractional
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReport) GetEps() float64 {
|
||||
if x != nil {
|
||||
return x.Eps
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReport) GetNamedMetrics() map[string]float64 {
|
||||
if x != nil {
|
||||
return x.NamedMetrics
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReport) GetApplicationUtilization() float64 {
|
||||
if x != nil {
|
||||
return x.ApplicationUtilization
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_xds_data_orca_v3_orca_load_report_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_data_orca_v3_orca_load_report_proto_rawDesc = []byte{
|
||||
0x0a, 0x27, 0x78, 0x64, 0x73, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6f, 0x72, 0x63, 0x61, 0x2f,
|
||||
0x76, 0x33, 0x2f, 0x6f, 0x72, 0x63, 0x61, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x65, 0x70,
|
||||
0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x78, 0x64, 0x73, 0x2e, 0x64,
|
||||
0x61, 0x74, 0x61, 0x2e, 0x6f, 0x72, 0x63, 0x61, 0x2e, 0x76, 0x33, 0x1a, 0x17, 0x76, 0x61, 0x6c,
|
||||
0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa6, 0x06, 0x0a, 0x0e, 0x4f, 0x72, 0x63, 0x61, 0x4c, 0x6f, 0x61,
|
||||
0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x37, 0x0a, 0x0f, 0x63, 0x70, 0x75, 0x5f, 0x75,
|
||||
0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01,
|
||||
0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x52, 0x0e, 0x63, 0x70, 0x75, 0x55, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x65, 0x6d, 0x5f, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x42, 0x17, 0xfa, 0x42, 0x14, 0x12, 0x12,
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x52, 0x0e, 0x6d, 0x65, 0x6d, 0x55, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x03, 0x72, 0x70, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42,
|
||||
0x02, 0x18, 0x01, 0x52, 0x03, 0x72, 0x70, 0x73, 0x12, 0x54, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31,
|
||||
0x2e, 0x78, 0x64, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6f, 0x72, 0x63, 0x61, 0x2e, 0x76,
|
||||
0x33, 0x2e, 0x4f, 0x72, 0x63, 0x61, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74,
|
||||
0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72,
|
||||
0x79, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x73, 0x74, 0x12, 0x71,
|
||||
0x0a, 0x0b, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6f,
|
||||
0x72, 0x63, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x72, 0x63, 0x61, 0x4c, 0x6f, 0x61, 0x64, 0x52,
|
||||
0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x55, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x1c, 0xfa, 0x42, 0x19, 0x9a, 0x01, 0x16, 0x2a, 0x14,
|
||||
0x12, 0x12, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x29, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x52, 0x0b, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x12, 0x35, 0x0a, 0x0e, 0x72, 0x70, 0x73, 0x5f, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09,
|
||||
0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x0d, 0x72, 0x70, 0x73, 0x46, 0x72,
|
||||
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x12, 0x20, 0x0a, 0x03, 0x65, 0x70, 0x73, 0x18,
|
||||
0x07, 0x20, 0x01, 0x28, 0x01, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x03, 0x65, 0x70, 0x73, 0x12, 0x57, 0x0a, 0x0d, 0x6e, 0x61,
|
||||
0x6d, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28,
|
||||
0x0b, 0x32, 0x32, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6f, 0x72, 0x63,
|
||||
0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x72, 0x63, 0x61, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x70,
|
||||
0x6f, 0x72, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73,
|
||||
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72,
|
||||
0x69, 0x63, 0x73, 0x12, 0x47, 0x0a, 0x17, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x5f, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09,
|
||||
0x20, 0x01, 0x28, 0x01, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x52, 0x16, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x55, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x3e, 0x0a, 0x10,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10,
|
||||
0x55, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11,
|
||||
0x4e, 0x61, 0x6d, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72,
|
||||
0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x5d, 0x0a,
|
||||
0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e,
|
||||
0x64, 0x61, 0x74, 0x61, 0x2e, 0x6f, 0x72, 0x63, 0x61, 0x2e, 0x76, 0x33, 0x42, 0x13, 0x4f, 0x72,
|
||||
0x63, 0x61, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||
0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f,
|
||||
0x64, 0x61, 0x74, 0x61, 0x2f, 0x6f, 0x72, 0x63, 0x61, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_data_orca_v3_orca_load_report_proto_rawDescOnce sync.Once
|
||||
file_xds_data_orca_v3_orca_load_report_proto_rawDescData = file_xds_data_orca_v3_orca_load_report_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_data_orca_v3_orca_load_report_proto_rawDescGZIP() []byte {
|
||||
file_xds_data_orca_v3_orca_load_report_proto_rawDescOnce.Do(func() {
|
||||
file_xds_data_orca_v3_orca_load_report_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_data_orca_v3_orca_load_report_proto_rawDescData)
|
||||
})
|
||||
return file_xds_data_orca_v3_orca_load_report_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_data_orca_v3_orca_load_report_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_xds_data_orca_v3_orca_load_report_proto_goTypes = []interface{}{
|
||||
(*OrcaLoadReport)(nil), // 0: xds.data.orca.v3.OrcaLoadReport
|
||||
nil, // 1: xds.data.orca.v3.OrcaLoadReport.RequestCostEntry
|
||||
nil, // 2: xds.data.orca.v3.OrcaLoadReport.UtilizationEntry
|
||||
nil, // 3: xds.data.orca.v3.OrcaLoadReport.NamedMetricsEntry
|
||||
}
|
||||
var file_xds_data_orca_v3_orca_load_report_proto_depIdxs = []int32{
|
||||
1, // 0: xds.data.orca.v3.OrcaLoadReport.request_cost:type_name -> xds.data.orca.v3.OrcaLoadReport.RequestCostEntry
|
||||
2, // 1: xds.data.orca.v3.OrcaLoadReport.utilization:type_name -> xds.data.orca.v3.OrcaLoadReport.UtilizationEntry
|
||||
3, // 2: xds.data.orca.v3.OrcaLoadReport.named_metrics:type_name -> xds.data.orca.v3.OrcaLoadReport.NamedMetricsEntry
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_data_orca_v3_orca_load_report_proto_init() }
|
||||
func file_xds_data_orca_v3_orca_load_report_proto_init() {
|
||||
if File_xds_data_orca_v3_orca_load_report_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_data_orca_v3_orca_load_report_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*OrcaLoadReport); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_data_orca_v3_orca_load_report_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_data_orca_v3_orca_load_report_proto_goTypes,
|
||||
DependencyIndexes: file_xds_data_orca_v3_orca_load_report_proto_depIdxs,
|
||||
MessageInfos: file_xds_data_orca_v3_orca_load_report_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_data_orca_v3_orca_load_report_proto = out.File
|
||||
file_xds_data_orca_v3_orca_load_report_proto_rawDesc = nil
|
||||
file_xds_data_orca_v3_orca_load_report_proto_goTypes = nil
|
||||
file_xds_data_orca_v3_orca_load_report_proto_depIdxs = nil
|
||||
}
|
||||
225
vendor/github.com/cncf/xds/go/xds/data/orca/v3/orca_load_report.pb.validate.go
generated
vendored
Normal file
225
vendor/github.com/cncf/xds/go/xds/data/orca/v3/orca_load_report.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/data/orca/v3/orca_load_report.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on OrcaLoadReport with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *OrcaLoadReport) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on OrcaLoadReport with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in OrcaLoadReportMultiError,
|
||||
// or nil if none found.
|
||||
func (m *OrcaLoadReport) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *OrcaLoadReport) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if m.GetCpuUtilization() < 0 {
|
||||
err := OrcaLoadReportValidationError{
|
||||
field: "CpuUtilization",
|
||||
reason: "value must be greater than or equal to 0",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if val := m.GetMemUtilization(); val < 0 || val > 1 {
|
||||
err := OrcaLoadReportValidationError{
|
||||
field: "MemUtilization",
|
||||
reason: "value must be inside range [0, 1]",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
// no validation rules for Rps
|
||||
|
||||
// no validation rules for RequestCost
|
||||
|
||||
{
|
||||
sorted_keys := make([]string, len(m.GetUtilization()))
|
||||
i := 0
|
||||
for key := range m.GetUtilization() {
|
||||
sorted_keys[i] = key
|
||||
i++
|
||||
}
|
||||
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
|
||||
for _, key := range sorted_keys {
|
||||
val := m.GetUtilization()[key]
|
||||
_ = val
|
||||
|
||||
// no validation rules for Utilization[key]
|
||||
|
||||
if val := val; val < 0 || val > 1 {
|
||||
err := OrcaLoadReportValidationError{
|
||||
field: fmt.Sprintf("Utilization[%v]", key),
|
||||
reason: "value must be inside range [0, 1]",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if m.GetRpsFractional() < 0 {
|
||||
err := OrcaLoadReportValidationError{
|
||||
field: "RpsFractional",
|
||||
reason: "value must be greater than or equal to 0",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if m.GetEps() < 0 {
|
||||
err := OrcaLoadReportValidationError{
|
||||
field: "Eps",
|
||||
reason: "value must be greater than or equal to 0",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
// no validation rules for NamedMetrics
|
||||
|
||||
if m.GetApplicationUtilization() < 0 {
|
||||
err := OrcaLoadReportValidationError{
|
||||
field: "ApplicationUtilization",
|
||||
reason: "value must be greater than or equal to 0",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return OrcaLoadReportMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// OrcaLoadReportMultiError is an error wrapping multiple validation errors
|
||||
// returned by OrcaLoadReport.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type OrcaLoadReportMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m OrcaLoadReportMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m OrcaLoadReportMultiError) AllErrors() []error { return m }
|
||||
|
||||
// OrcaLoadReportValidationError is the validation error returned by
|
||||
// OrcaLoadReport.Validate if the designated constraints aren't met.
|
||||
type OrcaLoadReportValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e OrcaLoadReportValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e OrcaLoadReportValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e OrcaLoadReportValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e OrcaLoadReportValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e OrcaLoadReportValidationError) ErrorName() string { return "OrcaLoadReportValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e OrcaLoadReportValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sOrcaLoadReport.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = OrcaLoadReportValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = OrcaLoadReportValidationError{}
|
||||
182
vendor/github.com/cncf/xds/go/xds/service/orca/v3/orca.pb.go
generated
vendored
Normal file
182
vendor/github.com/cncf/xds/go/xds/service/orca/v3/orca.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/service/orca/v3/orca.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
v3 "github.com/cncf/xds/go/xds/data/orca/v3"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
durationpb "google.golang.org/protobuf/types/known/durationpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type OrcaLoadReportRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ReportInterval *durationpb.Duration `protobuf:"bytes,1,opt,name=report_interval,json=reportInterval,proto3" json:"report_interval,omitempty"`
|
||||
RequestCostNames []string `protobuf:"bytes,2,rep,name=request_cost_names,json=requestCostNames,proto3" json:"request_cost_names,omitempty"`
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReportRequest) Reset() {
|
||||
*x = OrcaLoadReportRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_service_orca_v3_orca_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReportRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*OrcaLoadReportRequest) ProtoMessage() {}
|
||||
|
||||
func (x *OrcaLoadReportRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_service_orca_v3_orca_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use OrcaLoadReportRequest.ProtoReflect.Descriptor instead.
|
||||
func (*OrcaLoadReportRequest) Descriptor() ([]byte, []int) {
|
||||
return file_xds_service_orca_v3_orca_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReportRequest) GetReportInterval() *durationpb.Duration {
|
||||
if x != nil {
|
||||
return x.ReportInterval
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *OrcaLoadReportRequest) GetRequestCostNames() []string {
|
||||
if x != nil {
|
||||
return x.RequestCostNames
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_xds_service_orca_v3_orca_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_service_orca_v3_orca_proto_rawDesc = []byte{
|
||||
0x0a, 0x1e, 0x78, 0x64, 0x73, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6f, 0x72,
|
||||
0x63, 0x61, 0x2f, 0x76, 0x33, 0x2f, 0x6f, 0x72, 0x63, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x13, 0x78, 0x64, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x6f, 0x72,
|
||||
0x63, 0x61, 0x2e, 0x76, 0x33, 0x1a, 0x27, 0x78, 0x64, 0x73, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2f,
|
||||
0x6f, 0x72, 0x63, 0x61, 0x2f, 0x76, 0x33, 0x2f, 0x6f, 0x72, 0x63, 0x61, 0x5f, 0x6c, 0x6f, 0x61,
|
||||
0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
|
||||
0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89,
|
||||
0x01, 0x0a, 0x15, 0x4f, 0x72, 0x63, 0x61, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72,
|
||||
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f,
|
||||
0x72, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x72, 0x65,
|
||||
0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2c, 0x0a, 0x12,
|
||||
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x43, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x32, 0x75, 0x0a, 0x0e, 0x4f, 0x70,
|
||||
0x65, 0x6e, 0x52, 0x63, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x63, 0x0a, 0x11,
|
||||
0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63,
|
||||
0x73, 0x12, 0x2a, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e,
|
||||
0x6f, 0x72, 0x63, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x72, 0x63, 0x61, 0x4c, 0x6f, 0x61, 0x64,
|
||||
0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e,
|
||||
0x78, 0x64, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6f, 0x72, 0x63, 0x61, 0x2e, 0x76, 0x33,
|
||||
0x2e, 0x4f, 0x72, 0x63, 0x61, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x30,
|
||||
0x01, 0x42, 0x59, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||
0x78, 0x64, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x6f, 0x72, 0x63, 0x61,
|
||||
0x2e, 0x76, 0x33, 0x42, 0x09, 0x4f, 0x72, 0x63, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
|
||||
0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63,
|
||||
0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x73, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x2f, 0x6f, 0x72, 0x63, 0x61, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_service_orca_v3_orca_proto_rawDescOnce sync.Once
|
||||
file_xds_service_orca_v3_orca_proto_rawDescData = file_xds_service_orca_v3_orca_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_service_orca_v3_orca_proto_rawDescGZIP() []byte {
|
||||
file_xds_service_orca_v3_orca_proto_rawDescOnce.Do(func() {
|
||||
file_xds_service_orca_v3_orca_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_service_orca_v3_orca_proto_rawDescData)
|
||||
})
|
||||
return file_xds_service_orca_v3_orca_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_service_orca_v3_orca_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_xds_service_orca_v3_orca_proto_goTypes = []interface{}{
|
||||
(*OrcaLoadReportRequest)(nil), // 0: xds.service.orca.v3.OrcaLoadReportRequest
|
||||
(*durationpb.Duration)(nil), // 1: google.protobuf.Duration
|
||||
(*v3.OrcaLoadReport)(nil), // 2: xds.data.orca.v3.OrcaLoadReport
|
||||
}
|
||||
var file_xds_service_orca_v3_orca_proto_depIdxs = []int32{
|
||||
1, // 0: xds.service.orca.v3.OrcaLoadReportRequest.report_interval:type_name -> google.protobuf.Duration
|
||||
0, // 1: xds.service.orca.v3.OpenRcaService.StreamCoreMetrics:input_type -> xds.service.orca.v3.OrcaLoadReportRequest
|
||||
2, // 2: xds.service.orca.v3.OpenRcaService.StreamCoreMetrics:output_type -> xds.data.orca.v3.OrcaLoadReport
|
||||
2, // [2:3] is the sub-list for method output_type
|
||||
1, // [1:2] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_service_orca_v3_orca_proto_init() }
|
||||
func file_xds_service_orca_v3_orca_proto_init() {
|
||||
if File_xds_service_orca_v3_orca_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_service_orca_v3_orca_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*OrcaLoadReportRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_service_orca_v3_orca_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_xds_service_orca_v3_orca_proto_goTypes,
|
||||
DependencyIndexes: file_xds_service_orca_v3_orca_proto_depIdxs,
|
||||
MessageInfos: file_xds_service_orca_v3_orca_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_service_orca_v3_orca_proto = out.File
|
||||
file_xds_service_orca_v3_orca_proto_rawDesc = nil
|
||||
file_xds_service_orca_v3_orca_proto_goTypes = nil
|
||||
file_xds_service_orca_v3_orca_proto_depIdxs = nil
|
||||
}
|
||||
167
vendor/github.com/cncf/xds/go/xds/service/orca/v3/orca.pb.validate.go
generated
vendored
Normal file
167
vendor/github.com/cncf/xds/go/xds/service/orca/v3/orca.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/service/orca/v3/orca.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on OrcaLoadReportRequest with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *OrcaLoadReportRequest) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on OrcaLoadReportRequest with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// OrcaLoadReportRequestMultiError, or nil if none found.
|
||||
func (m *OrcaLoadReportRequest) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *OrcaLoadReportRequest) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetReportInterval()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, OrcaLoadReportRequestValidationError{
|
||||
field: "ReportInterval",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, OrcaLoadReportRequestValidationError{
|
||||
field: "ReportInterval",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetReportInterval()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return OrcaLoadReportRequestValidationError{
|
||||
field: "ReportInterval",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return OrcaLoadReportRequestMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// OrcaLoadReportRequestMultiError is an error wrapping multiple validation
|
||||
// errors returned by OrcaLoadReportRequest.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type OrcaLoadReportRequestMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m OrcaLoadReportRequestMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m OrcaLoadReportRequestMultiError) AllErrors() []error { return m }
|
||||
|
||||
// OrcaLoadReportRequestValidationError is the validation error returned by
|
||||
// OrcaLoadReportRequest.Validate if the designated constraints aren't met.
|
||||
type OrcaLoadReportRequestValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e OrcaLoadReportRequestValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e OrcaLoadReportRequestValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e OrcaLoadReportRequestValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e OrcaLoadReportRequestValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e OrcaLoadReportRequestValidationError) ErrorName() string {
|
||||
return "OrcaLoadReportRequestValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e OrcaLoadReportRequestValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sOrcaLoadReportRequest.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = OrcaLoadReportRequestValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = OrcaLoadReportRequestValidationError{}
|
||||
135
vendor/github.com/cncf/xds/go/xds/service/orca/v3/orca_grpc.pb.go
generated
vendored
Normal file
135
vendor/github.com/cncf/xds/go/xds/service/orca/v3/orca_grpc.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v5.27.0--rc2
|
||||
// source: xds/service/orca/v3/orca.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "github.com/cncf/xds/go/xds/data/orca/v3"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
OpenRcaService_StreamCoreMetrics_FullMethodName = "/xds.service.orca.v3.OpenRcaService/StreamCoreMetrics"
|
||||
)
|
||||
|
||||
// OpenRcaServiceClient is the client API for OpenRcaService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type OpenRcaServiceClient interface {
|
||||
StreamCoreMetrics(ctx context.Context, in *OrcaLoadReportRequest, opts ...grpc.CallOption) (OpenRcaService_StreamCoreMetricsClient, error)
|
||||
}
|
||||
|
||||
type openRcaServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewOpenRcaServiceClient(cc grpc.ClientConnInterface) OpenRcaServiceClient {
|
||||
return &openRcaServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *openRcaServiceClient) StreamCoreMetrics(ctx context.Context, in *OrcaLoadReportRequest, opts ...grpc.CallOption) (OpenRcaService_StreamCoreMetricsClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &OpenRcaService_ServiceDesc.Streams[0], OpenRcaService_StreamCoreMetrics_FullMethodName, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &openRcaServiceStreamCoreMetricsClient{stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type OpenRcaService_StreamCoreMetricsClient interface {
|
||||
Recv() (*v3.OrcaLoadReport, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type openRcaServiceStreamCoreMetricsClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *openRcaServiceStreamCoreMetricsClient) Recv() (*v3.OrcaLoadReport, error) {
|
||||
m := new(v3.OrcaLoadReport)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// OpenRcaServiceServer is the server API for OpenRcaService service.
|
||||
// All implementations should embed UnimplementedOpenRcaServiceServer
|
||||
// for forward compatibility
|
||||
type OpenRcaServiceServer interface {
|
||||
StreamCoreMetrics(*OrcaLoadReportRequest, OpenRcaService_StreamCoreMetricsServer) error
|
||||
}
|
||||
|
||||
// UnimplementedOpenRcaServiceServer should be embedded to have forward compatible implementations.
|
||||
type UnimplementedOpenRcaServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedOpenRcaServiceServer) StreamCoreMetrics(*OrcaLoadReportRequest, OpenRcaService_StreamCoreMetricsServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method StreamCoreMetrics not implemented")
|
||||
}
|
||||
|
||||
// UnsafeOpenRcaServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to OpenRcaServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeOpenRcaServiceServer interface {
|
||||
mustEmbedUnimplementedOpenRcaServiceServer()
|
||||
}
|
||||
|
||||
func RegisterOpenRcaServiceServer(s grpc.ServiceRegistrar, srv OpenRcaServiceServer) {
|
||||
s.RegisterService(&OpenRcaService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _OpenRcaService_StreamCoreMetrics_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(OrcaLoadReportRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(OpenRcaServiceServer).StreamCoreMetrics(m, &openRcaServiceStreamCoreMetricsServer{stream})
|
||||
}
|
||||
|
||||
type OpenRcaService_StreamCoreMetricsServer interface {
|
||||
Send(*v3.OrcaLoadReport) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type openRcaServiceStreamCoreMetricsServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *openRcaServiceStreamCoreMetricsServer) Send(m *v3.OrcaLoadReport) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
// OpenRcaService_ServiceDesc is the grpc.ServiceDesc for OpenRcaService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var OpenRcaService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "xds.service.orca.v3.OpenRcaService",
|
||||
HandlerType: (*OpenRcaServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "StreamCoreMetrics",
|
||||
Handler: _OpenRcaService_StreamCoreMetrics_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "xds/service/orca/v3/orca.proto",
|
||||
}
|
||||
168
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/cel.pb.go
generated
vendored
Normal file
168
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/cel.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/type/matcher/v3/cel.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
v3 "github.com/cncf/xds/go/xds/type/v3"
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type CelMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ExprMatch *v3.CelExpression `protobuf:"bytes,1,opt,name=expr_match,json=exprMatch,proto3" json:"expr_match,omitempty"`
|
||||
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CelMatcher) Reset() {
|
||||
*x = CelMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_cel_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CelMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CelMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *CelMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_cel_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CelMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*CelMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_cel_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CelMatcher) GetExprMatch() *v3.CelExpression {
|
||||
if x != nil {
|
||||
return x.ExprMatch
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CelMatcher) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_xds_type_matcher_v3_cel_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_type_matcher_v3_cel_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x13, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
|
||||
0x72, 0x2e, 0x76, 0x33, 0x1a, 0x15, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x76,
|
||||
0x33, 0x2f, 0x63, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c,
|
||||
0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x73, 0x0a, 0x0a, 0x43, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x65, 0x72, 0x12, 0x43, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70,
|
||||
0x65, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x65, 0x78,
|
||||
0x70, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72,
|
||||
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65,
|
||||
0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x58, 0x0a, 0x1e, 0x63, 0x6f, 0x6d,
|
||||
0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65,
|
||||
0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x08, 0x43, 0x65, 0x6c,
|
||||
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f,
|
||||
0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
|
||||
0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_type_matcher_v3_cel_proto_rawDescOnce sync.Once
|
||||
file_xds_type_matcher_v3_cel_proto_rawDescData = file_xds_type_matcher_v3_cel_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_type_matcher_v3_cel_proto_rawDescGZIP() []byte {
|
||||
file_xds_type_matcher_v3_cel_proto_rawDescOnce.Do(func() {
|
||||
file_xds_type_matcher_v3_cel_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_type_matcher_v3_cel_proto_rawDescData)
|
||||
})
|
||||
return file_xds_type_matcher_v3_cel_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_type_matcher_v3_cel_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_xds_type_matcher_v3_cel_proto_goTypes = []interface{}{
|
||||
(*CelMatcher)(nil), // 0: xds.type.matcher.v3.CelMatcher
|
||||
(*v3.CelExpression)(nil), // 1: xds.type.v3.CelExpression
|
||||
}
|
||||
var file_xds_type_matcher_v3_cel_proto_depIdxs = []int32{
|
||||
1, // 0: xds.type.matcher.v3.CelMatcher.expr_match:type_name -> xds.type.v3.CelExpression
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_type_matcher_v3_cel_proto_init() }
|
||||
func file_xds_type_matcher_v3_cel_proto_init() {
|
||||
if File_xds_type_matcher_v3_cel_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_type_matcher_v3_cel_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CelMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_type_matcher_v3_cel_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_type_matcher_v3_cel_proto_goTypes,
|
||||
DependencyIndexes: file_xds_type_matcher_v3_cel_proto_depIdxs,
|
||||
MessageInfos: file_xds_type_matcher_v3_cel_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_type_matcher_v3_cel_proto = out.File
|
||||
file_xds_type_matcher_v3_cel_proto_rawDesc = nil
|
||||
file_xds_type_matcher_v3_cel_proto_goTypes = nil
|
||||
file_xds_type_matcher_v3_cel_proto_depIdxs = nil
|
||||
}
|
||||
177
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/cel.pb.validate.go
generated
vendored
Normal file
177
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/cel.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/type/matcher/v3/cel.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on CelMatcher with the rules defined in the
|
||||
// proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *CelMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on CelMatcher with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in CelMatcherMultiError, or
|
||||
// nil if none found.
|
||||
func (m *CelMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *CelMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if m.GetExprMatch() == nil {
|
||||
err := CelMatcherValidationError{
|
||||
field: "ExprMatch",
|
||||
reason: "value is required",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetExprMatch()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, CelMatcherValidationError{
|
||||
field: "ExprMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, CelMatcherValidationError{
|
||||
field: "ExprMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetExprMatch()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return CelMatcherValidationError{
|
||||
field: "ExprMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// no validation rules for Description
|
||||
|
||||
if len(errors) > 0 {
|
||||
return CelMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CelMatcherMultiError is an error wrapping multiple validation errors
|
||||
// returned by CelMatcher.ValidateAll() if the designated constraints aren't met.
|
||||
type CelMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m CelMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m CelMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// CelMatcherValidationError is the validation error returned by
|
||||
// CelMatcher.Validate if the designated constraints aren't met.
|
||||
type CelMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e CelMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e CelMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e CelMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e CelMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e CelMatcherValidationError) ErrorName() string { return "CelMatcherValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e CelMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sCelMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = CelMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = CelMatcherValidationError{}
|
||||
242
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/domain.pb.go
generated
vendored
Normal file
242
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/domain.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,242 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/type/matcher/v3/domain.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/cncf/xds/go/xds/annotations/v3"
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ServerNameMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
DomainMatchers []*ServerNameMatcher_DomainMatcher `protobuf:"bytes,1,rep,name=domain_matchers,json=domainMatchers,proto3" json:"domain_matchers,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ServerNameMatcher) Reset() {
|
||||
*x = ServerNameMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_domain_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ServerNameMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ServerNameMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *ServerNameMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_domain_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ServerNameMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*ServerNameMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_domain_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ServerNameMatcher) GetDomainMatchers() []*ServerNameMatcher_DomainMatcher {
|
||||
if x != nil {
|
||||
return x.DomainMatchers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ServerNameMatcher_DomainMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Domains []string `protobuf:"bytes,1,rep,name=domains,proto3" json:"domains,omitempty"`
|
||||
OnMatch *Matcher_OnMatch `protobuf:"bytes,2,opt,name=on_match,json=onMatch,proto3" json:"on_match,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ServerNameMatcher_DomainMatcher) Reset() {
|
||||
*x = ServerNameMatcher_DomainMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_domain_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ServerNameMatcher_DomainMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ServerNameMatcher_DomainMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *ServerNameMatcher_DomainMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_domain_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ServerNameMatcher_DomainMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*ServerNameMatcher_DomainMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_domain_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *ServerNameMatcher_DomainMatcher) GetDomains() []string {
|
||||
if x != nil {
|
||||
return x.Domains
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ServerNameMatcher_DomainMatcher) GetOnMatch() *Matcher_OnMatch {
|
||||
if x != nil {
|
||||
return x.OnMatch
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_xds_type_matcher_v3_domain_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_type_matcher_v3_domain_proto_rawDesc = []byte{
|
||||
0x0a, 0x20, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x13, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74,
|
||||
0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e,
|
||||
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79,
|
||||
0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x61,
|
||||
0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c,
|
||||
0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe8, 0x01, 0x0a, 0x11, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e,
|
||||
0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x5d, 0x0a, 0x0f, 0x64, 0x6f,
|
||||
0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d,
|
||||
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||
0x4e, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x44, 0x6f, 0x6d, 0x61,
|
||||
0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0e, 0x64, 0x6f, 0x6d, 0x61, 0x69,
|
||||
0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x1a, 0x74, 0x0a, 0x0d, 0x44, 0x6f, 0x6d,
|
||||
0x61, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x07, 0x64, 0x6f,
|
||||
0x6d, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05,
|
||||
0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x07, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x3f,
|
||||
0x0a, 0x08, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x24, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63,
|
||||
0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f,
|
||||
0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x42,
|
||||
0x6e, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67,
|
||||
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d,
|
||||
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x16, 0x53, 0x65, 0x72, 0x76, 0x65,
|
||||
0x72, 0x4e, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||
0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f,
|
||||
0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_type_matcher_v3_domain_proto_rawDescOnce sync.Once
|
||||
file_xds_type_matcher_v3_domain_proto_rawDescData = file_xds_type_matcher_v3_domain_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_type_matcher_v3_domain_proto_rawDescGZIP() []byte {
|
||||
file_xds_type_matcher_v3_domain_proto_rawDescOnce.Do(func() {
|
||||
file_xds_type_matcher_v3_domain_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_type_matcher_v3_domain_proto_rawDescData)
|
||||
})
|
||||
return file_xds_type_matcher_v3_domain_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_type_matcher_v3_domain_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_xds_type_matcher_v3_domain_proto_goTypes = []interface{}{
|
||||
(*ServerNameMatcher)(nil), // 0: xds.type.matcher.v3.ServerNameMatcher
|
||||
(*ServerNameMatcher_DomainMatcher)(nil), // 1: xds.type.matcher.v3.ServerNameMatcher.DomainMatcher
|
||||
(*Matcher_OnMatch)(nil), // 2: xds.type.matcher.v3.Matcher.OnMatch
|
||||
}
|
||||
var file_xds_type_matcher_v3_domain_proto_depIdxs = []int32{
|
||||
1, // 0: xds.type.matcher.v3.ServerNameMatcher.domain_matchers:type_name -> xds.type.matcher.v3.ServerNameMatcher.DomainMatcher
|
||||
2, // 1: xds.type.matcher.v3.ServerNameMatcher.DomainMatcher.on_match:type_name -> xds.type.matcher.v3.Matcher.OnMatch
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_type_matcher_v3_domain_proto_init() }
|
||||
func file_xds_type_matcher_v3_domain_proto_init() {
|
||||
if File_xds_type_matcher_v3_domain_proto != nil {
|
||||
return
|
||||
}
|
||||
file_xds_type_matcher_v3_matcher_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_type_matcher_v3_domain_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ServerNameMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_type_matcher_v3_domain_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ServerNameMatcher_DomainMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_type_matcher_v3_domain_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_type_matcher_v3_domain_proto_goTypes,
|
||||
DependencyIndexes: file_xds_type_matcher_v3_domain_proto_depIdxs,
|
||||
MessageInfos: file_xds_type_matcher_v3_domain_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_type_matcher_v3_domain_proto = out.File
|
||||
file_xds_type_matcher_v3_domain_proto_rawDesc = nil
|
||||
file_xds_type_matcher_v3_domain_proto_goTypes = nil
|
||||
file_xds_type_matcher_v3_domain_proto_depIdxs = nil
|
||||
}
|
||||
315
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/domain.pb.validate.go
generated
vendored
Normal file
315
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/domain.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,315 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/type/matcher/v3/domain.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on ServerNameMatcher with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
func (m *ServerNameMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on ServerNameMatcher with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// ServerNameMatcherMultiError, or nil if none found.
|
||||
func (m *ServerNameMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *ServerNameMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
for idx, item := range m.GetDomainMatchers() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, ServerNameMatcherValidationError{
|
||||
field: fmt.Sprintf("DomainMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, ServerNameMatcherValidationError{
|
||||
field: fmt.Sprintf("DomainMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ServerNameMatcherValidationError{
|
||||
field: fmt.Sprintf("DomainMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ServerNameMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ServerNameMatcherMultiError is an error wrapping multiple validation errors
|
||||
// returned by ServerNameMatcher.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type ServerNameMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ServerNameMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ServerNameMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ServerNameMatcherValidationError is the validation error returned by
|
||||
// ServerNameMatcher.Validate if the designated constraints aren't met.
|
||||
type ServerNameMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ServerNameMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ServerNameMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ServerNameMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ServerNameMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ServerNameMatcherValidationError) ErrorName() string {
|
||||
return "ServerNameMatcherValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ServerNameMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sServerNameMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ServerNameMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ServerNameMatcherValidationError{}
|
||||
|
||||
// Validate checks the field values on ServerNameMatcher_DomainMatcher with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *ServerNameMatcher_DomainMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on ServerNameMatcher_DomainMatcher with
|
||||
// the rules defined in the proto definition for this message. If any rules
|
||||
// are violated, the result is a list of violation errors wrapped in
|
||||
// ServerNameMatcher_DomainMatcherMultiError, or nil if none found.
|
||||
func (m *ServerNameMatcher_DomainMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *ServerNameMatcher_DomainMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if len(m.GetDomains()) < 1 {
|
||||
err := ServerNameMatcher_DomainMatcherValidationError{
|
||||
field: "Domains",
|
||||
reason: "value must contain at least 1 item(s)",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetOnMatch()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, ServerNameMatcher_DomainMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, ServerNameMatcher_DomainMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ServerNameMatcher_DomainMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ServerNameMatcher_DomainMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ServerNameMatcher_DomainMatcherMultiError is an error wrapping multiple
|
||||
// validation errors returned by ServerNameMatcher_DomainMatcher.ValidateAll()
|
||||
// if the designated constraints aren't met.
|
||||
type ServerNameMatcher_DomainMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ServerNameMatcher_DomainMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ServerNameMatcher_DomainMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ServerNameMatcher_DomainMatcherValidationError is the validation error
|
||||
// returned by ServerNameMatcher_DomainMatcher.Validate if the designated
|
||||
// constraints aren't met.
|
||||
type ServerNameMatcher_DomainMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ServerNameMatcher_DomainMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ServerNameMatcher_DomainMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ServerNameMatcher_DomainMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ServerNameMatcher_DomainMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ServerNameMatcher_DomainMatcherValidationError) ErrorName() string {
|
||||
return "ServerNameMatcher_DomainMatcherValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ServerNameMatcher_DomainMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sServerNameMatcher_DomainMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ServerNameMatcher_DomainMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ServerNameMatcher_DomainMatcherValidationError{}
|
||||
140
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/http_inputs.pb.go
generated
vendored
Normal file
140
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/http_inputs.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/type/matcher/v3/http_inputs.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type HttpAttributesCelMatchInput struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *HttpAttributesCelMatchInput) Reset() {
|
||||
*x = HttpAttributesCelMatchInput{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_http_inputs_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *HttpAttributesCelMatchInput) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HttpAttributesCelMatchInput) ProtoMessage() {}
|
||||
|
||||
func (x *HttpAttributesCelMatchInput) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_http_inputs_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use HttpAttributesCelMatchInput.ProtoReflect.Descriptor instead.
|
||||
func (*HttpAttributesCelMatchInput) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_http_inputs_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
var File_xds_type_matcher_v3_http_inputs_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_type_matcher_v3_http_inputs_proto_rawDesc = []byte{
|
||||
0x0a, 0x25, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74,
|
||||
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70,
|
||||
0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x22, 0x1d, 0x0a, 0x1b,
|
||||
0x48, 0x74, 0x74, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x65,
|
||||
0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x42, 0x5f, 0x0a, 0x1e, 0x63,
|
||||
0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79,
|
||||
0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0f, 0x48,
|
||||
0x74, 0x74, 0x70, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
|
||||
0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63,
|
||||
0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70,
|
||||
0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_type_matcher_v3_http_inputs_proto_rawDescOnce sync.Once
|
||||
file_xds_type_matcher_v3_http_inputs_proto_rawDescData = file_xds_type_matcher_v3_http_inputs_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_type_matcher_v3_http_inputs_proto_rawDescGZIP() []byte {
|
||||
file_xds_type_matcher_v3_http_inputs_proto_rawDescOnce.Do(func() {
|
||||
file_xds_type_matcher_v3_http_inputs_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_type_matcher_v3_http_inputs_proto_rawDescData)
|
||||
})
|
||||
return file_xds_type_matcher_v3_http_inputs_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_type_matcher_v3_http_inputs_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_xds_type_matcher_v3_http_inputs_proto_goTypes = []interface{}{
|
||||
(*HttpAttributesCelMatchInput)(nil), // 0: xds.type.matcher.v3.HttpAttributesCelMatchInput
|
||||
}
|
||||
var file_xds_type_matcher_v3_http_inputs_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_type_matcher_v3_http_inputs_proto_init() }
|
||||
func file_xds_type_matcher_v3_http_inputs_proto_init() {
|
||||
if File_xds_type_matcher_v3_http_inputs_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_type_matcher_v3_http_inputs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*HttpAttributesCelMatchInput); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_type_matcher_v3_http_inputs_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_type_matcher_v3_http_inputs_proto_goTypes,
|
||||
DependencyIndexes: file_xds_type_matcher_v3_http_inputs_proto_depIdxs,
|
||||
MessageInfos: file_xds_type_matcher_v3_http_inputs_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_type_matcher_v3_http_inputs_proto = out.File
|
||||
file_xds_type_matcher_v3_http_inputs_proto_rawDesc = nil
|
||||
file_xds_type_matcher_v3_http_inputs_proto_goTypes = nil
|
||||
file_xds_type_matcher_v3_http_inputs_proto_depIdxs = nil
|
||||
}
|
||||
139
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/http_inputs.pb.validate.go
generated
vendored
Normal file
139
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/http_inputs.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/type/matcher/v3/http_inputs.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on HttpAttributesCelMatchInput with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *HttpAttributesCelMatchInput) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on HttpAttributesCelMatchInput with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// HttpAttributesCelMatchInputMultiError, or nil if none found.
|
||||
func (m *HttpAttributesCelMatchInput) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *HttpAttributesCelMatchInput) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if len(errors) > 0 {
|
||||
return HttpAttributesCelMatchInputMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// HttpAttributesCelMatchInputMultiError is an error wrapping multiple
|
||||
// validation errors returned by HttpAttributesCelMatchInput.ValidateAll() if
|
||||
// the designated constraints aren't met.
|
||||
type HttpAttributesCelMatchInputMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m HttpAttributesCelMatchInputMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m HttpAttributesCelMatchInputMultiError) AllErrors() []error { return m }
|
||||
|
||||
// HttpAttributesCelMatchInputValidationError is the validation error returned
|
||||
// by HttpAttributesCelMatchInput.Validate if the designated constraints
|
||||
// aren't met.
|
||||
type HttpAttributesCelMatchInputValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e HttpAttributesCelMatchInputValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e HttpAttributesCelMatchInputValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e HttpAttributesCelMatchInputValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e HttpAttributesCelMatchInputValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e HttpAttributesCelMatchInputValidationError) ErrorName() string {
|
||||
return "HttpAttributesCelMatchInputValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e HttpAttributesCelMatchInputValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sHttpAttributesCelMatchInput.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = HttpAttributesCelMatchInputValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = HttpAttributesCelMatchInputValidationError{}
|
||||
256
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/ip.pb.go
generated
vendored
Normal file
256
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/ip.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,256 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/type/matcher/v3/ip.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/cncf/xds/go/xds/annotations/v3"
|
||||
v3 "github.com/cncf/xds/go/xds/core/v3"
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type IPMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
RangeMatchers []*IPMatcher_IPRangeMatcher `protobuf:"bytes,1,rep,name=range_matchers,json=rangeMatchers,proto3" json:"range_matchers,omitempty"`
|
||||
}
|
||||
|
||||
func (x *IPMatcher) Reset() {
|
||||
*x = IPMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_ip_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *IPMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*IPMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *IPMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_ip_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use IPMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*IPMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_ip_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *IPMatcher) GetRangeMatchers() []*IPMatcher_IPRangeMatcher {
|
||||
if x != nil {
|
||||
return x.RangeMatchers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type IPMatcher_IPRangeMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Ranges []*v3.CidrRange `protobuf:"bytes,1,rep,name=ranges,proto3" json:"ranges,omitempty"`
|
||||
OnMatch *Matcher_OnMatch `protobuf:"bytes,2,opt,name=on_match,json=onMatch,proto3" json:"on_match,omitempty"`
|
||||
Exclusive bool `protobuf:"varint,3,opt,name=exclusive,proto3" json:"exclusive,omitempty"`
|
||||
}
|
||||
|
||||
func (x *IPMatcher_IPRangeMatcher) Reset() {
|
||||
*x = IPMatcher_IPRangeMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_ip_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *IPMatcher_IPRangeMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*IPMatcher_IPRangeMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *IPMatcher_IPRangeMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_ip_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use IPMatcher_IPRangeMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*IPMatcher_IPRangeMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_ip_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *IPMatcher_IPRangeMatcher) GetRanges() []*v3.CidrRange {
|
||||
if x != nil {
|
||||
return x.Ranges
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *IPMatcher_IPRangeMatcher) GetOnMatch() *Matcher_OnMatch {
|
||||
if x != nil {
|
||||
return x.OnMatch
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *IPMatcher_IPRangeMatcher) GetExclusive() bool {
|
||||
if x != nil {
|
||||
return x.Exclusive
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_xds_type_matcher_v3_ip_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_type_matcher_v3_ip_proto_rawDesc = []byte{
|
||||
0x0a, 0x1c, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x69, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13,
|
||||
0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
|
||||
0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76,
|
||||
0x33, 0x2f, 0x63, 0x69, 0x64, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x78, 0x64,
|
||||
0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76,
|
||||
0x33, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
|
||||
0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
|
||||
0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x02, 0x0a, 0x09, 0x49, 0x50, 0x4d,
|
||||
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x0e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f,
|
||||
0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d,
|
||||
0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
|
||||
0x72, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x50, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x49,
|
||||
0x50, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0d, 0x72,
|
||||
0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x1a, 0xa9, 0x01, 0x0a,
|
||||
0x0e, 0x49, 0x50, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12,
|
||||
0x38, 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x16, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x69,
|
||||
0x64, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08,
|
||||
0x01, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x6e, 0x5f,
|
||||
0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x64,
|
||||
0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76,
|
||||
0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63,
|
||||
0x68, 0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78,
|
||||
0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x65,
|
||||
0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x42, 0x66, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02,
|
||||
0x08, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78,
|
||||
0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e,
|
||||
0x76, 0x33, 0x42, 0x0e, 0x49, 0x50, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73,
|
||||
0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_type_matcher_v3_ip_proto_rawDescOnce sync.Once
|
||||
file_xds_type_matcher_v3_ip_proto_rawDescData = file_xds_type_matcher_v3_ip_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_type_matcher_v3_ip_proto_rawDescGZIP() []byte {
|
||||
file_xds_type_matcher_v3_ip_proto_rawDescOnce.Do(func() {
|
||||
file_xds_type_matcher_v3_ip_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_type_matcher_v3_ip_proto_rawDescData)
|
||||
})
|
||||
return file_xds_type_matcher_v3_ip_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_type_matcher_v3_ip_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_xds_type_matcher_v3_ip_proto_goTypes = []interface{}{
|
||||
(*IPMatcher)(nil), // 0: xds.type.matcher.v3.IPMatcher
|
||||
(*IPMatcher_IPRangeMatcher)(nil), // 1: xds.type.matcher.v3.IPMatcher.IPRangeMatcher
|
||||
(*v3.CidrRange)(nil), // 2: xds.core.v3.CidrRange
|
||||
(*Matcher_OnMatch)(nil), // 3: xds.type.matcher.v3.Matcher.OnMatch
|
||||
}
|
||||
var file_xds_type_matcher_v3_ip_proto_depIdxs = []int32{
|
||||
1, // 0: xds.type.matcher.v3.IPMatcher.range_matchers:type_name -> xds.type.matcher.v3.IPMatcher.IPRangeMatcher
|
||||
2, // 1: xds.type.matcher.v3.IPMatcher.IPRangeMatcher.ranges:type_name -> xds.core.v3.CidrRange
|
||||
3, // 2: xds.type.matcher.v3.IPMatcher.IPRangeMatcher.on_match:type_name -> xds.type.matcher.v3.Matcher.OnMatch
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_type_matcher_v3_ip_proto_init() }
|
||||
func file_xds_type_matcher_v3_ip_proto_init() {
|
||||
if File_xds_type_matcher_v3_ip_proto != nil {
|
||||
return
|
||||
}
|
||||
file_xds_type_matcher_v3_matcher_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_type_matcher_v3_ip_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*IPMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_type_matcher_v3_ip_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*IPMatcher_IPRangeMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_type_matcher_v3_ip_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_type_matcher_v3_ip_proto_goTypes,
|
||||
DependencyIndexes: file_xds_type_matcher_v3_ip_proto_depIdxs,
|
||||
MessageInfos: file_xds_type_matcher_v3_ip_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_type_matcher_v3_ip_proto = out.File
|
||||
file_xds_type_matcher_v3_ip_proto_rawDesc = nil
|
||||
file_xds_type_matcher_v3_ip_proto_goTypes = nil
|
||||
file_xds_type_matcher_v3_ip_proto_depIdxs = nil
|
||||
}
|
||||
347
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/ip.pb.validate.go
generated
vendored
Normal file
347
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/ip.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,347 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/type/matcher/v3/ip.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on IPMatcher with the rules defined in the
|
||||
// proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *IPMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on IPMatcher with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in IPMatcherMultiError, or nil
|
||||
// if none found.
|
||||
func (m *IPMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *IPMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
for idx, item := range m.GetRangeMatchers() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, IPMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, IPMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return IPMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return IPMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// IPMatcherMultiError is an error wrapping multiple validation errors returned
|
||||
// by IPMatcher.ValidateAll() if the designated constraints aren't met.
|
||||
type IPMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m IPMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m IPMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// IPMatcherValidationError is the validation error returned by
|
||||
// IPMatcher.Validate if the designated constraints aren't met.
|
||||
type IPMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e IPMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e IPMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e IPMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e IPMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e IPMatcherValidationError) ErrorName() string { return "IPMatcherValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e IPMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sIPMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = IPMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = IPMatcherValidationError{}
|
||||
|
||||
// Validate checks the field values on IPMatcher_IPRangeMatcher with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *IPMatcher_IPRangeMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on IPMatcher_IPRangeMatcher with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// IPMatcher_IPRangeMatcherMultiError, or nil if none found.
|
||||
func (m *IPMatcher_IPRangeMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *IPMatcher_IPRangeMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if len(m.GetRanges()) < 1 {
|
||||
err := IPMatcher_IPRangeMatcherValidationError{
|
||||
field: "Ranges",
|
||||
reason: "value must contain at least 1 item(s)",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
for idx, item := range m.GetRanges() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, IPMatcher_IPRangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, IPMatcher_IPRangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return IPMatcher_IPRangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetOnMatch()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, IPMatcher_IPRangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, IPMatcher_IPRangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return IPMatcher_IPRangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// no validation rules for Exclusive
|
||||
|
||||
if len(errors) > 0 {
|
||||
return IPMatcher_IPRangeMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// IPMatcher_IPRangeMatcherMultiError is an error wrapping multiple validation
|
||||
// errors returned by IPMatcher_IPRangeMatcher.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type IPMatcher_IPRangeMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m IPMatcher_IPRangeMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m IPMatcher_IPRangeMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// IPMatcher_IPRangeMatcherValidationError is the validation error returned by
|
||||
// IPMatcher_IPRangeMatcher.Validate if the designated constraints aren't met.
|
||||
type IPMatcher_IPRangeMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e IPMatcher_IPRangeMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e IPMatcher_IPRangeMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e IPMatcher_IPRangeMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e IPMatcher_IPRangeMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e IPMatcher_IPRangeMatcherValidationError) ErrorName() string {
|
||||
return "IPMatcher_IPRangeMatcherValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e IPMatcher_IPRangeMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sIPMatcher_IPRangeMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = IPMatcher_IPRangeMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = IPMatcher_IPRangeMatcherValidationError{}
|
||||
1056
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/matcher.pb.go
generated
vendored
Normal file
1056
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/matcher.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1913
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/matcher.pb.validate.go
generated
vendored
Normal file
1913
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/matcher.pb.validate.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
539
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/range.pb.go
generated
vendored
Normal file
539
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/range.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,539 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/type/matcher/v3/range.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
v3 "github.com/cncf/xds/go/xds/type/v3"
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Int64RangeMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
RangeMatchers []*Int64RangeMatcher_RangeMatcher `protobuf:"bytes,1,rep,name=range_matchers,json=rangeMatchers,proto3" json:"range_matchers,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Int64RangeMatcher) Reset() {
|
||||
*x = Int64RangeMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Int64RangeMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Int64RangeMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *Int64RangeMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Int64RangeMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*Int64RangeMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Int64RangeMatcher) GetRangeMatchers() []*Int64RangeMatcher_RangeMatcher {
|
||||
if x != nil {
|
||||
return x.RangeMatchers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Int32RangeMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
RangeMatchers []*Int32RangeMatcher_RangeMatcher `protobuf:"bytes,1,rep,name=range_matchers,json=rangeMatchers,proto3" json:"range_matchers,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Int32RangeMatcher) Reset() {
|
||||
*x = Int32RangeMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Int32RangeMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Int32RangeMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *Int32RangeMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Int32RangeMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*Int32RangeMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Int32RangeMatcher) GetRangeMatchers() []*Int32RangeMatcher_RangeMatcher {
|
||||
if x != nil {
|
||||
return x.RangeMatchers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DoubleRangeMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
RangeMatchers []*DoubleRangeMatcher_RangeMatcher `protobuf:"bytes,1,rep,name=range_matchers,json=rangeMatchers,proto3" json:"range_matchers,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DoubleRangeMatcher) Reset() {
|
||||
*x = DoubleRangeMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DoubleRangeMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DoubleRangeMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *DoubleRangeMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DoubleRangeMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*DoubleRangeMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *DoubleRangeMatcher) GetRangeMatchers() []*DoubleRangeMatcher_RangeMatcher {
|
||||
if x != nil {
|
||||
return x.RangeMatchers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Int64RangeMatcher_RangeMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Ranges []*v3.Int64Range `protobuf:"bytes,1,rep,name=ranges,proto3" json:"ranges,omitempty"`
|
||||
OnMatch *Matcher_OnMatch `protobuf:"bytes,2,opt,name=on_match,json=onMatch,proto3" json:"on_match,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Int64RangeMatcher_RangeMatcher) Reset() {
|
||||
*x = Int64RangeMatcher_RangeMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Int64RangeMatcher_RangeMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Int64RangeMatcher_RangeMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *Int64RangeMatcher_RangeMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Int64RangeMatcher_RangeMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*Int64RangeMatcher_RangeMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *Int64RangeMatcher_RangeMatcher) GetRanges() []*v3.Int64Range {
|
||||
if x != nil {
|
||||
return x.Ranges
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Int64RangeMatcher_RangeMatcher) GetOnMatch() *Matcher_OnMatch {
|
||||
if x != nil {
|
||||
return x.OnMatch
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Int32RangeMatcher_RangeMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Ranges []*v3.Int32Range `protobuf:"bytes,1,rep,name=ranges,proto3" json:"ranges,omitempty"`
|
||||
OnMatch *Matcher_OnMatch `protobuf:"bytes,2,opt,name=on_match,json=onMatch,proto3" json:"on_match,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Int32RangeMatcher_RangeMatcher) Reset() {
|
||||
*x = Int32RangeMatcher_RangeMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Int32RangeMatcher_RangeMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Int32RangeMatcher_RangeMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *Int32RangeMatcher_RangeMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Int32RangeMatcher_RangeMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*Int32RangeMatcher_RangeMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{1, 0}
|
||||
}
|
||||
|
||||
func (x *Int32RangeMatcher_RangeMatcher) GetRanges() []*v3.Int32Range {
|
||||
if x != nil {
|
||||
return x.Ranges
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Int32RangeMatcher_RangeMatcher) GetOnMatch() *Matcher_OnMatch {
|
||||
if x != nil {
|
||||
return x.OnMatch
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DoubleRangeMatcher_RangeMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Ranges []*v3.DoubleRange `protobuf:"bytes,1,rep,name=ranges,proto3" json:"ranges,omitempty"`
|
||||
OnMatch *Matcher_OnMatch `protobuf:"bytes,2,opt,name=on_match,json=onMatch,proto3" json:"on_match,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DoubleRangeMatcher_RangeMatcher) Reset() {
|
||||
*x = DoubleRangeMatcher_RangeMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DoubleRangeMatcher_RangeMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DoubleRangeMatcher_RangeMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *DoubleRangeMatcher_RangeMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_range_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DoubleRangeMatcher_RangeMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*DoubleRangeMatcher_RangeMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{2, 0}
|
||||
}
|
||||
|
||||
func (x *DoubleRangeMatcher_RangeMatcher) GetRanges() []*v3.DoubleRange {
|
||||
if x != nil {
|
||||
return x.Ranges
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DoubleRangeMatcher_RangeMatcher) GetOnMatch() *Matcher_OnMatch {
|
||||
if x != nil {
|
||||
return x.OnMatch
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_xds_type_matcher_v3_range_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_type_matcher_v3_range_proto_rawDesc = []byte{
|
||||
0x0a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x13, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63,
|
||||
0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x17, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65,
|
||||
0x2f, 0x76, 0x33, 0x2f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
|
||||
0x21, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
|
||||
0x72, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c,
|
||||
0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfc, 0x01, 0x0a, 0x11,
|
||||
0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65,
|
||||
0x72, 0x12, 0x5a, 0x0a, 0x0e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, 0x64, 0x73, 0x2e,
|
||||
0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e,
|
||||
0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65,
|
||||
0x72, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0d,
|
||||
0x72, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x1a, 0x8a, 0x01,
|
||||
0x0a, 0x0c, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x39,
|
||||
0x0a, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17,
|
||||
0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x74,
|
||||
0x36, 0x34, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08,
|
||||
0x01, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x6e, 0x5f,
|
||||
0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x64,
|
||||
0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76,
|
||||
0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63,
|
||||
0x68, 0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xfc, 0x01, 0x0a, 0x11, 0x49,
|
||||
0x6e, 0x74, 0x33, 0x32, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
|
||||
0x12, 0x5a, 0x0a, 0x0e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
|
||||
0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74,
|
||||
0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x49,
|
||||
0x6e, 0x74, 0x33, 0x32, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
|
||||
0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0d, 0x72,
|
||||
0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x1a, 0x8a, 0x01, 0x0a,
|
||||
0x0c, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x39, 0x0a,
|
||||
0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e,
|
||||
0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x74, 0x33,
|
||||
0x32, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01,
|
||||
0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x6e, 0x5f, 0x6d,
|
||||
0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x64, 0x73,
|
||||
0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33,
|
||||
0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xff, 0x01, 0x0a, 0x12, 0x44, 0x6f,
|
||||
0x75, 0x62, 0x6c, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
|
||||
0x12, 0x5b, 0x0a, 0x0e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
|
||||
0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74,
|
||||
0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x44,
|
||||
0x6f, 0x75, 0x62, 0x6c, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65,
|
||||
0x72, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0d,
|
||||
0x72, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x1a, 0x8b, 0x01,
|
||||
0x0a, 0x0c, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x3a,
|
||||
0x0a, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18,
|
||||
0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x6f, 0x75,
|
||||
0x62, 0x6c, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02,
|
||||
0x08, 0x01, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x6e,
|
||||
0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78,
|
||||
0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e,
|
||||
0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74,
|
||||
0x63, 0x68, 0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x5a, 0x0a, 0x1e, 0x63,
|
||||
0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79,
|
||||
0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0a, 0x52,
|
||||
0x61, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74,
|
||||
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73,
|
||||
0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74,
|
||||
0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_type_matcher_v3_range_proto_rawDescOnce sync.Once
|
||||
file_xds_type_matcher_v3_range_proto_rawDescData = file_xds_type_matcher_v3_range_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_type_matcher_v3_range_proto_rawDescGZIP() []byte {
|
||||
file_xds_type_matcher_v3_range_proto_rawDescOnce.Do(func() {
|
||||
file_xds_type_matcher_v3_range_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_type_matcher_v3_range_proto_rawDescData)
|
||||
})
|
||||
return file_xds_type_matcher_v3_range_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_type_matcher_v3_range_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_xds_type_matcher_v3_range_proto_goTypes = []interface{}{
|
||||
(*Int64RangeMatcher)(nil), // 0: xds.type.matcher.v3.Int64RangeMatcher
|
||||
(*Int32RangeMatcher)(nil), // 1: xds.type.matcher.v3.Int32RangeMatcher
|
||||
(*DoubleRangeMatcher)(nil), // 2: xds.type.matcher.v3.DoubleRangeMatcher
|
||||
(*Int64RangeMatcher_RangeMatcher)(nil), // 3: xds.type.matcher.v3.Int64RangeMatcher.RangeMatcher
|
||||
(*Int32RangeMatcher_RangeMatcher)(nil), // 4: xds.type.matcher.v3.Int32RangeMatcher.RangeMatcher
|
||||
(*DoubleRangeMatcher_RangeMatcher)(nil), // 5: xds.type.matcher.v3.DoubleRangeMatcher.RangeMatcher
|
||||
(*v3.Int64Range)(nil), // 6: xds.type.v3.Int64Range
|
||||
(*Matcher_OnMatch)(nil), // 7: xds.type.matcher.v3.Matcher.OnMatch
|
||||
(*v3.Int32Range)(nil), // 8: xds.type.v3.Int32Range
|
||||
(*v3.DoubleRange)(nil), // 9: xds.type.v3.DoubleRange
|
||||
}
|
||||
var file_xds_type_matcher_v3_range_proto_depIdxs = []int32{
|
||||
3, // 0: xds.type.matcher.v3.Int64RangeMatcher.range_matchers:type_name -> xds.type.matcher.v3.Int64RangeMatcher.RangeMatcher
|
||||
4, // 1: xds.type.matcher.v3.Int32RangeMatcher.range_matchers:type_name -> xds.type.matcher.v3.Int32RangeMatcher.RangeMatcher
|
||||
5, // 2: xds.type.matcher.v3.DoubleRangeMatcher.range_matchers:type_name -> xds.type.matcher.v3.DoubleRangeMatcher.RangeMatcher
|
||||
6, // 3: xds.type.matcher.v3.Int64RangeMatcher.RangeMatcher.ranges:type_name -> xds.type.v3.Int64Range
|
||||
7, // 4: xds.type.matcher.v3.Int64RangeMatcher.RangeMatcher.on_match:type_name -> xds.type.matcher.v3.Matcher.OnMatch
|
||||
8, // 5: xds.type.matcher.v3.Int32RangeMatcher.RangeMatcher.ranges:type_name -> xds.type.v3.Int32Range
|
||||
7, // 6: xds.type.matcher.v3.Int32RangeMatcher.RangeMatcher.on_match:type_name -> xds.type.matcher.v3.Matcher.OnMatch
|
||||
9, // 7: xds.type.matcher.v3.DoubleRangeMatcher.RangeMatcher.ranges:type_name -> xds.type.v3.DoubleRange
|
||||
7, // 8: xds.type.matcher.v3.DoubleRangeMatcher.RangeMatcher.on_match:type_name -> xds.type.matcher.v3.Matcher.OnMatch
|
||||
9, // [9:9] is the sub-list for method output_type
|
||||
9, // [9:9] is the sub-list for method input_type
|
||||
9, // [9:9] is the sub-list for extension type_name
|
||||
9, // [9:9] is the sub-list for extension extendee
|
||||
0, // [0:9] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_type_matcher_v3_range_proto_init() }
|
||||
func file_xds_type_matcher_v3_range_proto_init() {
|
||||
if File_xds_type_matcher_v3_range_proto != nil {
|
||||
return
|
||||
}
|
||||
file_xds_type_matcher_v3_matcher_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_type_matcher_v3_range_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Int64RangeMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_type_matcher_v3_range_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Int32RangeMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_type_matcher_v3_range_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DoubleRangeMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_type_matcher_v3_range_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Int64RangeMatcher_RangeMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_type_matcher_v3_range_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Int32RangeMatcher_RangeMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_type_matcher_v3_range_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DoubleRangeMatcher_RangeMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_type_matcher_v3_range_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_type_matcher_v3_range_proto_goTypes,
|
||||
DependencyIndexes: file_xds_type_matcher_v3_range_proto_depIdxs,
|
||||
MessageInfos: file_xds_type_matcher_v3_range_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_type_matcher_v3_range_proto = out.File
|
||||
file_xds_type_matcher_v3_range_proto_rawDesc = nil
|
||||
file_xds_type_matcher_v3_range_proto_goTypes = nil
|
||||
file_xds_type_matcher_v3_range_proto_depIdxs = nil
|
||||
}
|
||||
975
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/range.pb.validate.go
generated
vendored
Normal file
975
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/range.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,975 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/type/matcher/v3/range.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on Int64RangeMatcher with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
func (m *Int64RangeMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on Int64RangeMatcher with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// Int64RangeMatcherMultiError, or nil if none found.
|
||||
func (m *Int64RangeMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *Int64RangeMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
for idx, item := range m.GetRangeMatchers() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, Int64RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, Int64RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return Int64RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return Int64RangeMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Int64RangeMatcherMultiError is an error wrapping multiple validation errors
|
||||
// returned by Int64RangeMatcher.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type Int64RangeMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m Int64RangeMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m Int64RangeMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// Int64RangeMatcherValidationError is the validation error returned by
|
||||
// Int64RangeMatcher.Validate if the designated constraints aren't met.
|
||||
type Int64RangeMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e Int64RangeMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e Int64RangeMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e Int64RangeMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e Int64RangeMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e Int64RangeMatcherValidationError) ErrorName() string {
|
||||
return "Int64RangeMatcherValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e Int64RangeMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sInt64RangeMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = Int64RangeMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = Int64RangeMatcherValidationError{}
|
||||
|
||||
// Validate checks the field values on Int32RangeMatcher with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
func (m *Int32RangeMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on Int32RangeMatcher with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// Int32RangeMatcherMultiError, or nil if none found.
|
||||
func (m *Int32RangeMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *Int32RangeMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
for idx, item := range m.GetRangeMatchers() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, Int32RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, Int32RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return Int32RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return Int32RangeMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Int32RangeMatcherMultiError is an error wrapping multiple validation errors
|
||||
// returned by Int32RangeMatcher.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type Int32RangeMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m Int32RangeMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m Int32RangeMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// Int32RangeMatcherValidationError is the validation error returned by
|
||||
// Int32RangeMatcher.Validate if the designated constraints aren't met.
|
||||
type Int32RangeMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e Int32RangeMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e Int32RangeMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e Int32RangeMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e Int32RangeMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e Int32RangeMatcherValidationError) ErrorName() string {
|
||||
return "Int32RangeMatcherValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e Int32RangeMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sInt32RangeMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = Int32RangeMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = Int32RangeMatcherValidationError{}
|
||||
|
||||
// Validate checks the field values on DoubleRangeMatcher with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *DoubleRangeMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on DoubleRangeMatcher with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// DoubleRangeMatcherMultiError, or nil if none found.
|
||||
func (m *DoubleRangeMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *DoubleRangeMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
for idx, item := range m.GetRangeMatchers() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, DoubleRangeMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, DoubleRangeMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return DoubleRangeMatcherValidationError{
|
||||
field: fmt.Sprintf("RangeMatchers[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return DoubleRangeMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// DoubleRangeMatcherMultiError is an error wrapping multiple validation errors
|
||||
// returned by DoubleRangeMatcher.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type DoubleRangeMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m DoubleRangeMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m DoubleRangeMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// DoubleRangeMatcherValidationError is the validation error returned by
|
||||
// DoubleRangeMatcher.Validate if the designated constraints aren't met.
|
||||
type DoubleRangeMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e DoubleRangeMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e DoubleRangeMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e DoubleRangeMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e DoubleRangeMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e DoubleRangeMatcherValidationError) ErrorName() string {
|
||||
return "DoubleRangeMatcherValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e DoubleRangeMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sDoubleRangeMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = DoubleRangeMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = DoubleRangeMatcherValidationError{}
|
||||
|
||||
// Validate checks the field values on Int64RangeMatcher_RangeMatcher with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *Int64RangeMatcher_RangeMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on Int64RangeMatcher_RangeMatcher with
|
||||
// the rules defined in the proto definition for this message. If any rules
|
||||
// are violated, the result is a list of violation errors wrapped in
|
||||
// Int64RangeMatcher_RangeMatcherMultiError, or nil if none found.
|
||||
func (m *Int64RangeMatcher_RangeMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *Int64RangeMatcher_RangeMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if len(m.GetRanges()) < 1 {
|
||||
err := Int64RangeMatcher_RangeMatcherValidationError{
|
||||
field: "Ranges",
|
||||
reason: "value must contain at least 1 item(s)",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
for idx, item := range m.GetRanges() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, Int64RangeMatcher_RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, Int64RangeMatcher_RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return Int64RangeMatcher_RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetOnMatch()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, Int64RangeMatcher_RangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, Int64RangeMatcher_RangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return Int64RangeMatcher_RangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return Int64RangeMatcher_RangeMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Int64RangeMatcher_RangeMatcherMultiError is an error wrapping multiple
|
||||
// validation errors returned by Int64RangeMatcher_RangeMatcher.ValidateAll()
|
||||
// if the designated constraints aren't met.
|
||||
type Int64RangeMatcher_RangeMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m Int64RangeMatcher_RangeMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m Int64RangeMatcher_RangeMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// Int64RangeMatcher_RangeMatcherValidationError is the validation error
|
||||
// returned by Int64RangeMatcher_RangeMatcher.Validate if the designated
|
||||
// constraints aren't met.
|
||||
type Int64RangeMatcher_RangeMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e Int64RangeMatcher_RangeMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e Int64RangeMatcher_RangeMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e Int64RangeMatcher_RangeMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e Int64RangeMatcher_RangeMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e Int64RangeMatcher_RangeMatcherValidationError) ErrorName() string {
|
||||
return "Int64RangeMatcher_RangeMatcherValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e Int64RangeMatcher_RangeMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sInt64RangeMatcher_RangeMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = Int64RangeMatcher_RangeMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = Int64RangeMatcher_RangeMatcherValidationError{}
|
||||
|
||||
// Validate checks the field values on Int32RangeMatcher_RangeMatcher with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *Int32RangeMatcher_RangeMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on Int32RangeMatcher_RangeMatcher with
|
||||
// the rules defined in the proto definition for this message. If any rules
|
||||
// are violated, the result is a list of violation errors wrapped in
|
||||
// Int32RangeMatcher_RangeMatcherMultiError, or nil if none found.
|
||||
func (m *Int32RangeMatcher_RangeMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *Int32RangeMatcher_RangeMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if len(m.GetRanges()) < 1 {
|
||||
err := Int32RangeMatcher_RangeMatcherValidationError{
|
||||
field: "Ranges",
|
||||
reason: "value must contain at least 1 item(s)",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
for idx, item := range m.GetRanges() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, Int32RangeMatcher_RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, Int32RangeMatcher_RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return Int32RangeMatcher_RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetOnMatch()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, Int32RangeMatcher_RangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, Int32RangeMatcher_RangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return Int32RangeMatcher_RangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return Int32RangeMatcher_RangeMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Int32RangeMatcher_RangeMatcherMultiError is an error wrapping multiple
|
||||
// validation errors returned by Int32RangeMatcher_RangeMatcher.ValidateAll()
|
||||
// if the designated constraints aren't met.
|
||||
type Int32RangeMatcher_RangeMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m Int32RangeMatcher_RangeMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m Int32RangeMatcher_RangeMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// Int32RangeMatcher_RangeMatcherValidationError is the validation error
|
||||
// returned by Int32RangeMatcher_RangeMatcher.Validate if the designated
|
||||
// constraints aren't met.
|
||||
type Int32RangeMatcher_RangeMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e Int32RangeMatcher_RangeMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e Int32RangeMatcher_RangeMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e Int32RangeMatcher_RangeMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e Int32RangeMatcher_RangeMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e Int32RangeMatcher_RangeMatcherValidationError) ErrorName() string {
|
||||
return "Int32RangeMatcher_RangeMatcherValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e Int32RangeMatcher_RangeMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sInt32RangeMatcher_RangeMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = Int32RangeMatcher_RangeMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = Int32RangeMatcher_RangeMatcherValidationError{}
|
||||
|
||||
// Validate checks the field values on DoubleRangeMatcher_RangeMatcher with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *DoubleRangeMatcher_RangeMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on DoubleRangeMatcher_RangeMatcher with
|
||||
// the rules defined in the proto definition for this message. If any rules
|
||||
// are violated, the result is a list of violation errors wrapped in
|
||||
// DoubleRangeMatcher_RangeMatcherMultiError, or nil if none found.
|
||||
func (m *DoubleRangeMatcher_RangeMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *DoubleRangeMatcher_RangeMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if len(m.GetRanges()) < 1 {
|
||||
err := DoubleRangeMatcher_RangeMatcherValidationError{
|
||||
field: "Ranges",
|
||||
reason: "value must contain at least 1 item(s)",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
for idx, item := range m.GetRanges() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, DoubleRangeMatcher_RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, DoubleRangeMatcher_RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return DoubleRangeMatcher_RangeMatcherValidationError{
|
||||
field: fmt.Sprintf("Ranges[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetOnMatch()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, DoubleRangeMatcher_RangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, DoubleRangeMatcher_RangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return DoubleRangeMatcher_RangeMatcherValidationError{
|
||||
field: "OnMatch",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return DoubleRangeMatcher_RangeMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// DoubleRangeMatcher_RangeMatcherMultiError is an error wrapping multiple
|
||||
// validation errors returned by DoubleRangeMatcher_RangeMatcher.ValidateAll()
|
||||
// if the designated constraints aren't met.
|
||||
type DoubleRangeMatcher_RangeMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m DoubleRangeMatcher_RangeMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m DoubleRangeMatcher_RangeMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// DoubleRangeMatcher_RangeMatcherValidationError is the validation error
|
||||
// returned by DoubleRangeMatcher_RangeMatcher.Validate if the designated
|
||||
// constraints aren't met.
|
||||
type DoubleRangeMatcher_RangeMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e DoubleRangeMatcher_RangeMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e DoubleRangeMatcher_RangeMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e DoubleRangeMatcher_RangeMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e DoubleRangeMatcher_RangeMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e DoubleRangeMatcher_RangeMatcherValidationError) ErrorName() string {
|
||||
return "DoubleRangeMatcher_RangeMatcherValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e DoubleRangeMatcher_RangeMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sDoubleRangeMatcher_RangeMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = DoubleRangeMatcher_RangeMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = DoubleRangeMatcher_RangeMatcherValidationError{}
|
||||
242
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/regex.pb.go
generated
vendored
Normal file
242
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/regex.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,242 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/type/matcher/v3/regex.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type RegexMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to EngineType:
|
||||
//
|
||||
// *RegexMatcher_GoogleRe2
|
||||
EngineType isRegexMatcher_EngineType `protobuf_oneof:"engine_type"`
|
||||
Regex string `protobuf:"bytes,2,opt,name=regex,proto3" json:"regex,omitempty"`
|
||||
}
|
||||
|
||||
func (x *RegexMatcher) Reset() {
|
||||
*x = RegexMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_regex_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RegexMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RegexMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *RegexMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_regex_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RegexMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*RegexMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_regex_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (m *RegexMatcher) GetEngineType() isRegexMatcher_EngineType {
|
||||
if m != nil {
|
||||
return m.EngineType
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *RegexMatcher) GetGoogleRe2() *RegexMatcher_GoogleRE2 {
|
||||
if x, ok := x.GetEngineType().(*RegexMatcher_GoogleRe2); ok {
|
||||
return x.GoogleRe2
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *RegexMatcher) GetRegex() string {
|
||||
if x != nil {
|
||||
return x.Regex
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type isRegexMatcher_EngineType interface {
|
||||
isRegexMatcher_EngineType()
|
||||
}
|
||||
|
||||
type RegexMatcher_GoogleRe2 struct {
|
||||
GoogleRe2 *RegexMatcher_GoogleRE2 `protobuf:"bytes,1,opt,name=google_re2,json=googleRe2,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*RegexMatcher_GoogleRe2) isRegexMatcher_EngineType() {}
|
||||
|
||||
type RegexMatcher_GoogleRE2 struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *RegexMatcher_GoogleRE2) Reset() {
|
||||
*x = RegexMatcher_GoogleRE2{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_regex_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RegexMatcher_GoogleRE2) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RegexMatcher_GoogleRE2) ProtoMessage() {}
|
||||
|
||||
func (x *RegexMatcher_GoogleRE2) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_regex_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RegexMatcher_GoogleRE2.ProtoReflect.Descriptor instead.
|
||||
func (*RegexMatcher_GoogleRE2) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_regex_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
var File_xds_type_matcher_v3_regex_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_type_matcher_v3_regex_proto_rawDesc = []byte{
|
||||
0x0a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x13, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63,
|
||||
0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
|
||||
0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0xa6, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x65, 0x78, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
|
||||
0x12, 0x56, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x32, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e,
|
||||
0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x67, 0x65, 0x78,
|
||||
0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x52, 0x45,
|
||||
0x32, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x09, 0x67,
|
||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x32, 0x12, 0x1d, 0x0a, 0x05, 0x72, 0x65, 0x67, 0x65,
|
||||
0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01,
|
||||
0x52, 0x05, 0x72, 0x65, 0x67, 0x65, 0x78, 0x1a, 0x0b, 0x0a, 0x09, 0x47, 0x6f, 0x6f, 0x67, 0x6c,
|
||||
0x65, 0x52, 0x45, 0x32, 0x42, 0x12, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74,
|
||||
0x79, 0x70, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x42, 0x5a, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e,
|
||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e,
|
||||
0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0a, 0x52, 0x65, 0x67, 0x65,
|
||||
0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f,
|
||||
0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
|
||||
0x72, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_type_matcher_v3_regex_proto_rawDescOnce sync.Once
|
||||
file_xds_type_matcher_v3_regex_proto_rawDescData = file_xds_type_matcher_v3_regex_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_type_matcher_v3_regex_proto_rawDescGZIP() []byte {
|
||||
file_xds_type_matcher_v3_regex_proto_rawDescOnce.Do(func() {
|
||||
file_xds_type_matcher_v3_regex_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_type_matcher_v3_regex_proto_rawDescData)
|
||||
})
|
||||
return file_xds_type_matcher_v3_regex_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_type_matcher_v3_regex_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_xds_type_matcher_v3_regex_proto_goTypes = []interface{}{
|
||||
(*RegexMatcher)(nil), // 0: xds.type.matcher.v3.RegexMatcher
|
||||
(*RegexMatcher_GoogleRE2)(nil), // 1: xds.type.matcher.v3.RegexMatcher.GoogleRE2
|
||||
}
|
||||
var file_xds_type_matcher_v3_regex_proto_depIdxs = []int32{
|
||||
1, // 0: xds.type.matcher.v3.RegexMatcher.google_re2:type_name -> xds.type.matcher.v3.RegexMatcher.GoogleRE2
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_type_matcher_v3_regex_proto_init() }
|
||||
func file_xds_type_matcher_v3_regex_proto_init() {
|
||||
if File_xds_type_matcher_v3_regex_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_type_matcher_v3_regex_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RegexMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_type_matcher_v3_regex_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RegexMatcher_GoogleRE2); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_xds_type_matcher_v3_regex_proto_msgTypes[0].OneofWrappers = []interface{}{
|
||||
(*RegexMatcher_GoogleRe2)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_type_matcher_v3_regex_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_type_matcher_v3_regex_proto_goTypes,
|
||||
DependencyIndexes: file_xds_type_matcher_v3_regex_proto_depIdxs,
|
||||
MessageInfos: file_xds_type_matcher_v3_regex_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_type_matcher_v3_regex_proto = out.File
|
||||
file_xds_type_matcher_v3_regex_proto_rawDesc = nil
|
||||
file_xds_type_matcher_v3_regex_proto_goTypes = nil
|
||||
file_xds_type_matcher_v3_regex_proto_depIdxs = nil
|
||||
}
|
||||
317
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/regex.pb.validate.go
generated
vendored
Normal file
317
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/regex.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,317 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/type/matcher/v3/regex.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on RegexMatcher with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *RegexMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on RegexMatcher with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in RegexMatcherMultiError, or
|
||||
// nil if none found.
|
||||
func (m *RegexMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *RegexMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if utf8.RuneCountInString(m.GetRegex()) < 1 {
|
||||
err := RegexMatcherValidationError{
|
||||
field: "Regex",
|
||||
reason: "value length must be at least 1 runes",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
oneofEngineTypePresent := false
|
||||
switch v := m.EngineType.(type) {
|
||||
case *RegexMatcher_GoogleRe2:
|
||||
if v == nil {
|
||||
err := RegexMatcherValidationError{
|
||||
field: "EngineType",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
oneofEngineTypePresent = true
|
||||
|
||||
if m.GetGoogleRe2() == nil {
|
||||
err := RegexMatcherValidationError{
|
||||
field: "GoogleRe2",
|
||||
reason: "value is required",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetGoogleRe2()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, RegexMatcherValidationError{
|
||||
field: "GoogleRe2",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, RegexMatcherValidationError{
|
||||
field: "GoogleRe2",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetGoogleRe2()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return RegexMatcherValidationError{
|
||||
field: "GoogleRe2",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
_ = v // ensures v is used
|
||||
}
|
||||
if !oneofEngineTypePresent {
|
||||
err := RegexMatcherValidationError{
|
||||
field: "EngineType",
|
||||
reason: "value is required",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return RegexMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegexMatcherMultiError is an error wrapping multiple validation errors
|
||||
// returned by RegexMatcher.ValidateAll() if the designated constraints aren't met.
|
||||
type RegexMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m RegexMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m RegexMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// RegexMatcherValidationError is the validation error returned by
|
||||
// RegexMatcher.Validate if the designated constraints aren't met.
|
||||
type RegexMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e RegexMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e RegexMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e RegexMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e RegexMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e RegexMatcherValidationError) ErrorName() string { return "RegexMatcherValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e RegexMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sRegexMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = RegexMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = RegexMatcherValidationError{}
|
||||
|
||||
// Validate checks the field values on RegexMatcher_GoogleRE2 with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *RegexMatcher_GoogleRE2) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on RegexMatcher_GoogleRE2 with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// RegexMatcher_GoogleRE2MultiError, or nil if none found.
|
||||
func (m *RegexMatcher_GoogleRE2) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *RegexMatcher_GoogleRE2) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if len(errors) > 0 {
|
||||
return RegexMatcher_GoogleRE2MultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegexMatcher_GoogleRE2MultiError is an error wrapping multiple validation
|
||||
// errors returned by RegexMatcher_GoogleRE2.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type RegexMatcher_GoogleRE2MultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m RegexMatcher_GoogleRE2MultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m RegexMatcher_GoogleRE2MultiError) AllErrors() []error { return m }
|
||||
|
||||
// RegexMatcher_GoogleRE2ValidationError is the validation error returned by
|
||||
// RegexMatcher_GoogleRE2.Validate if the designated constraints aren't met.
|
||||
type RegexMatcher_GoogleRE2ValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e RegexMatcher_GoogleRE2ValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e RegexMatcher_GoogleRE2ValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e RegexMatcher_GoogleRE2ValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e RegexMatcher_GoogleRE2ValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e RegexMatcher_GoogleRE2ValidationError) ErrorName() string {
|
||||
return "RegexMatcher_GoogleRE2ValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e RegexMatcher_GoogleRE2ValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sRegexMatcher_GoogleRE2.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = RegexMatcher_GoogleRE2ValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = RegexMatcher_GoogleRE2ValidationError{}
|
||||
353
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/string.pb.go
generated
vendored
Normal file
353
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/string.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,353 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.0--rc2
|
||||
// source: xds/type/matcher/v3/string.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
v3 "github.com/cncf/xds/go/xds/core/v3"
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type StringMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to MatchPattern:
|
||||
//
|
||||
// *StringMatcher_Exact
|
||||
// *StringMatcher_Prefix
|
||||
// *StringMatcher_Suffix
|
||||
// *StringMatcher_SafeRegex
|
||||
// *StringMatcher_Contains
|
||||
// *StringMatcher_Custom
|
||||
MatchPattern isStringMatcher_MatchPattern `protobuf_oneof:"match_pattern"`
|
||||
IgnoreCase bool `protobuf:"varint,6,opt,name=ignore_case,json=ignoreCase,proto3" json:"ignore_case,omitempty"`
|
||||
}
|
||||
|
||||
func (x *StringMatcher) Reset() {
|
||||
*x = StringMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_string_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *StringMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StringMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *StringMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_string_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StringMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*StringMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_string_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (m *StringMatcher) GetMatchPattern() isStringMatcher_MatchPattern {
|
||||
if m != nil {
|
||||
return m.MatchPattern
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *StringMatcher) GetExact() string {
|
||||
if x, ok := x.GetMatchPattern().(*StringMatcher_Exact); ok {
|
||||
return x.Exact
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StringMatcher) GetPrefix() string {
|
||||
if x, ok := x.GetMatchPattern().(*StringMatcher_Prefix); ok {
|
||||
return x.Prefix
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StringMatcher) GetSuffix() string {
|
||||
if x, ok := x.GetMatchPattern().(*StringMatcher_Suffix); ok {
|
||||
return x.Suffix
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StringMatcher) GetSafeRegex() *RegexMatcher {
|
||||
if x, ok := x.GetMatchPattern().(*StringMatcher_SafeRegex); ok {
|
||||
return x.SafeRegex
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *StringMatcher) GetContains() string {
|
||||
if x, ok := x.GetMatchPattern().(*StringMatcher_Contains); ok {
|
||||
return x.Contains
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StringMatcher) GetCustom() *v3.TypedExtensionConfig {
|
||||
if x, ok := x.GetMatchPattern().(*StringMatcher_Custom); ok {
|
||||
return x.Custom
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *StringMatcher) GetIgnoreCase() bool {
|
||||
if x != nil {
|
||||
return x.IgnoreCase
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type isStringMatcher_MatchPattern interface {
|
||||
isStringMatcher_MatchPattern()
|
||||
}
|
||||
|
||||
type StringMatcher_Exact struct {
|
||||
Exact string `protobuf:"bytes,1,opt,name=exact,proto3,oneof"`
|
||||
}
|
||||
|
||||
type StringMatcher_Prefix struct {
|
||||
Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof"`
|
||||
}
|
||||
|
||||
type StringMatcher_Suffix struct {
|
||||
Suffix string `protobuf:"bytes,3,opt,name=suffix,proto3,oneof"`
|
||||
}
|
||||
|
||||
type StringMatcher_SafeRegex struct {
|
||||
SafeRegex *RegexMatcher `protobuf:"bytes,5,opt,name=safe_regex,json=safeRegex,proto3,oneof"`
|
||||
}
|
||||
|
||||
type StringMatcher_Contains struct {
|
||||
Contains string `protobuf:"bytes,7,opt,name=contains,proto3,oneof"`
|
||||
}
|
||||
|
||||
type StringMatcher_Custom struct {
|
||||
Custom *v3.TypedExtensionConfig `protobuf:"bytes,8,opt,name=custom,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*StringMatcher_Exact) isStringMatcher_MatchPattern() {}
|
||||
|
||||
func (*StringMatcher_Prefix) isStringMatcher_MatchPattern() {}
|
||||
|
||||
func (*StringMatcher_Suffix) isStringMatcher_MatchPattern() {}
|
||||
|
||||
func (*StringMatcher_SafeRegex) isStringMatcher_MatchPattern() {}
|
||||
|
||||
func (*StringMatcher_Contains) isStringMatcher_MatchPattern() {}
|
||||
|
||||
func (*StringMatcher_Custom) isStringMatcher_MatchPattern() {}
|
||||
|
||||
type ListStringMatcher struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Patterns []*StringMatcher `protobuf:"bytes,1,rep,name=patterns,proto3" json:"patterns,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ListStringMatcher) Reset() {
|
||||
*x = ListStringMatcher{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_xds_type_matcher_v3_string_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListStringMatcher) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListStringMatcher) ProtoMessage() {}
|
||||
|
||||
func (x *ListStringMatcher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_xds_type_matcher_v3_string_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListStringMatcher.ProtoReflect.Descriptor instead.
|
||||
func (*ListStringMatcher) Descriptor() ([]byte, []int) {
|
||||
return file_xds_type_matcher_v3_string_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ListStringMatcher) GetPatterns() []*StringMatcher {
|
||||
if x != nil {
|
||||
return x.Patterns
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_xds_type_matcher_v3_string_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_xds_type_matcher_v3_string_proto_rawDesc = []byte{
|
||||
0x0a, 0x20, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x13, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74,
|
||||
0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x1b, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72,
|
||||
0x65, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d,
|
||||
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f,
|
||||
0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6,
|
||||
0x02, 0x0a, 0x0d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
|
||||
0x12, 0x16, 0x0a, 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48,
|
||||
0x00, 0x52, 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x12, 0x21, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66,
|
||||
0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10,
|
||||
0x01, 0x48, 0x00, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x21, 0x0a, 0x06, 0x73,
|
||||
0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04,
|
||||
0x72, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x4c,
|
||||
0x0a, 0x0a, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61,
|
||||
0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x67, 0x65, 0x78, 0x4d, 0x61,
|
||||
0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x48,
|
||||
0x00, 0x52, 0x09, 0x73, 0x61, 0x66, 0x65, 0x52, 0x65, 0x67, 0x65, 0x78, 0x12, 0x25, 0x0a, 0x08,
|
||||
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
|
||||
0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61,
|
||||
0x69, 0x6e, 0x73, 0x12, 0x3b, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x08, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76,
|
||||
0x33, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d,
|
||||
0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x63, 0x61, 0x73, 0x65, 0x18,
|
||||
0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x43, 0x61, 0x73,
|
||||
0x65, 0x42, 0x14, 0x0a, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65,
|
||||
0x72, 0x6e, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x5d, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x53,
|
||||
0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x08,
|
||||
0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22,
|
||||
0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
|
||||
0x72, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x08, 0x70, 0x61,
|
||||
0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x42, 0x5b, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61,
|
||||
0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
|
||||
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f,
|
||||
0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
|
||||
0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_xds_type_matcher_v3_string_proto_rawDescOnce sync.Once
|
||||
file_xds_type_matcher_v3_string_proto_rawDescData = file_xds_type_matcher_v3_string_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_xds_type_matcher_v3_string_proto_rawDescGZIP() []byte {
|
||||
file_xds_type_matcher_v3_string_proto_rawDescOnce.Do(func() {
|
||||
file_xds_type_matcher_v3_string_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_type_matcher_v3_string_proto_rawDescData)
|
||||
})
|
||||
return file_xds_type_matcher_v3_string_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_xds_type_matcher_v3_string_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_xds_type_matcher_v3_string_proto_goTypes = []interface{}{
|
||||
(*StringMatcher)(nil), // 0: xds.type.matcher.v3.StringMatcher
|
||||
(*ListStringMatcher)(nil), // 1: xds.type.matcher.v3.ListStringMatcher
|
||||
(*RegexMatcher)(nil), // 2: xds.type.matcher.v3.RegexMatcher
|
||||
(*v3.TypedExtensionConfig)(nil), // 3: xds.core.v3.TypedExtensionConfig
|
||||
}
|
||||
var file_xds_type_matcher_v3_string_proto_depIdxs = []int32{
|
||||
2, // 0: xds.type.matcher.v3.StringMatcher.safe_regex:type_name -> xds.type.matcher.v3.RegexMatcher
|
||||
3, // 1: xds.type.matcher.v3.StringMatcher.custom:type_name -> xds.core.v3.TypedExtensionConfig
|
||||
0, // 2: xds.type.matcher.v3.ListStringMatcher.patterns:type_name -> xds.type.matcher.v3.StringMatcher
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_xds_type_matcher_v3_string_proto_init() }
|
||||
func file_xds_type_matcher_v3_string_proto_init() {
|
||||
if File_xds_type_matcher_v3_string_proto != nil {
|
||||
return
|
||||
}
|
||||
file_xds_type_matcher_v3_regex_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_xds_type_matcher_v3_string_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StringMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_xds_type_matcher_v3_string_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListStringMatcher); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_xds_type_matcher_v3_string_proto_msgTypes[0].OneofWrappers = []interface{}{
|
||||
(*StringMatcher_Exact)(nil),
|
||||
(*StringMatcher_Prefix)(nil),
|
||||
(*StringMatcher_Suffix)(nil),
|
||||
(*StringMatcher_SafeRegex)(nil),
|
||||
(*StringMatcher_Contains)(nil),
|
||||
(*StringMatcher_Custom)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_xds_type_matcher_v3_string_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_xds_type_matcher_v3_string_proto_goTypes,
|
||||
DependencyIndexes: file_xds_type_matcher_v3_string_proto_depIdxs,
|
||||
MessageInfos: file_xds_type_matcher_v3_string_proto_msgTypes,
|
||||
}.Build()
|
||||
File_xds_type_matcher_v3_string_proto = out.File
|
||||
file_xds_type_matcher_v3_string_proto_rawDesc = nil
|
||||
file_xds_type_matcher_v3_string_proto_goTypes = nil
|
||||
file_xds_type_matcher_v3_string_proto_depIdxs = nil
|
||||
}
|
||||
481
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/string.pb.validate.go
generated
vendored
Normal file
481
vendor/github.com/cncf/xds/go/xds/type/matcher/v3/string.pb.validate.go
generated
vendored
Normal file
|
|
@ -0,0 +1,481 @@
|
|||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: xds/type/matcher/v3/string.proto
|
||||
|
||||
package v3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on StringMatcher with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *StringMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on StringMatcher with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in StringMatcherMultiError, or
|
||||
// nil if none found.
|
||||
func (m *StringMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *StringMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for IgnoreCase
|
||||
|
||||
oneofMatchPatternPresent := false
|
||||
switch v := m.MatchPattern.(type) {
|
||||
case *StringMatcher_Exact:
|
||||
if v == nil {
|
||||
err := StringMatcherValidationError{
|
||||
field: "MatchPattern",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
oneofMatchPatternPresent = true
|
||||
// no validation rules for Exact
|
||||
case *StringMatcher_Prefix:
|
||||
if v == nil {
|
||||
err := StringMatcherValidationError{
|
||||
field: "MatchPattern",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
oneofMatchPatternPresent = true
|
||||
|
||||
if utf8.RuneCountInString(m.GetPrefix()) < 1 {
|
||||
err := StringMatcherValidationError{
|
||||
field: "Prefix",
|
||||
reason: "value length must be at least 1 runes",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
case *StringMatcher_Suffix:
|
||||
if v == nil {
|
||||
err := StringMatcherValidationError{
|
||||
field: "MatchPattern",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
oneofMatchPatternPresent = true
|
||||
|
||||
if utf8.RuneCountInString(m.GetSuffix()) < 1 {
|
||||
err := StringMatcherValidationError{
|
||||
field: "Suffix",
|
||||
reason: "value length must be at least 1 runes",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
case *StringMatcher_SafeRegex:
|
||||
if v == nil {
|
||||
err := StringMatcherValidationError{
|
||||
field: "MatchPattern",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
oneofMatchPatternPresent = true
|
||||
|
||||
if m.GetSafeRegex() == nil {
|
||||
err := StringMatcherValidationError{
|
||||
field: "SafeRegex",
|
||||
reason: "value is required",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetSafeRegex()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, StringMatcherValidationError{
|
||||
field: "SafeRegex",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, StringMatcherValidationError{
|
||||
field: "SafeRegex",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetSafeRegex()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return StringMatcherValidationError{
|
||||
field: "SafeRegex",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case *StringMatcher_Contains:
|
||||
if v == nil {
|
||||
err := StringMatcherValidationError{
|
||||
field: "MatchPattern",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
oneofMatchPatternPresent = true
|
||||
|
||||
if utf8.RuneCountInString(m.GetContains()) < 1 {
|
||||
err := StringMatcherValidationError{
|
||||
field: "Contains",
|
||||
reason: "value length must be at least 1 runes",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
case *StringMatcher_Custom:
|
||||
if v == nil {
|
||||
err := StringMatcherValidationError{
|
||||
field: "MatchPattern",
|
||||
reason: "oneof value cannot be a typed-nil",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
oneofMatchPatternPresent = true
|
||||
|
||||
if all {
|
||||
switch v := interface{}(m.GetCustom()).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, StringMatcherValidationError{
|
||||
field: "Custom",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, StringMatcherValidationError{
|
||||
field: "Custom",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(m.GetCustom()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return StringMatcherValidationError{
|
||||
field: "Custom",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
_ = v // ensures v is used
|
||||
}
|
||||
if !oneofMatchPatternPresent {
|
||||
err := StringMatcherValidationError{
|
||||
field: "MatchPattern",
|
||||
reason: "value is required",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return StringMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// StringMatcherMultiError is an error wrapping multiple validation errors
|
||||
// returned by StringMatcher.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type StringMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m StringMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m StringMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// StringMatcherValidationError is the validation error returned by
|
||||
// StringMatcher.Validate if the designated constraints aren't met.
|
||||
type StringMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e StringMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e StringMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e StringMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e StringMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e StringMatcherValidationError) ErrorName() string { return "StringMatcherValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e StringMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sStringMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = StringMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = StringMatcherValidationError{}
|
||||
|
||||
// Validate checks the field values on ListStringMatcher with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
func (m *ListStringMatcher) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on ListStringMatcher with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// ListStringMatcherMultiError, or nil if none found.
|
||||
func (m *ListStringMatcher) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *ListStringMatcher) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if len(m.GetPatterns()) < 1 {
|
||||
err := ListStringMatcherValidationError{
|
||||
field: "Patterns",
|
||||
reason: "value must contain at least 1 item(s)",
|
||||
}
|
||||
if !all {
|
||||
return err
|
||||
}
|
||||
errors = append(errors, err)
|
||||
}
|
||||
|
||||
for idx, item := range m.GetPatterns() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, ListStringMatcherValidationError{
|
||||
field: fmt.Sprintf("Patterns[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, ListStringMatcherValidationError{
|
||||
field: fmt.Sprintf("Patterns[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ListStringMatcherValidationError{
|
||||
field: fmt.Sprintf("Patterns[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ListStringMatcherMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ListStringMatcherMultiError is an error wrapping multiple validation errors
|
||||
// returned by ListStringMatcher.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type ListStringMatcherMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ListStringMatcherMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ListStringMatcherMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ListStringMatcherValidationError is the validation error returned by
|
||||
// ListStringMatcher.Validate if the designated constraints aren't met.
|
||||
type ListStringMatcherValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ListStringMatcherValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ListStringMatcherValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ListStringMatcherValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ListStringMatcherValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ListStringMatcherValidationError) ErrorName() string {
|
||||
return "ListStringMatcherValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ListStringMatcherValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sListStringMatcher.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ListStringMatcherValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ListStringMatcherValidationError{}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue