Debian Codegraph @

pkg/util/proto/testing/openapi.go

raw symbols SCIP
1 /*
2 Copyright 2017 The Kubernetes Authors.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17 package testingscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/
18
19 import (
20 "osscip-go gomod github.com/golang/go/src go1.21 os/"
21 "syncscip-go gomod github.com/golang/go/src go1.21 sync/"
22
23 openapi_v2scip-go gomod github.com/google/gnostic-models v0.6.9 `github.com/google/gnostic-models/openapiv2`/ "github.com/google/gnostic-models/openapiv2scip-go gomod github.com/google/gnostic-models v0.6.9 `github.com/google/gnostic-models/openapiv2`/"
24 )
25
26 // Fake opens and returns a openapi swagger from a file Path. It will
27 // parse only once and then return the same copy everytime.
28 type Fakescip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake# struct {
29 Pathscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#Path. string
30
31 oncescip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#once. syncscip-go gomod github.com/golang/go/src go1.21 sync/.Oncescip-go gomod github.com/golang/go/src go1.21 sync/Once#
32 documentscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#document. *openapi_v2scip-go gomod github.com/google/gnostic-models v0.6.9 `github.com/google/gnostic-models/openapiv2`/.Documentscip-go gomod github.com/google/gnostic-models v0.6.9 `github.com/google/gnostic-models/openapiv2`/Document#
33 errscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#err. error
34 }
35
36 // OpenAPISchema returns the openapi document and a potential error.
37 func (f *Fakescip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#) OpenAPISchemascip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#OpenAPISchema().() (*openapi_v2scip-go gomod github.com/google/gnostic-models v0.6.9 `github.com/google/gnostic-models/openapiv2`/.Documentscip-go gomod github.com/google/gnostic-models v0.6.9 `github.com/google/gnostic-models/openapiv2`/Document#, error) {
38 f.oncescip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#once..Doscip-go gomod github.com/golang/go/src go1.21 sync/Once#Do().(func() {
39 _, err := osscip-go gomod github.com/golang/go/src go1.21 os/.Statscip-go gomod github.com/golang/go/src go1.21 os/Stat().(f.Pathscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#Path.)
40 if err != nil {
41 f.errscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#err. = err
42 return
43 }
44 spec, err := osscip-go gomod github.com/golang/go/src go1.21 os/.ReadFilescip-go gomod github.com/golang/go/src go1.21 os/ReadFile().(f.Pathscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#Path.)
45 if err != nil {
46 f.errscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#err. = err
47 return
48 }
49 f.documentscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#document., f.errscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#err. = openapi_v2scip-go gomod github.com/google/gnostic-models v0.6.9 `github.com/google/gnostic-models/openapiv2`/.ParseDocumentscip-go gomod github.com/google/gnostic-models v0.6.9 `github.com/google/gnostic-models/openapiv2`/ParseDocument().(spec)
50 })
51 return f.documentscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#document., f.errscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Fake#err.
52 }
53
54 type Emptyscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Empty# struct{}
55
56 func (Emptyscip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Empty#) OpenAPISchemascip-go gomod k8s.io/kube-openapi . `k8s.io/kube-openapi/pkg/util/proto/testing`/Empty#OpenAPISchema().() (*openapi_v2scip-go gomod github.com/google/gnostic-models v0.6.9 `github.com/google/gnostic-models/openapiv2`/.Documentscip-go gomod github.com/google/gnostic-models v0.6.9 `github.com/google/gnostic-models/openapiv2`/Document#, error) {
57 return nil, nil
58 }