mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
Updated vednor files
This commit is contained in:
vendor
github.com
PuerkitoBio
purell
.gitignore.travis.ymlLICENSEREADME.mdbench_test.go
benchmarks
example_test.gopurell.gopurell_test.gourlnorm_test.gourlesc
container-storage-interface
emicklei
go-restful
.gitignore.travis.ymlCHANGES.mdLICENSEMakefileREADME.mdSrcfilebench_curly_test.gobench_test.gobench_test.shcompress.gocompress_test.gocompressor_cache.gocompressor_pools.gocompressors.goconstants.gocontainer.gocontainer_test.gocors_filter.gocors_filter_test.gocoverage.shcurly.gocurly_route.gocurly_test.godoc.godoc_examples_test.goentity_accessors.goentity_accessors_test.go
examples
.goconvey
filter.gofilter_test.gojsr311.gojsr311_test.gogoogle_app_engine
home.htmlmsgpack
restful-CORS-filter.gorestful-NCSA-logging.gorestful-basic-authentication.gorestful-cpuprofiler-service.gorestful-curly-router.gorestful-curly-router_test.gorestful-encoding-filter.gorestful-filters.gorestful-form-handling.gorestful-hello-world.gorestful-html-template.gorestful-multi-containers.gorestful-no-cache-filter.gorestful-options-filter.gorestful-path-tail.gorestful-pre-post-filters.gorestful-resource-functions.gorestful-route_test.gorestful-routefunction_test.gorestful-serve-static.gorestful-swagger.gorestful-user-resource.golog
logger.gomime.gomime_test.gooptions_filter.gooptions_filter_test.goparameter.gopath_expression.gopath_expression_test.gorequest.gorequest_test.goresponse.goresponse_test.goroute.goroute_builder.goroute_builder_test.goroute_test.gorouter.goservice_error.gotracer_test.goweb_service.goweb_service_container.goweb_service_test.goghodss
go-openapi
jsonpointer
.editorconfig
.github
.gitignore.travis.ymlCODE_OF_CONDUCT.mdLICENSEREADME.mdpointer.gopointer_test.gojsonreference
spec
.editorconfigheader.goheader_test.goinfo.goinfo_test.goitems.goitems_test.golicense.golicense_test.gooperation.gooperation_test.goparameter.goparameters_test.gopath_item.gopath_item_test.gopaths.gopaths_test.goproperties_test.goref.goresponse.goresponse_test.goresponses.goschema.goschema_test.go
.github
.gitignore.travis.ymlCODE_OF_CONDUCT.mdLICENSEREADME.mdauth_test.gobindata.gocontact_info.gocontact_info_test.goexpander.goexpander_test.goexternal_docs.goexternal_docs_test.gofixtures
expansion
all-the-things.jsoncircularRefs.jsoncircularSpec.jsoncircularSpec.yamlclickmeter.jsonclickmeter.yamlinvalid-refs.jsonmissingItemRef.jsonmissingRef.jsonoverflow.jsonparams.jsonschemas1.jsonschemas2.json
local_expansion
specs
schemas
security_scheme.gospec.gostructs_test.goswagger.goswagger_test.gotag.goxml_object.goxml_object_test.goswag
gogo
protobuf
.gitignore.mailmap.travis.ymlAUTHORSCONTRIBUTORSGOLANG_CONTRIBUTORSLICENSEMakefileREADMEReadme.md
_conformance
bench.mdcodec
custom_types.mdextensions.mdgogoproto
gogoreplace
install-protobuf.shio
jsonpb
plugin
compare
defaultcheck
description
embedcheck
enumstringer
equal
face
gostring
marshalto
oneofcheck
populate
size
stringer
testgen
union
unmarshal
proto
Makefileall_test.goany_test.goclone.goclone_test.godecode.godecode_gogo.godecode_test.goduration.goduration_gogo.goencode.goencode_gogo.goencode_test.goequal.goequal_test.goextensions.goextensions_gogo.goextensions_test.golib.golib_gogo.gomap_test.gomessage_set.gomessage_set_test.gopointer_reflect.gopointer_reflect_gogo.gopointer_unsafe.gopointer_unsafe_gogo.goproperties.goproperties_gogo.go
proto3_proto
proto3_test.gosize2_test.gosize_test.goskip_gogo.gotestdata
text.gotext_gogo.gotext_parser.gotext_parser_test.gotext_test.gotimestamp.gotimestamp_gogo.goprotobuf
Makefile
google
protoc-gen-combo
protoc-gen-gofast
protoc-gen-gogo
protoc-gen-gogofast
protoc-gen-gogofaster
protoc-gen-gogoslick
protoc-gen-gogotypes
protoc-gen-gostring
protoc-min-version
sortkeys
test
.gitignoreMakefile
asymetric-issue125
bug_test.gocasttype
castvalue
combos
both
marshaler
unmarshaler
custom-dash-type
custom
custombytesnonstruct
dashfilename
data
defaultconflict
embedconflict
empty-issue70
enumcustomname
enumdecl
enumdecl_all
enumprefix
enumstringer
example
extension_test.gofiledotname
fuzztests
group
importdedup
indeximport-issue72
int64support
issue260
issue261
issue262
issue312
issue322
issue330
issue34
issue42order
issue8
jsonpb-gogo
mapdefaults
mapsproto2
Makefiledoc.goheader.protomapsproto2.protomapsproto2_test.go.in
combos
both
marshaler
neither
unmarshaler
mixbench
.gitignoremarshal.txtmarshaler.txtmixbench.gooldmarshaler.txtoldunmarshaler.txtunmarshal.txtunmarshaler.txtunsafe_marshaler.txtunsafe_unmarshaler.txt
moredefaults
nopackage
oneof
oneof3
oneofembed
packed
proto3extension
protosize
registration
required
sizerconflict
sizeunderscore
stdtypes
t.gotags
theproto3
Makefiledoc.gofooter.protoheader.protomaps.protoproto3_test.go.intheproto3.proto
thetest.pb.gothetest.protothetestpb_test.gocombos
both
marshaler
neither
unmarshaler
typedecl
typedecl_all
typedeclimport
types
unmarshalmerge
unrecognized
unrecognizedgroup
uuid.gouuid_test.gotypes
Makefileany.goany.pb.goany_test.godoc.goduration.goduration.pb.goduration_gogo.goduration_test.goempty.pb.gofield_mask.pb.gostruct.pb.gotimestamp.gotimestamp.pb.gotimestamp_gogo.gotimestamp_test.gowrappers.pb.go
vanity
version
google
btree
gofuzz
googleapis
gnostic
.gitignore.travis-install.sh.travis.ymlCOMPILE-PROTOS.shCONTRIBUTING.mdLICENSEMakefile
OpenAPIv2
OpenAPIv3
README.mdapps
disco
petstore-builder
report
compiler
discovery
examples
README.md
errors
v2.0
json
api-with-examples.jsonpetstore-expanded.jsonpetstore-minimal.json
petstore-separate
petstore-simple.jsonpetstore-with-external-docs.jsonpetstore.jsonuber.jsonyaml
v3.0
extensions
generate-gnostic
README.mddomain.gogenerate-compiler.gogenerate-extension.gogenerate-extension_test.gogenerate-proto.gohelpers.gomain.go
gnostic.gognostic_test.gotest
types.gojsonschema
jsonwriter
plugins
README.mdenvironment.go
gnostic-analyze
gnostic-go-generator
MakefileREADME.mdgoimports.golanguage.golinewriter.gomain.gorender_client.gorender_constants.gorender_provider.gorender_server.gorender_types.gorenderer.go
examples
googleauth
v2.0
apis_guru
bookstore
xkcd
v3.0
bookstore
urlshortener
gnostic-summary
gnostic-swift-generator
MakefilePackage.swiftREADME.mdcompile-protos
Sources
Gnostic
gnostic-swift-generator
examples
bookstore
gnostic-swift-sample
plugin.pb.goplugin.protoprinter
surface
test
README.md
errors
invalid-plugin-invocation.errorspetstore-badproperties.errorspetstore-missingversion.errorspetstore-unresolvedrefs.errors
library-example-with-ext.jsonlibrary-example-with-ext.text.outv2.0
v3.0
tools
gregjones
httpcache
json-iterator
go
.codecov.yml.gitignore.travis.ymlLICENSEREADME.mdcompatible_test.goexample_test.gotest.shunmarshal_input_test.go
extra
fuzzy_decoder.gofuzzy_decoder_test.gonaming_strategy.gonaming_strategy_test.goprivat_fields.goprivate_fields_test.gotime_as_int64_codec.gotime_as_int64_codec_test.go
feature_adapter.gofeature_any.gofeature_any_array.gofeature_any_bool.gofeature_any_float.gofeature_any_int32.gofeature_any_int64.gofeature_any_invalid.gofeature_any_nil.gofeature_any_number.gofeature_any_object.gofeature_any_string.gofeature_any_uint32.gofeature_any_uint64.gofeature_config.gofeature_iter.gofeature_iter_array.gofeature_iter_float.gofeature_iter_int.gofeature_iter_object.gofeature_iter_skip.gofeature_iter_skip_sloppy.gofeature_iter_skip_strict.gofeature_iter_string.gofeature_json_number.gofeature_pool.gofeature_reflect.gofeature_reflect_array.gofeature_reflect_extension.gofeature_reflect_map.gofeature_reflect_native.gofeature_reflect_object.gofeature_reflect_slice.gofeature_reflect_struct_decoder.gofeature_stream.gofeature_stream_float.gofeature_stream_int.gofeature_stream_string.gofuzzy_mode_convert_table.mdjsoniter.gojsoniter_1dot8_only_test.gojsoniter_adapter_test.gojsoniter_alias_test.gojsoniter_any_array_test.gojsoniter_any_bool_test.gojsoniter_any_float_test.gojsoniter_any_int_test.gojsoniter_any_map_test.gojsoniter_any_null_test.gojsoniter_any_object_test.gojsoniter_any_string_test.gojsoniter_array_test.gojsoniter_bool_test.gojsoniter_customize_test.gojsoniter_demo_test.gojsoniter_encode_interface_test.gojsoniter_enum_marshaler_test.gojsoniter_fixed_array_test.gojsoniter_float_test.gojsoniter_int_test.gojsoniter_interface_test.gojsoniter_invalid_test.gojsoniter_io_test.gojsoniter_iterator_test.gojsoniter_large_file_test.gojsoniter_map_test.gojsoniter_must_be_valid_test.gojsoniter_nested_test.gojsoniter_null_test.gojsoniter_object_test.gojsoniter_optional_test.gojsoniter_raw_message_test.gojsoniter_reader_test.gojsoniter_reflect_native_test.gojsoniter_skip_test.gojsoniter_sloppy_test.gojsoniter_stream_test.gojsoniter_string_test.gojsoniter_struct_decoder_test.gojsoniter_struct_encoder_test.gojsoniter_wrap_test.gooutput_tests
array
array
bool
byte
float64
int32
ptr_string
string
uint8
bool
byte
float64
int32
map
ptr_bool
ptr_float64
ptr_int32
ptr_map
ptr_slice
bool
byte
float64
int32
ptr_string
string
uint8
ptr_string
ptr_struct_various
ptr_uint8
slice
bool
byte
float64
int32
ptr_string
string
uint8
string
struct_empty
struct_empty_alias
struct_ptr_string
struct_various
uint8
builtins
bool
bool_alias
byte
byte_alias
float32
float32_alias
float64
float64_alias
int16
int16_alias
int32
int32_alias
int64
int8
int8_alias
string
string_alias
uint16
uint16_alias
uint32
uint32_alias
uint8
uint8_alias
uintptr
caseless_unmarshal
json_marshal
string_alias
struct
struct_alias
struct_field
struct_field_alias
map
int16
string
int32
string
int64
string
int8
string
string
array_string
bool
byte
float64
int32
map_string_string
ptr_array_string
ptr_bool
ptr_float64
ptr_int32
ptr_map_string_string
ptr_slice_string
ptr_string
ptr_struct_various
ptr_uint8
slice_string
string
string_alias
struct_empty
struct_empty_alias
struct_ptr_string
struct_various
uint8
string_alias
uint16
string
uint32
string
uint8
string
map_key_text_marshal
marshal_fail_case.gopartial_unmarshal
slice
array
bool
byte
float64
int32
ptr_string
string
uint8
bool
byte
float64
int32
int64
map
ptr_array
bool
byte
float64
int32
ptr_string
string
uint8
ptr_bool
ptr_float64
ptr_int32
ptr_map
ptr_slice
bool
byte
float64
int32
ptr_string
string
uint8
ptr_string
ptr_struct_various
ptr_uint8
slice
bool
byte
float64
int32
ptr_string
string
uint8
string
struct_empty
struct_empty_alias
struct_ptr_string
struct_various
uint8
struct
alias
anonymous
no_overlap
float64
int32
json_marshal
map_string_string
ptr_float64
ptr_int32
ptr_map_string_string
ptr_slice_string
ptr_string
ptr_struct_various
slice_string
string
string_with_tag
struct_various
text_marshal
overlap
different_levels
ignore_deeper_level
same_level_1_both_tagged
same_level_1_no_tags
same_level_1_tagged
same_level_2_both_tagged
same_level_2_no_tags
same_level_2_tagged
array
ptr_string
string
string_alias
strings
struct_strings
empty
empty_alias
everything
float64
float64_alias
float64s
float64s_alias
int32
int32_alias
int32s
int32s_alias
int64
map
int32_ptr_string
int32_string
int32_struct_strings
string_ptr_string
string_string
string_struct_strings
ptr_float64
ptr_float64_alias
ptr_int32
ptr_int32_alias
ptr_ptr_struct_empty
ptr_ptr_struct_strings
ptr_string
ptr_string_alias
ptr_struct_empty
ptr_struct_strings
ptrs_float64
ptrs_int32
ptrs_string
slice
ptr_string
string
string_alias
strings
struct_strings
string
string_alias
strings
strings_alias
struct
empties
empty
empty_alias
float32s
float64
float64_alias
int32s
strings
strings_alias
struct_tags
fieldname
omitempty
bool
embedded
float32
int32
map_string_string
ptr_bool
ptr_float32
ptr_int32
ptr_map_string_string
ptr_slice_string
ptr_string
ptr_string_json_marshal
ptr_string_text_marshal
ptr_struct_json_marshal
ptr_struct_text_marshal
ptr_uint32
slice_string
string
string_json_marshal
string_text_marshal
struct
struct_json_marshal
struct_text_marshal
uint32
string
bool
byte
float32
float64
int16
int32
int8
string
uint16
uint32
uint8
text_marshal
string_alias
struct
struct_alias
struct_field
struct_field_alias
skip_tests
array
number
object
string
juju
kubernetes-csi
drivers
.travis.ymlGopkg.lockGopkg.tomlMakefileREADME.md
app
flexadapter
hack
pkg
cinder
csi-common
controllerserver-default.godriver_test.gonodeserver-default.gonodeserver-default_test.goutils.goutils_test.go
flexadapter
hostpath
iscsi
nfs
mailru
easyjson
.gitignore.travis.ymlLICENSEMakefileREADME.md
benchmark
codec_test.godata.godata_codec.godata_ffjson.godata_var.godefault_test.godummy_test.goeasyjson_test.goexample.jsonffjson_test.gojsoniter_test.goujson.sh
bootstrap
buffer
easyjson
gen
helpers.gojlexer
jwriter
opt
gotemplate_Bool.gogotemplate_Float32.gogotemplate_Float64.gogotemplate_Int.gogotemplate_Int16.gogotemplate_Int32.gogotemplate_Int64.gogotemplate_Int8.gogotemplate_String.gogotemplate_Uint.gogotemplate_Uint16.gogotemplate_Uint32.gogotemplate_Uint64.gogotemplate_Uint8.go
optional
opts.goparser
raw.gotests
petar
GoLLRB
peterbourgon
diskv
spf13
pflag
.gitignore.travis.ymlLICENSEREADME.mdbool.gobool_slice.gobool_slice_test.gobool_test.gocount.gocount_test.goduration.goexample_test.goexport_test.goflag.goflag_test.gofloat32.gofloat64.gogolangflag.gogolangflag_test.goint.goint32.goint64.goint8.goint_slice.goint_slice_test.goip.goip_slice.goip_slice_test.goip_test.goipmask.goipnet.goipnet_test.gostring.gostring_array.gostring_array_test.gostring_slice.gostring_slice_test.gouint.gouint16.gouint32.gouint64.gouint8.gouint_slice.gouint_slice_test.go
verify
gopkg.in
inf.v0
LICENSEbenchmark_test.godec.godec_go1_2_test.godec_internal_test.godec_test.goexample_test.gorounder.gorounder_example_test.gorounder_test.go
yaml.v2
k8s.io
api
Godeps
LICENSEOWNERSREADME.mdadmission
v1beta1
admissionregistration
v1alpha1
BUILDdoc.gogenerated.pb.gogenerated.protoregister.gotypes.gotypes_swagger_doc_generated.gozz_generated.deepcopy.go
v1beta1
apps
OWNERS
v1
BUILDdoc.gogenerated.pb.gogenerated.protoregister.gotypes.gotypes_swagger_doc_generated.gozz_generated.deepcopy.go
v1beta1
BUILDdoc.gogenerated.pb.gogenerated.protoregister.gotypes.gotypes_swagger_doc_generated.gozz_generated.deepcopy.go
v1beta2
authentication
OWNERS
v1
BUILDdoc.gogenerated.pb.gogenerated.protoregister.gotypes.gotypes_swagger_doc_generated.gozz_generated.deepcopy.go
v1beta1
authorization
OWNERS
v1
BUILDdoc.gogenerated.pb.gogenerated.protoregister.gotypes.gotypes_swagger_doc_generated.gozz_generated.deepcopy.go
v1beta1
autoscaling
OWNERS
v1
BUILDdoc.gogenerated.pb.gogenerated.protoregister.gotypes.gotypes_swagger_doc_generated.gozz_generated.deepcopy.go
v2beta1
batch
OWNERS
v1
BUILDdoc.gogenerated.pb.gogenerated.protoregister.gotypes.gotypes_swagger_doc_generated.gozz_generated.deepcopy.go
v1beta1
BUILDdoc.gogenerated.pb.gogenerated.protoregister.gotypes.gotypes_swagger_doc_generated.gozz_generated.deepcopy.go
v2alpha1
certificates
OWNERS
code-of-conduct.mdv1beta1
core
v1
events
OWNERS
v1beta1
extensions
OWNERS
v1beta1
imagepolicy
OWNERS
v1alpha1
networking
OWNERS
v1
policy
OWNERS
v1beta1
rbac
OWNERS
v1
BUILDdoc.gogenerated.pb.gogenerated.protoregister.gotypes.gotypes_swagger_doc_generated.gozz_generated.deepcopy.go
v1alpha1
BUILDdoc.gogenerated.pb.gogenerated.protoregister.gotypes.gotypes_swagger_doc_generated.gozz_generated.deepcopy.go
v1beta1
scheduling
v1alpha1
settings
v1alpha1
storage
apimachinery
pkg
api
apis
meta
internalversion
v1
v1alpha1
testapigroup
labels
runtime
test
util
watch
client-go
.github
.travis.ymlCHANGELOG.mdGodeps
INSTALL.mdLICENSEOWNERSREADME.mddiscovery
BUILD
cached
discovery_client.godiscovery_client_test.gofake
helper.gohelper_blackbox_test.gorestmapper.gorestmapper_test.gounstructured.godynamic
examples
README.md
create-update-delete-deployment
in-cluster-client-configuration
out-of-cluster-client-configuration
workqueue
informers
BUILD
admissionregistration
apps
autoscaling
batch
certificates
core
events
extensions
factory.gogeneric.gointernalinterfaces
networking
policy
rbac
scheduling
settings
storage
kubernetes
BUILDclientset.godoc.go
fake
import.goscheme
typed
admissionregistration
v1alpha1
v1beta1
apps
v1
BUILDapps_client.gocontrollerrevision.godaemonset.godeployment.godoc.go
fake
BUILDdoc.gofake_apps_client.gofake_controllerrevision.gofake_daemonset.gofake_deployment.gofake_replicaset.gofake_statefulset.go
generated_expansion.goreplicaset.gostatefulset.gov1beta1
BUILDapps_client.gocontrollerrevision.godeployment.godoc.go
fake
BUILDdoc.gofake_apps_client.gofake_controllerrevision.gofake_deployment.gofake_scale.gofake_statefulset.go
generated_expansion.goscale.gostatefulset.gov1beta2
authentication
v1
v1beta1
authorization
v1
BUILDauthorization_client.godoc.go
fake
BUILDdoc.gofake_authorization_client.gofake_localsubjectaccessreview.gofake_localsubjectaccessreview_expansion.gofake_selfsubjectaccessreview.gofake_selfsubjectaccessreview_expansion.gofake_selfsubjectrulesreview.gofake_selfsubjectrulesreview_expansion.gofake_subjectaccessreview.gofake_subjectaccessreview_expansion.go
generated_expansion.golocalsubjectaccessreview.golocalsubjectaccessreview_expansion.goselfsubjectaccessreview.goselfsubjectaccessreview_expansion.goselfsubjectrulesreview.goselfsubjectrulesreview_expansion.gosubjectaccessreview.gosubjectaccessreview_expansion.gov1beta1
BUILDauthorization_client.godoc.go
fake
BUILDdoc.gofake_authorization_client.gofake_generated_expansion.gofake_localsubjectaccessreview.gofake_localsubjectaccessreview_expansion.gofake_selfsubjectaccessreview.gofake_selfsubjectaccessreview_expansion.gofake_selfsubjectrulesreview.gofake_selfsubjectrulesreview_expansion.gofake_subjectaccessreview.gofake_subjectaccessreview_expansion.go
generated_expansion.golocalsubjectaccessreview.golocalsubjectaccessreview_expansion.goselfsubjectaccessreview.goselfsubjectaccessreview_expansion.goselfsubjectrulesreview.goselfsubjectrulesreview_expansion.gosubjectaccessreview.gosubjectaccessreview_expansion.goautoscaling
batch
v1
v1beta1
v2alpha1
certificates
v1beta1
core
v1
BUILDcomponentstatus.goconfigmap.gocore_client.godoc.goendpoints.goevent.goevent_expansion.go
fake
BUILDdoc.gofake_componentstatus.gofake_configmap.gofake_core_client.gofake_endpoints.gofake_event.gofake_event_expansion.gofake_limitrange.gofake_namespace.gofake_namespace_expansion.gofake_node.gofake_node_expansion.gofake_persistentvolume.gofake_persistentvolumeclaim.gofake_pod.gofake_pod_expansion.gofake_podtemplate.gofake_replicationcontroller.gofake_resourcequota.gofake_secret.gofake_service.gofake_service_expansion.gofake_serviceaccount.go
generated_expansion.golimitrange.gonamespace.gonamespace_expansion.gonode.gonode_expansion.gopersistentvolume.gopersistentvolumeclaim.gopod.gopod_expansion.gopodtemplate.goreplicationcontroller.goresourcequota.gosecret.goservice.goservice_expansion.goserviceaccount.goevents
v1beta1
extensions
v1beta1
BUILDdaemonset.godeployment.godeployment_expansion.godoc.goextensions_client.go
fake
BUILDdoc.gofake_daemonset.gofake_deployment.gofake_deployment_expansion.gofake_extensions_client.gofake_ingress.gofake_podsecuritypolicy.gofake_replicaset.gofake_scale.gofake_scale_expansion.go
generated_expansion.goingress.gopodsecuritypolicy.goreplicaset.goscale.goscale_expansion.gonetworking
v1
policy
v1beta1
rbac
v1
BUILDclusterrole.goclusterrolebinding.godoc.go
fake
BUILDdoc.gofake_clusterrole.gofake_clusterrolebinding.gofake_rbac_client.gofake_role.gofake_rolebinding.go
generated_expansion.gorbac_client.gorole.gorolebinding.gov1alpha1
BUILDclusterrole.goclusterrolebinding.godoc.go
fake
BUILDdoc.gofake_clusterrole.gofake_clusterrolebinding.gofake_rbac_client.gofake_role.gofake_rolebinding.go
generated_expansion.gorbac_client.gorole.gorolebinding.gov1beta1
scheduling
v1alpha1
settings
v1alpha1
storage
listers
admissionregistration
v1alpha1
v1beta1
apps
v1
BUILDcontrollerrevision.godaemonset.godaemonset_expansion.godeployment.godeployment_expansion.goexpansion_generated.goreplicaset.goreplicaset_expansion.gostatefulset.gostatefulset_expansion.go
v1beta1
BUILDcontrollerrevision.godeployment.goexpansion_generated.goscale.gostatefulset.gostatefulset_expansion.go
v1beta2
authentication
authorization
v1
BUILDexpansion_generated.golocalsubjectaccessreview.goselfsubjectaccessreview.goselfsubjectrulesreview.gosubjectaccessreview.go
v1beta1
autoscaling
v1
v2beta1
batch
v1
v1beta1
v2alpha1
certificates
core
v1
BUILDcomponentstatus.goconfigmap.goendpoints.goevent.goexpansion_generated.golimitrange.gonamespace.gonode.gonode_expansion.gopersistentvolume.gopersistentvolumeclaim.gopod.gopodtemplate.goreplicationcontroller.goreplicationcontroller_expansion.goresourcequota.gosecret.goservice.goservice_expansion.goserviceaccount.go
events
extensions
v1beta1
imagepolicy
networking
policy
rbac
v1
v1alpha1
v1beta1
scheduling
settings
storage
pkg
plugin
pkg
auth
authenticator
token
oidc
testing
client
rest
BUILDOWNERSclient.goclient_test.goconfig.goconfig_test.go
fake
plugin.goplugin_test.gorequest.gorequest_test.gotransport.gourl_utils.gourl_utils_test.gourlbackoff.gourlbackoff_test.goversions.gowatch
zz_generated.deepcopy.goscale
BUILDclient.goclient_test.godoc.go
fake
interfaces.goroundtrip_test.goscheme
BUILD
util.goappsint
appsv1beta1
appsv1beta2
autoscalingv1
doc.goextensionsint
extensionsv1beta1
register.gotypes.gozz_generated.deepcopy.gotesting
third_party
tools
auth
cache
BUILDOWNERScontroller.gocontroller_test.godelta_fifo.godelta_fifo_test.godoc.goexpiration_cache.goexpiration_cache_fakes.goexpiration_cache_test.gofake_custom_store.gofifo.gofifo_test.goheap.goheap_test.goindex.goindex_test.golisters.golistwatch.gomutation_cache.gomutation_detector.gomutation_detector_test.goprocessor_listener_test.goreflector.goreflector_metrics.goreflector_test.goshared_informer.goshared_informer_test.gostore.gostore_test.go
testing
thread_safe_store.goundelta_store.goundelta_store_test.goclientcmd
BUILD
api
BUILDdoc.gohelpers.gohelpers_test.go
auth_loaders.goclient_config.goclient_config_test.goconfig.godoc.goflag.gohelpers.goloader.goloader_test.gomerged_client_builder.gomerged_client_builder_test.gooverrides.gooverrides_test.govalidation.govalidation_test.golatest
register.gotypes.gotypes_test.gov1
zz_generated.deepcopy.goleaderelection
metrics
pager
portforward
record
reference
remotecommand
transport
BUILDOWNERScache.gocache_test.goconfig.goround_trippers.goround_trippers_test.go
spdy
transport.gotransport_test.goutil
buffer
cert
certificate
BUILDOWNERScertificate_manager.gocertificate_manager_test.gocertificate_store.gocertificate_store_test.go
csr
exec
flowcontrol
homedir
integer
jsonpath
retry
testing
workqueue
kube-openapi
.gitignore.travis.yml
Godeps
LICENSEOWNERSREADME.mdcode-of-conduct.mdexample
openapi-gen
pkg
aggregator
builder
common
generators
handler
util
26
vendor/github.com/go-openapi/jsonpointer/.editorconfig
generated
vendored
26
vendor/github.com/go-openapi/jsonpointer/.editorconfig
generated
vendored
@ -1,26 +0,0 @@
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# Set default charset
|
||||
[*.{js,py,go,scala,rb,java,html,css,less,sass,md}]
|
||||
charset = utf-8
|
||||
|
||||
# Tab indentation (no size specified)
|
||||
[*.go]
|
||||
indent_style = tab
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
# Matches the exact files either package.json or .travis.yml
|
||||
[{package.json,.travis.yml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
117
vendor/github.com/go-openapi/jsonpointer/.github/CONTRIBUTING.md
generated
vendored
117
vendor/github.com/go-openapi/jsonpointer/.github/CONTRIBUTING.md
generated
vendored
@ -1,117 +0,0 @@
|
||||
## Contribution Guidelines
|
||||
|
||||
### Pull requests are always welcome
|
||||
|
||||
We are always thrilled to receive pull requests, and do our best to
|
||||
process them as fast as possible. Not sure if that typo is worth a pull
|
||||
request? Do it! We will appreciate it.
|
||||
|
||||
If your pull request is not accepted on the first try, don't be
|
||||
discouraged! If there's a problem with the implementation, hopefully you
|
||||
received feedback on what to improve.
|
||||
|
||||
We're trying very hard to keep go-swagger lean and focused. We don't want it
|
||||
to do everything for everybody. This means that we might decide against
|
||||
incorporating a new feature. However, there might be a way to implement
|
||||
that feature *on top of* go-swagger.
|
||||
|
||||
|
||||
### Conventions
|
||||
|
||||
Fork the repo and make changes on your fork in a feature branch:
|
||||
|
||||
- If it's a bugfix branch, name it XXX-something where XXX is the number of the
|
||||
issue
|
||||
- If it's a feature branch, create an enhancement issue to announce your
|
||||
intentions, and name it XXX-something where XXX is the number of the issue.
|
||||
|
||||
Submit unit tests for your changes. Go has a great test framework built in; use
|
||||
it! Take a look at existing tests for inspiration. Run the full test suite on
|
||||
your branch before submitting a pull request.
|
||||
|
||||
Update the documentation when creating or modifying features. Test
|
||||
your documentation changes for clarity, concision, and correctness, as
|
||||
well as a clean documentation build. See ``docs/README.md`` for more
|
||||
information on building the docs and how docs get released.
|
||||
|
||||
Write clean code. Universally formatted code promotes ease of writing, reading,
|
||||
and maintenance. Always run `gofmt -s -w file.go` on each changed file before
|
||||
committing your changes. Most editors have plugins that do this automatically.
|
||||
|
||||
Pull requests descriptions should be as clear as possible and include a
|
||||
reference to all the issues that they address.
|
||||
|
||||
Pull requests must not contain commits from other users or branches.
|
||||
|
||||
Commit messages must start with a capitalized and short summary (max. 50
|
||||
chars) written in the imperative, followed by an optional, more detailed
|
||||
explanatory text which is separated from the summary by an empty line.
|
||||
|
||||
Code review comments may be added to your pull request. Discuss, then make the
|
||||
suggested modifications and push additional commits to your feature branch. Be
|
||||
sure to post a comment after pushing. The new commits will show up in the pull
|
||||
request automatically, but the reviewers will not be notified unless you
|
||||
comment.
|
||||
|
||||
Before the pull request is merged, make sure that you squash your commits into
|
||||
logical units of work using `git rebase -i` and `git push -f`. After every
|
||||
commit the test suite should be passing. Include documentation changes in the
|
||||
same commit so that a revert would remove all traces of the feature or fix.
|
||||
|
||||
Commits that fix or close an issue should include a reference like `Closes #XXX`
|
||||
or `Fixes #XXX`, which will automatically close the issue when merged.
|
||||
|
||||
### Sign your work
|
||||
|
||||
The sign-off is a simple line at the end of the explanation for the
|
||||
patch, which certifies that you wrote it or otherwise have the right to
|
||||
pass it on as an open-source patch. The rules are pretty simple: if you
|
||||
can certify the below (from
|
||||
[developercertificate.org](http://developercertificate.org/)):
|
||||
|
||||
```
|
||||
Developer Certificate of Origin
|
||||
Version 1.1
|
||||
|
||||
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
|
||||
660 York Street, Suite 102,
|
||||
San Francisco, CA 94110 USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
|
||||
Developer's Certificate of Origin 1.1
|
||||
|
||||
By making a contribution to this project, I certify that:
|
||||
|
||||
(a) The contribution was created in whole or in part by me and I
|
||||
have the right to submit it under the open source license
|
||||
indicated in the file; or
|
||||
|
||||
(b) The contribution is based upon previous work that, to the best
|
||||
of my knowledge, is covered under an appropriate open source
|
||||
license and I have the right under that license to submit that
|
||||
work with modifications, whether created in whole or in part
|
||||
by me, under the same open source license (unless I am
|
||||
permitted to submit under a different license), as indicated
|
||||
in the file; or
|
||||
|
||||
(c) The contribution was provided directly to me by some other
|
||||
person who certified (a), (b) or (c) and I have not modified
|
||||
it.
|
||||
|
||||
(d) I understand and agree that this project and the contribution
|
||||
are public and that a record of the contribution (including all
|
||||
personal information I submit with it, including my sign-off) is
|
||||
maintained indefinitely and may be redistributed consistent with
|
||||
this project or the open source license(s) involved.
|
||||
```
|
||||
|
||||
then you just add a line to every git commit message:
|
||||
|
||||
Signed-off-by: Joe Smith <joe@gmail.com>
|
||||
|
||||
using your real name (sorry, no pseudonyms or anonymous contributions.)
|
||||
|
||||
You can add the sign off when creating the git commit via `git commit -s`.
|
1
vendor/github.com/go-openapi/jsonpointer/.gitignore
generated
vendored
1
vendor/github.com/go-openapi/jsonpointer/.gitignore
generated
vendored
@ -1 +0,0 @@
|
||||
secrets.yml
|
13
vendor/github.com/go-openapi/jsonpointer/.travis.yml
generated
vendored
13
vendor/github.com/go-openapi/jsonpointer/.travis.yml
generated
vendored
@ -1,13 +0,0 @@
|
||||
language: go
|
||||
go:
|
||||
- 1.7
|
||||
install:
|
||||
- go get -u github.com/stretchr/testify/assert
|
||||
- go get -u github.com/go-openapi/swag
|
||||
script:
|
||||
- go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic ./...
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
notifications:
|
||||
slack:
|
||||
secure: a5VgoiwB1G/AZqzmephPZIhEB9avMlsWSlVnM1dSAtYAwdrQHGTQxAmpOxYIoSPDhWNN5bfZmjd29++UlTwLcHSR+e0kJhH6IfDlsHj/HplNCJ9tyI0zYc7XchtdKgeMxMzBKCzgwFXGSbQGydXTliDNBo0HOzmY3cou/daMFTP60K+offcjS+3LRAYb1EroSRXZqrk1nuF/xDL3792DZUdPMiFR/L/Df6y74D6/QP4sTkTDFQitz4Wy/7jbsfj8dG6qK2zivgV6/l+w4OVjFkxVpPXogDWY10vVXNVynqxfJ7to2d1I9lNCHE2ilBCkWMIPdyJF7hjF8pKW+82yP4EzRh0vu8Xn0HT5MZpQxdRY/YMxNrWaG7SxsoEaO4q5uhgdzAqLYY3TRa7MjIK+7Ur+aqOeTXn6OKwVi0CjvZ6mIU3WUKSwiwkFZMbjRAkSb5CYwMEfGFO/z964xz83qGt6WAtBXNotqCQpTIiKtDHQeLOMfksHImCg6JLhQcWBVxamVgu0G3Pdh8Y6DyPnxraXY95+QDavbjqv7TeYT9T/FNnrkXaTTK0s4iWE5H4ACU0Qvz0wUYgfQrZv0/Hp7V17+rabUwnzYySHCy9SWX/7OV9Cfh31iMp9ZIffr76xmmThtOEqs8TrTtU6BWI3rWwvA9cXQipZTVtL0oswrGw=
|
74
vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md
generated
vendored
74
vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md
generated
vendored
@ -1,74 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at ivan+abuse@flanders.co.nz. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
202
vendor/github.com/go-openapi/jsonpointer/LICENSE
generated
vendored
202
vendor/github.com/go-openapi/jsonpointer/LICENSE
generated
vendored
@ -1,202 +0,0 @@
|
||||
|
||||
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.
|
15
vendor/github.com/go-openapi/jsonpointer/README.md
generated
vendored
15
vendor/github.com/go-openapi/jsonpointer/README.md
generated
vendored
@ -1,15 +0,0 @@
|
||||
# gojsonpointer [](https://travis-ci.org/go-openapi/jsonpointer) [](https://codecov.io/gh/go-openapi/jsonpointer) [](https://slackin.goswagger.io)
|
||||
|
||||
[](https://raw.githubusercontent.com/go-openapi/jsonpointer/master/LICENSE) [](http://godoc.org/github.com/go-openapi/jsonpointer)
|
||||
An implementation of JSON Pointer - Go language
|
||||
|
||||
## Status
|
||||
Completed YES
|
||||
|
||||
Tested YES
|
||||
|
||||
## References
|
||||
http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07
|
||||
|
||||
### Note
|
||||
The 4.Evaluation part of the previous reference, starting with 'If the currently referenced value is a JSON array, the reference token MUST contain either...' is not implemented.
|
390
vendor/github.com/go-openapi/jsonpointer/pointer.go
generated
vendored
390
vendor/github.com/go-openapi/jsonpointer/pointer.go
generated
vendored
@ -1,390 +0,0 @@
|
||||
// Copyright 2013 sigu-399 ( https://github.com/sigu-399 )
|
||||
//
|
||||
// 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.
|
||||
|
||||
// author sigu-399
|
||||
// author-github https://github.com/sigu-399
|
||||
// author-mail sigu.399@gmail.com
|
||||
//
|
||||
// repository-name jsonpointer
|
||||
// repository-desc An implementation of JSON Pointer - Go language
|
||||
//
|
||||
// description Main and unique file.
|
||||
//
|
||||
// created 25-02-2013
|
||||
|
||||
package jsonpointer
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
const (
|
||||
emptyPointer = ``
|
||||
pointerSeparator = `/`
|
||||
|
||||
invalidStart = `JSON pointer must be empty or start with a "` + pointerSeparator
|
||||
)
|
||||
|
||||
var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem()
|
||||
var jsonSetableType = reflect.TypeOf(new(JSONSetable)).Elem()
|
||||
|
||||
// JSONPointable is an interface for structs to implement when they need to customize the
|
||||
// json pointer process
|
||||
type JSONPointable interface {
|
||||
JSONLookup(string) (interface{}, error)
|
||||
}
|
||||
|
||||
// JSONSetable is an interface for structs to implement when they need to customize the
|
||||
// json pointer process
|
||||
type JSONSetable interface {
|
||||
JSONSet(string, interface{}) error
|
||||
}
|
||||
|
||||
// New creates a new json pointer for the given string
|
||||
func New(jsonPointerString string) (Pointer, error) {
|
||||
|
||||
var p Pointer
|
||||
err := p.parse(jsonPointerString)
|
||||
return p, err
|
||||
|
||||
}
|
||||
|
||||
// Pointer the json pointer reprsentation
|
||||
type Pointer struct {
|
||||
referenceTokens []string
|
||||
}
|
||||
|
||||
// "Constructor", parses the given string JSON pointer
|
||||
func (p *Pointer) parse(jsonPointerString string) error {
|
||||
|
||||
var err error
|
||||
|
||||
if jsonPointerString != emptyPointer {
|
||||
if !strings.HasPrefix(jsonPointerString, pointerSeparator) {
|
||||
err = errors.New(invalidStart)
|
||||
} else {
|
||||
referenceTokens := strings.Split(jsonPointerString, pointerSeparator)
|
||||
for _, referenceToken := range referenceTokens[1:] {
|
||||
p.referenceTokens = append(p.referenceTokens, referenceToken)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Get uses the pointer to retrieve a value from a JSON document
|
||||
func (p *Pointer) Get(document interface{}) (interface{}, reflect.Kind, error) {
|
||||
return p.get(document, swag.DefaultJSONNameProvider)
|
||||
}
|
||||
|
||||
// Set uses the pointer to set a value from a JSON document
|
||||
func (p *Pointer) Set(document interface{}, value interface{}) (interface{}, error) {
|
||||
return document, p.set(document, value, swag.DefaultJSONNameProvider)
|
||||
}
|
||||
|
||||
// GetForToken gets a value for a json pointer token 1 level deep
|
||||
func GetForToken(document interface{}, decodedToken string) (interface{}, reflect.Kind, error) {
|
||||
return getSingleImpl(document, decodedToken, swag.DefaultJSONNameProvider)
|
||||
}
|
||||
|
||||
// SetForToken gets a value for a json pointer token 1 level deep
|
||||
func SetForToken(document interface{}, decodedToken string, value interface{}) (interface{}, error) {
|
||||
return document, setSingleImpl(document, value, decodedToken, swag.DefaultJSONNameProvider)
|
||||
}
|
||||
|
||||
func getSingleImpl(node interface{}, decodedToken string, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) {
|
||||
rValue := reflect.Indirect(reflect.ValueOf(node))
|
||||
kind := rValue.Kind()
|
||||
|
||||
switch kind {
|
||||
|
||||
case reflect.Struct:
|
||||
if rValue.Type().Implements(jsonPointableType) {
|
||||
r, err := node.(JSONPointable).JSONLookup(decodedToken)
|
||||
if err != nil {
|
||||
return nil, kind, err
|
||||
}
|
||||
return r, kind, nil
|
||||
}
|
||||
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
|
||||
if !ok {
|
||||
return nil, kind, fmt.Errorf("object has no field %q", decodedToken)
|
||||
}
|
||||
fld := rValue.FieldByName(nm)
|
||||
return fld.Interface(), kind, nil
|
||||
|
||||
case reflect.Map:
|
||||
kv := reflect.ValueOf(decodedToken)
|
||||
mv := rValue.MapIndex(kv)
|
||||
|
||||
if mv.IsValid() && !swag.IsZero(mv) {
|
||||
return mv.Interface(), kind, nil
|
||||
}
|
||||
return nil, kind, fmt.Errorf("object has no key %q", decodedToken)
|
||||
|
||||
case reflect.Slice:
|
||||
tokenIndex, err := strconv.Atoi(decodedToken)
|
||||
if err != nil {
|
||||
return nil, kind, err
|
||||
}
|
||||
sLength := rValue.Len()
|
||||
if tokenIndex < 0 || tokenIndex >= sLength {
|
||||
return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength-1, tokenIndex)
|
||||
}
|
||||
|
||||
elem := rValue.Index(tokenIndex)
|
||||
return elem.Interface(), kind, nil
|
||||
|
||||
default:
|
||||
return nil, kind, fmt.Errorf("invalid token reference %q", decodedToken)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func setSingleImpl(node, data interface{}, decodedToken string, nameProvider *swag.NameProvider) error {
|
||||
rValue := reflect.Indirect(reflect.ValueOf(node))
|
||||
switch rValue.Kind() {
|
||||
|
||||
case reflect.Struct:
|
||||
if ns, ok := node.(JSONSetable); ok { // pointer impl
|
||||
return ns.JSONSet(decodedToken, data)
|
||||
}
|
||||
|
||||
if rValue.Type().Implements(jsonSetableType) {
|
||||
return node.(JSONSetable).JSONSet(decodedToken, data)
|
||||
}
|
||||
|
||||
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
|
||||
if !ok {
|
||||
return fmt.Errorf("object has no field %q", decodedToken)
|
||||
}
|
||||
fld := rValue.FieldByName(nm)
|
||||
if fld.IsValid() {
|
||||
fld.Set(reflect.ValueOf(data))
|
||||
}
|
||||
return nil
|
||||
|
||||
case reflect.Map:
|
||||
kv := reflect.ValueOf(decodedToken)
|
||||
rValue.SetMapIndex(kv, reflect.ValueOf(data))
|
||||
return nil
|
||||
|
||||
case reflect.Slice:
|
||||
tokenIndex, err := strconv.Atoi(decodedToken)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sLength := rValue.Len()
|
||||
if tokenIndex < 0 || tokenIndex >= sLength {
|
||||
return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex)
|
||||
}
|
||||
|
||||
elem := rValue.Index(tokenIndex)
|
||||
if !elem.CanSet() {
|
||||
return fmt.Errorf("can't set slice index %s to %v", decodedToken, data)
|
||||
}
|
||||
elem.Set(reflect.ValueOf(data))
|
||||
return nil
|
||||
|
||||
default:
|
||||
return fmt.Errorf("invalid token reference %q", decodedToken)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (p *Pointer) get(node interface{}, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) {
|
||||
|
||||
if nameProvider == nil {
|
||||
nameProvider = swag.DefaultJSONNameProvider
|
||||
}
|
||||
|
||||
kind := reflect.Invalid
|
||||
|
||||
// Full document when empty
|
||||
if len(p.referenceTokens) == 0 {
|
||||
return node, kind, nil
|
||||
}
|
||||
|
||||
for _, token := range p.referenceTokens {
|
||||
|
||||
decodedToken := Unescape(token)
|
||||
|
||||
r, knd, err := getSingleImpl(node, decodedToken, nameProvider)
|
||||
if err != nil {
|
||||
return nil, knd, err
|
||||
}
|
||||
node, kind = r, knd
|
||||
|
||||
}
|
||||
|
||||
rValue := reflect.ValueOf(node)
|
||||
kind = rValue.Kind()
|
||||
|
||||
return node, kind, nil
|
||||
}
|
||||
|
||||
func (p *Pointer) set(node, data interface{}, nameProvider *swag.NameProvider) error {
|
||||
knd := reflect.ValueOf(node).Kind()
|
||||
|
||||
if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array {
|
||||
return fmt.Errorf("only structs, pointers, maps and slices are supported for setting values")
|
||||
}
|
||||
|
||||
if nameProvider == nil {
|
||||
nameProvider = swag.DefaultJSONNameProvider
|
||||
}
|
||||
|
||||
// Full document when empty
|
||||
if len(p.referenceTokens) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
lastI := len(p.referenceTokens) - 1
|
||||
for i, token := range p.referenceTokens {
|
||||
isLastToken := i == lastI
|
||||
decodedToken := Unescape(token)
|
||||
|
||||
if isLastToken {
|
||||
|
||||
return setSingleImpl(node, data, decodedToken, nameProvider)
|
||||
}
|
||||
|
||||
rValue := reflect.Indirect(reflect.ValueOf(node))
|
||||
kind := rValue.Kind()
|
||||
|
||||
switch kind {
|
||||
|
||||
case reflect.Struct:
|
||||
if rValue.Type().Implements(jsonPointableType) {
|
||||
r, err := node.(JSONPointable).JSONLookup(decodedToken)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fld := reflect.ValueOf(r)
|
||||
if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr {
|
||||
node = fld.Addr().Interface()
|
||||
continue
|
||||
}
|
||||
node = r
|
||||
continue
|
||||
}
|
||||
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
|
||||
if !ok {
|
||||
return fmt.Errorf("object has no field %q", decodedToken)
|
||||
}
|
||||
fld := rValue.FieldByName(nm)
|
||||
if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr {
|
||||
node = fld.Addr().Interface()
|
||||
continue
|
||||
}
|
||||
node = fld.Interface()
|
||||
|
||||
case reflect.Map:
|
||||
kv := reflect.ValueOf(decodedToken)
|
||||
mv := rValue.MapIndex(kv)
|
||||
|
||||
if !mv.IsValid() {
|
||||
return fmt.Errorf("object has no key %q", decodedToken)
|
||||
}
|
||||
if mv.CanAddr() && mv.Kind() != reflect.Interface && mv.Kind() != reflect.Map && mv.Kind() != reflect.Slice && mv.Kind() != reflect.Ptr {
|
||||
node = mv.Addr().Interface()
|
||||
continue
|
||||
}
|
||||
node = mv.Interface()
|
||||
|
||||
case reflect.Slice:
|
||||
tokenIndex, err := strconv.Atoi(decodedToken)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sLength := rValue.Len()
|
||||
if tokenIndex < 0 || tokenIndex >= sLength {
|
||||
return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex)
|
||||
}
|
||||
|
||||
elem := rValue.Index(tokenIndex)
|
||||
if elem.CanAddr() && elem.Kind() != reflect.Interface && elem.Kind() != reflect.Map && elem.Kind() != reflect.Slice && elem.Kind() != reflect.Ptr {
|
||||
node = elem.Addr().Interface()
|
||||
continue
|
||||
}
|
||||
node = elem.Interface()
|
||||
|
||||
default:
|
||||
return fmt.Errorf("invalid token reference %q", decodedToken)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// DecodedTokens returns the decoded tokens
|
||||
func (p *Pointer) DecodedTokens() []string {
|
||||
result := make([]string, 0, len(p.referenceTokens))
|
||||
for _, t := range p.referenceTokens {
|
||||
result = append(result, Unescape(t))
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// IsEmpty returns true if this is an empty json pointer
|
||||
// this indicates that it points to the root document
|
||||
func (p *Pointer) IsEmpty() bool {
|
||||
return len(p.referenceTokens) == 0
|
||||
}
|
||||
|
||||
// Pointer to string representation function
|
||||
func (p *Pointer) String() string {
|
||||
|
||||
if len(p.referenceTokens) == 0 {
|
||||
return emptyPointer
|
||||
}
|
||||
|
||||
pointerString := pointerSeparator + strings.Join(p.referenceTokens, pointerSeparator)
|
||||
|
||||
return pointerString
|
||||
}
|
||||
|
||||
// Specific JSON pointer encoding here
|
||||
// ~0 => ~
|
||||
// ~1 => /
|
||||
// ... and vice versa
|
||||
|
||||
const (
|
||||
encRefTok0 = `~0`
|
||||
encRefTok1 = `~1`
|
||||
decRefTok0 = `~`
|
||||
decRefTok1 = `/`
|
||||
)
|
||||
|
||||
// Unescape unescapes a json pointer reference token string to the original representation
|
||||
func Unescape(token string) string {
|
||||
step1 := strings.Replace(token, encRefTok1, decRefTok1, -1)
|
||||
step2 := strings.Replace(step1, encRefTok0, decRefTok0, -1)
|
||||
return step2
|
||||
}
|
||||
|
||||
// Escape escapes a pointer reference token string
|
||||
func Escape(token string) string {
|
||||
step1 := strings.Replace(token, decRefTok0, encRefTok0, -1)
|
||||
step2 := strings.Replace(step1, decRefTok1, encRefTok1, -1)
|
||||
return step2
|
||||
}
|
573
vendor/github.com/go-openapi/jsonpointer/pointer_test.go
generated
vendored
573
vendor/github.com/go-openapi/jsonpointer/pointer_test.go
generated
vendored
@ -1,573 +0,0 @@
|
||||
// Copyright 2013 sigu-399 ( https://github.com/sigu-399 )
|
||||
//
|
||||
// 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.
|
||||
|
||||
// author sigu-399
|
||||
// author-github https://github.com/sigu-399
|
||||
// author-mail sigu.399@gmail.com
|
||||
//
|
||||
// repository-name jsonpointer
|
||||
// repository-desc An implementation of JSON Pointer - Go language
|
||||
//
|
||||
// description Automated tests on package.
|
||||
//
|
||||
// created 03-03-2013
|
||||
|
||||
package jsonpointer
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
const (
|
||||
TestDocumentNBItems = 11
|
||||
TestNodeObjNBItems = 4
|
||||
TestDocumentString = `{
|
||||
"foo": ["bar", "baz"],
|
||||
"obj": { "a":1, "b":2, "c":[3,4], "d":[ {"e":9}, {"f":[50,51]} ] },
|
||||
"": 0,
|
||||
"a/b": 1,
|
||||
"c%d": 2,
|
||||
"e^f": 3,
|
||||
"g|h": 4,
|
||||
"i\\j": 5,
|
||||
"k\"l": 6,
|
||||
" ": 7,
|
||||
"m~n": 8
|
||||
}`
|
||||
)
|
||||
|
||||
var testDocumentJSON interface{}
|
||||
|
||||
type testStructJSON struct {
|
||||
Foo []string `json:"foo"`
|
||||
Obj struct {
|
||||
A int `json:"a"`
|
||||
B int `json:"b"`
|
||||
C []int `json:"c"`
|
||||
D []struct {
|
||||
E int `json:"e"`
|
||||
F []int `json:"f"`
|
||||
} `json:"d"`
|
||||
} `json:"obj"`
|
||||
}
|
||||
|
||||
type aliasedMap map[string]interface{}
|
||||
|
||||
var testStructJSONDoc testStructJSON
|
||||
var testStructJSONPtr *testStructJSON
|
||||
|
||||
func init() {
|
||||
json.Unmarshal([]byte(TestDocumentString), &testDocumentJSON)
|
||||
json.Unmarshal([]byte(TestDocumentString), &testStructJSONDoc)
|
||||
testStructJSONPtr = &testStructJSONDoc
|
||||
}
|
||||
|
||||
func TestEscaping(t *testing.T) {
|
||||
|
||||
ins := []string{`/`, `/`, `/a~1b`, `/a~1b`, `/c%d`, `/e^f`, `/g|h`, `/i\j`, `/k"l`, `/ `, `/m~0n`}
|
||||
outs := []float64{0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 8}
|
||||
|
||||
for i := range ins {
|
||||
p, err := New(ins[i])
|
||||
if assert.NoError(t, err, "input: %v", ins[i]) {
|
||||
result, _, err := p.Get(testDocumentJSON)
|
||||
if assert.NoError(t, err, "input: %v", ins[i]) {
|
||||
assert.Equal(t, outs[i], result, "input: %v", ins[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestFullDocument(t *testing.T) {
|
||||
|
||||
in := ``
|
||||
|
||||
p, err := New(in)
|
||||
if err != nil {
|
||||
t.Errorf("New(%v) error %v", in, err.Error())
|
||||
}
|
||||
|
||||
result, _, err := p.Get(testDocumentJSON)
|
||||
if err != nil {
|
||||
t.Errorf("Get(%v) error %v", in, err.Error())
|
||||
}
|
||||
|
||||
if len(result.(map[string]interface{})) != TestDocumentNBItems {
|
||||
t.Errorf("Get(%v) = %v, expect full document", in, result)
|
||||
}
|
||||
|
||||
result, _, err = p.get(testDocumentJSON, nil)
|
||||
if err != nil {
|
||||
t.Errorf("Get(%v) error %v", in, err.Error())
|
||||
}
|
||||
|
||||
if len(result.(map[string]interface{})) != TestDocumentNBItems {
|
||||
t.Errorf("Get(%v) = %v, expect full document", in, result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDecodedTokens(t *testing.T) {
|
||||
p, err := New("/obj/a~1b")
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, []string{"obj", "a/b"}, p.DecodedTokens())
|
||||
}
|
||||
|
||||
func TestIsEmpty(t *testing.T) {
|
||||
p, err := New("")
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, p.IsEmpty())
|
||||
p, err = New("/obj")
|
||||
assert.NoError(t, err)
|
||||
assert.False(t, p.IsEmpty())
|
||||
}
|
||||
|
||||
func TestGetSingle(t *testing.T) {
|
||||
in := `/obj`
|
||||
|
||||
_, err := New(in)
|
||||
assert.NoError(t, err)
|
||||
result, _, err := GetForToken(testDocumentJSON, "obj")
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, result, TestNodeObjNBItems)
|
||||
|
||||
result, _, err = GetForToken(testStructJSONDoc, "Obj")
|
||||
assert.Error(t, err)
|
||||
assert.Nil(t, result)
|
||||
|
||||
result, _, err = GetForToken(testStructJSONDoc, "Obj2")
|
||||
assert.Error(t, err)
|
||||
assert.Nil(t, result)
|
||||
}
|
||||
|
||||
type pointableImpl struct {
|
||||
a string
|
||||
}
|
||||
|
||||
func (p pointableImpl) JSONLookup(token string) (interface{}, error) {
|
||||
if token == "some" {
|
||||
return p.a, nil
|
||||
}
|
||||
return nil, fmt.Errorf("object has no field %q", token)
|
||||
}
|
||||
|
||||
func TestPointableInterface(t *testing.T) {
|
||||
p := &pointableImpl{"hello"}
|
||||
|
||||
result, _, err := GetForToken(p, "some")
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, p.a, result)
|
||||
|
||||
result, _, err = GetForToken(p, "something")
|
||||
assert.Error(t, err)
|
||||
assert.Nil(t, result)
|
||||
}
|
||||
|
||||
func TestGetNode(t *testing.T) {
|
||||
|
||||
in := `/obj`
|
||||
|
||||
p, err := New(in)
|
||||
assert.NoError(t, err)
|
||||
result, _, err := p.Get(testDocumentJSON)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, result, TestNodeObjNBItems)
|
||||
|
||||
result, _, err = p.Get(aliasedMap(testDocumentJSON.(map[string]interface{})))
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, result, TestNodeObjNBItems)
|
||||
|
||||
result, _, err = p.Get(testStructJSONDoc)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, testStructJSONDoc.Obj, result)
|
||||
|
||||
result, _, err = p.Get(testStructJSONPtr)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, testStructJSONDoc.Obj, result)
|
||||
}
|
||||
|
||||
func TestArray(t *testing.T) {
|
||||
|
||||
ins := []string{`/foo/0`, `/foo/0`, `/foo/1`}
|
||||
outs := []string{"bar", "bar", "baz"}
|
||||
|
||||
for i := range ins {
|
||||
p, err := New(ins[i])
|
||||
assert.NoError(t, err)
|
||||
|
||||
result, _, err := p.Get(testStructJSONDoc)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, outs[i], result)
|
||||
|
||||
result, _, err = p.Get(testStructJSONPtr)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, outs[i], result)
|
||||
|
||||
result, _, err = p.Get(testDocumentJSON)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, outs[i], result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestOtherThings(t *testing.T) {
|
||||
_, err := New("abc")
|
||||
assert.Error(t, err)
|
||||
|
||||
p, err := New("")
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "", p.String())
|
||||
|
||||
p, err = New("/obj/a")
|
||||
assert.Equal(t, "/obj/a", p.String())
|
||||
|
||||
s := Escape("m~n")
|
||||
assert.Equal(t, "m~0n", s)
|
||||
s = Escape("m/n")
|
||||
assert.Equal(t, "m~1n", s)
|
||||
|
||||
p, err = New("/foo/3")
|
||||
assert.NoError(t, err)
|
||||
_, _, err = p.Get(testDocumentJSON)
|
||||
assert.Error(t, err)
|
||||
|
||||
p, err = New("/foo/a")
|
||||
assert.NoError(t, err)
|
||||
_, _, err = p.Get(testDocumentJSON)
|
||||
assert.Error(t, err)
|
||||
|
||||
p, err = New("/notthere")
|
||||
assert.NoError(t, err)
|
||||
_, _, err = p.Get(testDocumentJSON)
|
||||
assert.Error(t, err)
|
||||
|
||||
p, err = New("/invalid")
|
||||
assert.NoError(t, err)
|
||||
_, _, err = p.Get(1234)
|
||||
assert.Error(t, err)
|
||||
|
||||
p, err = New("/foo/1")
|
||||
assert.NoError(t, err)
|
||||
expected := "hello"
|
||||
bbb := testDocumentJSON.(map[string]interface{})["foo"]
|
||||
bbb.([]interface{})[1] = "hello"
|
||||
|
||||
v, _, err := p.Get(testDocumentJSON)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, expected, v)
|
||||
|
||||
esc := Escape("a/")
|
||||
assert.Equal(t, "a~1", esc)
|
||||
unesc := Unescape(esc)
|
||||
assert.Equal(t, "a/", unesc)
|
||||
|
||||
unesc = Unescape("~01")
|
||||
assert.Equal(t, "~1", unesc)
|
||||
assert.Equal(t, "~0~1", Escape("~/"))
|
||||
assert.Equal(t, "~/", Unescape("~0~1"))
|
||||
}
|
||||
|
||||
func TestObject(t *testing.T) {
|
||||
|
||||
ins := []string{`/obj/a`, `/obj/b`, `/obj/c/0`, `/obj/c/1`, `/obj/c/1`, `/obj/d/1/f/0`}
|
||||
outs := []float64{1, 2, 3, 4, 4, 50}
|
||||
|
||||
for i := range ins {
|
||||
|
||||
p, err := New(ins[i])
|
||||
assert.NoError(t, err)
|
||||
|
||||
result, _, err := p.Get(testDocumentJSON)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, outs[i], result)
|
||||
|
||||
result, _, err = p.Get(testStructJSONDoc)
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, outs[i], result)
|
||||
|
||||
result, _, err = p.Get(testStructJSONPtr)
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, outs[i], result)
|
||||
}
|
||||
}
|
||||
|
||||
type setJsonDocEle struct {
|
||||
B int `json:"b"`
|
||||
C int `json:"c"`
|
||||
}
|
||||
type setJsonDoc struct {
|
||||
A []struct {
|
||||
B int `json:"b"`
|
||||
C int `json:"c"`
|
||||
} `json:"a"`
|
||||
D int `json:"d"`
|
||||
}
|
||||
|
||||
type settableDoc struct {
|
||||
Coll settableColl
|
||||
Int settableInt
|
||||
}
|
||||
|
||||
func (s settableDoc) MarshalJSON() ([]byte, error) {
|
||||
var res struct {
|
||||
A settableColl `json:"a"`
|
||||
D settableInt `json:"d"`
|
||||
}
|
||||
res.A = s.Coll
|
||||
res.D = s.Int
|
||||
return json.Marshal(res)
|
||||
}
|
||||
func (s *settableDoc) UnmarshalJSON(data []byte) error {
|
||||
var res struct {
|
||||
A settableColl `json:"a"`
|
||||
D settableInt `json:"d"`
|
||||
}
|
||||
|
||||
if err := json.Unmarshal(data, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
s.Coll = res.A
|
||||
s.Int = res.D
|
||||
return nil
|
||||
}
|
||||
|
||||
// JSONLookup implements an interface to customize json pointer lookup
|
||||
func (s settableDoc) JSONLookup(token string) (interface{}, error) {
|
||||
switch token {
|
||||
case "a":
|
||||
return &s.Coll, nil
|
||||
case "d":
|
||||
return &s.Int, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("%s is not a known field", token)
|
||||
}
|
||||
}
|
||||
|
||||
// JSONLookup implements an interface to customize json pointer lookup
|
||||
func (s *settableDoc) JSONSet(token string, data interface{}) error {
|
||||
switch token {
|
||||
case "a":
|
||||
switch dt := data.(type) {
|
||||
case settableColl:
|
||||
s.Coll = dt
|
||||
return nil
|
||||
case *settableColl:
|
||||
if dt != nil {
|
||||
s.Coll = *dt
|
||||
} else {
|
||||
s.Coll = settableColl{}
|
||||
}
|
||||
return nil
|
||||
case []settableCollItem:
|
||||
s.Coll.Items = dt
|
||||
return nil
|
||||
}
|
||||
case "d":
|
||||
switch dt := data.(type) {
|
||||
case settableInt:
|
||||
s.Int = dt
|
||||
return nil
|
||||
case int:
|
||||
s.Int.Value = dt
|
||||
return nil
|
||||
case int8:
|
||||
s.Int.Value = int(dt)
|
||||
return nil
|
||||
case int16:
|
||||
s.Int.Value = int(dt)
|
||||
return nil
|
||||
case int32:
|
||||
s.Int.Value = int(dt)
|
||||
return nil
|
||||
case int64:
|
||||
s.Int.Value = int(dt)
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("invalid type %T for %s", data, token)
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("%s is not a known field", token)
|
||||
}
|
||||
|
||||
type settableColl struct {
|
||||
Items []settableCollItem
|
||||
}
|
||||
|
||||
func (s settableColl) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(s.Items)
|
||||
}
|
||||
func (s *settableColl) UnmarshalJSON(data []byte) error {
|
||||
return json.Unmarshal(data, &s.Items)
|
||||
}
|
||||
|
||||
// JSONLookup implements an interface to customize json pointer lookup
|
||||
func (s settableColl) JSONLookup(token string) (interface{}, error) {
|
||||
if tok, err := strconv.Atoi(token); err == nil {
|
||||
return &s.Items[tok], nil
|
||||
}
|
||||
return nil, fmt.Errorf("%s is not a valid index", token)
|
||||
}
|
||||
|
||||
// JSONLookup implements an interface to customize json pointer lookup
|
||||
func (s *settableColl) JSONSet(token string, data interface{}) error {
|
||||
if _, err := strconv.Atoi(token); err == nil {
|
||||
_, err := SetForToken(s.Items, token, data)
|
||||
return err
|
||||
}
|
||||
return fmt.Errorf("%s is not a valid index", token)
|
||||
}
|
||||
|
||||
type settableCollItem struct {
|
||||
B int `json:"b"`
|
||||
C int `json:"c"`
|
||||
}
|
||||
|
||||
type settableInt struct {
|
||||
Value int
|
||||
}
|
||||
|
||||
func (s settableInt) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(s.Value)
|
||||
}
|
||||
func (s *settableInt) UnmarshalJSON(data []byte) error {
|
||||
return json.Unmarshal(data, &s.Value)
|
||||
}
|
||||
|
||||
func TestSetNode(t *testing.T) {
|
||||
|
||||
jsonText := `{"a":[{"b": 1, "c": 2}], "d": 3}`
|
||||
|
||||
var jsonDocument interface{}
|
||||
if assert.NoError(t, json.Unmarshal([]byte(jsonText), &jsonDocument)) {
|
||||
in := "/a/0/c"
|
||||
p, err := New(in)
|
||||
if assert.NoError(t, err) {
|
||||
|
||||
_, err = p.Set(jsonDocument, 999)
|
||||
assert.NoError(t, err)
|
||||
|
||||
firstNode := jsonDocument.(map[string]interface{})
|
||||
assert.Len(t, firstNode, 2)
|
||||
|
||||
sliceNode := firstNode["a"].([]interface{})
|
||||
assert.Len(t, sliceNode, 1)
|
||||
|
||||
changedNode := sliceNode[0].(map[string]interface{})
|
||||
chNodeVI := changedNode["c"]
|
||||
if assert.IsType(t, 0, chNodeVI) {
|
||||
changedNodeValue := chNodeVI.(int)
|
||||
if assert.Equal(t, 999, changedNodeValue) {
|
||||
assert.Len(t, sliceNode, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
v, err := New("/a/0")
|
||||
if assert.NoError(t, err) {
|
||||
_, err = v.Set(jsonDocument, map[string]interface{}{"b": 3, "c": 8})
|
||||
if assert.NoError(t, err) {
|
||||
firstNode := jsonDocument.(map[string]interface{})
|
||||
assert.Len(t, firstNode, 2)
|
||||
|
||||
sliceNode := firstNode["a"].([]interface{})
|
||||
assert.Len(t, sliceNode, 1)
|
||||
changedNode := sliceNode[0].(map[string]interface{})
|
||||
assert.Equal(t, 3, changedNode["b"])
|
||||
assert.Equal(t, 8, changedNode["c"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var structDoc setJsonDoc
|
||||
if assert.NoError(t, json.Unmarshal([]byte(jsonText), &structDoc)) {
|
||||
g, err := New("/a")
|
||||
if assert.NoError(t, err) {
|
||||
_, err = g.Set(&structDoc, []struct {
|
||||
B int `json:"b"`
|
||||
C int `json:"c"`
|
||||
}{{B: 4, C: 7}})
|
||||
|
||||
if assert.NoError(t, err) {
|
||||
assert.Len(t, structDoc.A, 1)
|
||||
changedNode := structDoc.A[0]
|
||||
assert.Equal(t, 4, changedNode.B)
|
||||
assert.Equal(t, 7, changedNode.C)
|
||||
}
|
||||
}
|
||||
|
||||
v, err := New("/a/0")
|
||||
if assert.NoError(t, err) {
|
||||
_, err = v.Set(structDoc, struct {
|
||||
B int `json:"b"`
|
||||
C int `json:"c"`
|
||||
}{B: 3, C: 8})
|
||||
|
||||
if assert.NoError(t, err) {
|
||||
assert.Len(t, structDoc.A, 1)
|
||||
changedNode := structDoc.A[0]
|
||||
assert.Equal(t, 3, changedNode.B)
|
||||
assert.Equal(t, 8, changedNode.C)
|
||||
}
|
||||
}
|
||||
|
||||
p, err := New("/a/0/c")
|
||||
if assert.NoError(t, err) {
|
||||
_, err = p.Set(&structDoc, 999)
|
||||
assert.NoError(t, err)
|
||||
if assert.Len(t, structDoc.A, 1) {
|
||||
assert.Equal(t, 999, structDoc.A[0].C)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var setDoc settableDoc
|
||||
if assert.NoError(t, json.Unmarshal([]byte(jsonText), &setDoc)) {
|
||||
g, err := New("/a")
|
||||
if assert.NoError(t, err) {
|
||||
_, err = g.Set(&setDoc, []settableCollItem{{B: 4, C: 7}})
|
||||
|
||||
if assert.NoError(t, err) {
|
||||
assert.Len(t, setDoc.Coll.Items, 1)
|
||||
changedNode := setDoc.Coll.Items[0]
|
||||
assert.Equal(t, 4, changedNode.B)
|
||||
assert.Equal(t, 7, changedNode.C)
|
||||
}
|
||||
}
|
||||
|
||||
v, err := New("/a/0")
|
||||
if assert.NoError(t, err) {
|
||||
_, err = v.Set(setDoc, settableCollItem{B: 3, C: 8})
|
||||
|
||||
if assert.NoError(t, err) {
|
||||
assert.Len(t, setDoc.Coll.Items, 1)
|
||||
changedNode := setDoc.Coll.Items[0]
|
||||
assert.Equal(t, 3, changedNode.B)
|
||||
assert.Equal(t, 8, changedNode.C)
|
||||
}
|
||||
}
|
||||
|
||||
p, err := New("/a/0/c")
|
||||
if assert.NoError(t, err) {
|
||||
_, err = p.Set(setDoc, 999)
|
||||
assert.NoError(t, err)
|
||||
if assert.Len(t, setDoc.Coll.Items, 1) {
|
||||
assert.Equal(t, 999, setDoc.Coll.Items[0].C)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user