mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
[Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670)
* Update go-swagger * vendor
This commit is contained in:
38
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/byte_slice_codec_options.go
generated
vendored
Normal file
38
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/byte_slice_codec_options.go
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright (C) MongoDB, Inc. 2017-present.
|
||||
//
|
||||
// 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
|
||||
|
||||
package bsonoptions
|
||||
|
||||
// ByteSliceCodecOptions represents all possible options for byte slice encoding and decoding.
|
||||
type ByteSliceCodecOptions struct {
|
||||
EncodeNilAsEmpty *bool // Specifies if a nil byte slice should encode as an empty binary instead of null. Defaults to false.
|
||||
}
|
||||
|
||||
// ByteSliceCodec creates a new *ByteSliceCodecOptions
|
||||
func ByteSliceCodec() *ByteSliceCodecOptions {
|
||||
return &ByteSliceCodecOptions{}
|
||||
}
|
||||
|
||||
// SetEncodeNilAsEmpty specifies if a nil byte slice should encode as an empty binary instead of null. Defaults to false.
|
||||
func (bs *ByteSliceCodecOptions) SetEncodeNilAsEmpty(b bool) *ByteSliceCodecOptions {
|
||||
bs.EncodeNilAsEmpty = &b
|
||||
return bs
|
||||
}
|
||||
|
||||
// MergeByteSliceCodecOptions combines the given *ByteSliceCodecOptions into a single *ByteSliceCodecOptions in a last one wins fashion.
|
||||
func MergeByteSliceCodecOptions(opts ...*ByteSliceCodecOptions) *ByteSliceCodecOptions {
|
||||
bs := ByteSliceCodec()
|
||||
for _, opt := range opts {
|
||||
if opt == nil {
|
||||
continue
|
||||
}
|
||||
if opt.EncodeNilAsEmpty != nil {
|
||||
bs.EncodeNilAsEmpty = opt.EncodeNilAsEmpty
|
||||
}
|
||||
}
|
||||
|
||||
return bs
|
||||
}
|
38
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/empty_interface_codec_options.go
generated
vendored
Normal file
38
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/empty_interface_codec_options.go
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright (C) MongoDB, Inc. 2017-present.
|
||||
//
|
||||
// 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
|
||||
|
||||
package bsonoptions
|
||||
|
||||
// EmptyInterfaceCodecOptions represents all possible options for interface{} encoding and decoding.
|
||||
type EmptyInterfaceCodecOptions struct {
|
||||
DecodeBinaryAsSlice *bool // Specifies if Old and Generic type binarys should default to []slice instead of primitive.Binary. Defaults to false.
|
||||
}
|
||||
|
||||
// EmptyInterfaceCodec creates a new *EmptyInterfaceCodecOptions
|
||||
func EmptyInterfaceCodec() *EmptyInterfaceCodecOptions {
|
||||
return &EmptyInterfaceCodecOptions{}
|
||||
}
|
||||
|
||||
// SetDecodeBinaryAsSlice specifies if Old and Generic type binarys should default to []slice instead of primitive.Binary. Defaults to false.
|
||||
func (e *EmptyInterfaceCodecOptions) SetDecodeBinaryAsSlice(b bool) *EmptyInterfaceCodecOptions {
|
||||
e.DecodeBinaryAsSlice = &b
|
||||
return e
|
||||
}
|
||||
|
||||
// MergeEmptyInterfaceCodecOptions combines the given *EmptyInterfaceCodecOptions into a single *EmptyInterfaceCodecOptions in a last one wins fashion.
|
||||
func MergeEmptyInterfaceCodecOptions(opts ...*EmptyInterfaceCodecOptions) *EmptyInterfaceCodecOptions {
|
||||
e := EmptyInterfaceCodec()
|
||||
for _, opt := range opts {
|
||||
if opt == nil {
|
||||
continue
|
||||
}
|
||||
if opt.DecodeBinaryAsSlice != nil {
|
||||
e.DecodeBinaryAsSlice = opt.DecodeBinaryAsSlice
|
||||
}
|
||||
}
|
||||
|
||||
return e
|
||||
}
|
48
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/map_codec_options.go
generated
vendored
Normal file
48
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/map_codec_options.go
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
// Copyright (C) MongoDB, Inc. 2017-present.
|
||||
//
|
||||
// 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
|
||||
|
||||
package bsonoptions
|
||||
|
||||
// MapCodecOptions represents all possible options for map encoding and decoding.
|
||||
type MapCodecOptions struct {
|
||||
DecodeZerosMap *bool // Specifies if the map should be zeroed before decoding into it. Defaults to false.
|
||||
EncodeNilAsEmpty *bool // Specifies if a nil map should encode as an empty document instead of null. Defaults to false.
|
||||
}
|
||||
|
||||
// MapCodec creates a new *MapCodecOptions
|
||||
func MapCodec() *MapCodecOptions {
|
||||
return &MapCodecOptions{}
|
||||
}
|
||||
|
||||
// SetDecodeZerosMap specifies if the map should be zeroed before decoding into it. Defaults to false.
|
||||
func (t *MapCodecOptions) SetDecodeZerosMap(b bool) *MapCodecOptions {
|
||||
t.DecodeZerosMap = &b
|
||||
return t
|
||||
}
|
||||
|
||||
// SetEncodeNilAsEmpty specifies if a nil map should encode as an empty document instead of null. Defaults to false.
|
||||
func (t *MapCodecOptions) SetEncodeNilAsEmpty(b bool) *MapCodecOptions {
|
||||
t.EncodeNilAsEmpty = &b
|
||||
return t
|
||||
}
|
||||
|
||||
// MergeMapCodecOptions combines the given *MapCodecOptions into a single *MapCodecOptions in a last one wins fashion.
|
||||
func MergeMapCodecOptions(opts ...*MapCodecOptions) *MapCodecOptions {
|
||||
s := MapCodec()
|
||||
for _, opt := range opts {
|
||||
if opt == nil {
|
||||
continue
|
||||
}
|
||||
if opt.DecodeZerosMap != nil {
|
||||
s.DecodeZerosMap = opt.DecodeZerosMap
|
||||
}
|
||||
if opt.EncodeNilAsEmpty != nil {
|
||||
s.EncodeNilAsEmpty = opt.EncodeNilAsEmpty
|
||||
}
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
38
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/slice_codec_options.go
generated
vendored
Normal file
38
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/slice_codec_options.go
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright (C) MongoDB, Inc. 2017-present.
|
||||
//
|
||||
// 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
|
||||
|
||||
package bsonoptions
|
||||
|
||||
// SliceCodecOptions represents all possible options for slice encoding and decoding.
|
||||
type SliceCodecOptions struct {
|
||||
EncodeNilAsEmpty *bool // Specifies if a nil slice should encode as an empty array instead of null. Defaults to false.
|
||||
}
|
||||
|
||||
// SliceCodec creates a new *SliceCodecOptions
|
||||
func SliceCodec() *SliceCodecOptions {
|
||||
return &SliceCodecOptions{}
|
||||
}
|
||||
|
||||
// SetEncodeNilAsEmpty specifies if a nil slice should encode as an empty array instead of null. Defaults to false.
|
||||
func (s *SliceCodecOptions) SetEncodeNilAsEmpty(b bool) *SliceCodecOptions {
|
||||
s.EncodeNilAsEmpty = &b
|
||||
return s
|
||||
}
|
||||
|
||||
// MergeSliceCodecOptions combines the given *SliceCodecOptions into a single *SliceCodecOptions in a last one wins fashion.
|
||||
func MergeSliceCodecOptions(opts ...*SliceCodecOptions) *SliceCodecOptions {
|
||||
s := SliceCodec()
|
||||
for _, opt := range opts {
|
||||
if opt == nil {
|
||||
continue
|
||||
}
|
||||
if opt.EncodeNilAsEmpty != nil {
|
||||
s.EncodeNilAsEmpty = opt.EncodeNilAsEmpty
|
||||
}
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
41
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go
generated
vendored
Normal file
41
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright (C) MongoDB, Inc. 2017-present.
|
||||
//
|
||||
// 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
|
||||
|
||||
package bsonoptions
|
||||
|
||||
var defaultDecodeOIDAsHex = true
|
||||
|
||||
// StringCodecOptions represents all possible options for string encoding and decoding.
|
||||
type StringCodecOptions struct {
|
||||
DecodeObjectIDAsHex *bool // Specifies if we should decode ObjectID as the hex value. Defaults to true.
|
||||
}
|
||||
|
||||
// StringCodec creates a new *StringCodecOptions
|
||||
func StringCodec() *StringCodecOptions {
|
||||
return &StringCodecOptions{}
|
||||
}
|
||||
|
||||
// SetDecodeObjectIDAsHex specifies if object IDs should be decoded as their hex representation. If false, a string made
|
||||
// from the raw object ID bytes will be used. Defaults to true.
|
||||
func (t *StringCodecOptions) SetDecodeObjectIDAsHex(b bool) *StringCodecOptions {
|
||||
t.DecodeObjectIDAsHex = &b
|
||||
return t
|
||||
}
|
||||
|
||||
// MergeStringCodecOptions combines the given *StringCodecOptions into a single *StringCodecOptions in a last one wins fashion.
|
||||
func MergeStringCodecOptions(opts ...*StringCodecOptions) *StringCodecOptions {
|
||||
s := &StringCodecOptions{&defaultDecodeOIDAsHex}
|
||||
for _, opt := range opts {
|
||||
if opt == nil {
|
||||
continue
|
||||
}
|
||||
if opt.DecodeObjectIDAsHex != nil {
|
||||
s.DecodeObjectIDAsHex = opt.DecodeObjectIDAsHex
|
||||
}
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
70
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/struct_codec_options.go
generated
vendored
Normal file
70
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/struct_codec_options.go
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
// Copyright (C) MongoDB, Inc. 2017-present.
|
||||
//
|
||||
// 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
|
||||
|
||||
package bsonoptions
|
||||
|
||||
// StructCodecOptions represents all possible options for struct encoding and decoding.
|
||||
type StructCodecOptions struct {
|
||||
DecodeZeroStruct *bool // Specifies if structs should be zeroed before decoding into them. Defaults to false.
|
||||
DecodeDeepZeroInline *bool // Specifies if structs should be recursively zeroed when a inline value is decoded. Defaults to false.
|
||||
EncodeOmitDefaultStruct *bool // Specifies if default structs should be considered empty by omitempty. Defaults to false.
|
||||
AllowUnexportedFields *bool // Specifies if unexported fields should be marshaled/unmarshaled. Defaults to false.
|
||||
}
|
||||
|
||||
// StructCodec creates a new *StructCodecOptions
|
||||
func StructCodec() *StructCodecOptions {
|
||||
return &StructCodecOptions{}
|
||||
}
|
||||
|
||||
// SetDecodeZeroStruct specifies if structs should be zeroed before decoding into them. Defaults to false.
|
||||
func (t *StructCodecOptions) SetDecodeZeroStruct(b bool) *StructCodecOptions {
|
||||
t.DecodeZeroStruct = &b
|
||||
return t
|
||||
}
|
||||
|
||||
// SetDecodeDeepZeroInline specifies if structs should be zeroed before decoding into them. Defaults to false.
|
||||
func (t *StructCodecOptions) SetDecodeDeepZeroInline(b bool) *StructCodecOptions {
|
||||
t.DecodeDeepZeroInline = &b
|
||||
return t
|
||||
}
|
||||
|
||||
// SetEncodeOmitDefaultStruct specifies if default structs should be considered empty by omitempty. A default struct has all
|
||||
// its values set to their default value. Defaults to false.
|
||||
func (t *StructCodecOptions) SetEncodeOmitDefaultStruct(b bool) *StructCodecOptions {
|
||||
t.EncodeOmitDefaultStruct = &b
|
||||
return t
|
||||
}
|
||||
|
||||
// SetAllowUnexportedFields specifies if unexported fields should be marshaled/unmarshaled. Defaults to false.
|
||||
func (t *StructCodecOptions) SetAllowUnexportedFields(b bool) *StructCodecOptions {
|
||||
t.AllowUnexportedFields = &b
|
||||
return t
|
||||
}
|
||||
|
||||
// MergeStructCodecOptions combines the given *StructCodecOptions into a single *StructCodecOptions in a last one wins fashion.
|
||||
func MergeStructCodecOptions(opts ...*StructCodecOptions) *StructCodecOptions {
|
||||
s := StructCodec()
|
||||
for _, opt := range opts {
|
||||
if opt == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if opt.DecodeZeroStruct != nil {
|
||||
s.DecodeZeroStruct = opt.DecodeZeroStruct
|
||||
}
|
||||
if opt.DecodeDeepZeroInline != nil {
|
||||
s.DecodeDeepZeroInline = opt.DecodeDeepZeroInline
|
||||
}
|
||||
if opt.EncodeOmitDefaultStruct != nil {
|
||||
s.EncodeOmitDefaultStruct = opt.EncodeOmitDefaultStruct
|
||||
}
|
||||
if opt.AllowUnexportedFields != nil {
|
||||
s.AllowUnexportedFields = opt.AllowUnexportedFields
|
||||
}
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
38
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/time_codec_options.go
generated
vendored
Normal file
38
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/time_codec_options.go
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright (C) MongoDB, Inc. 2017-present.
|
||||
//
|
||||
// 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
|
||||
|
||||
package bsonoptions
|
||||
|
||||
// TimeCodecOptions represents all possible options for time.Time encoding and decoding.
|
||||
type TimeCodecOptions struct {
|
||||
UseLocalTimeZone *bool // Specifies if we should decode into the local time zone. Defaults to false.
|
||||
}
|
||||
|
||||
// TimeCodec creates a new *TimeCodecOptions
|
||||
func TimeCodec() *TimeCodecOptions {
|
||||
return &TimeCodecOptions{}
|
||||
}
|
||||
|
||||
// SetUseLocalTimeZone specifies if we should decode into the local time zone. Defaults to false.
|
||||
func (t *TimeCodecOptions) SetUseLocalTimeZone(b bool) *TimeCodecOptions {
|
||||
t.UseLocalTimeZone = &b
|
||||
return t
|
||||
}
|
||||
|
||||
// MergeTimeCodecOptions combines the given *TimeCodecOptions into a single *TimeCodecOptions in a last one wins fashion.
|
||||
func MergeTimeCodecOptions(opts ...*TimeCodecOptions) *TimeCodecOptions {
|
||||
t := TimeCodec()
|
||||
for _, opt := range opts {
|
||||
if opt == nil {
|
||||
continue
|
||||
}
|
||||
if opt.UseLocalTimeZone != nil {
|
||||
t.UseLocalTimeZone = opt.UseLocalTimeZone
|
||||
}
|
||||
}
|
||||
|
||||
return t
|
||||
}
|
38
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/uint_codec_options.go
generated
vendored
Normal file
38
vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/uint_codec_options.go
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright (C) MongoDB, Inc. 2017-present.
|
||||
//
|
||||
// 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
|
||||
|
||||
package bsonoptions
|
||||
|
||||
// UIntCodecOptions represents all possible options for uint encoding and decoding.
|
||||
type UIntCodecOptions struct {
|
||||
EncodeToMinSize *bool // Specifies if all uints except uint64 should be decoded to minimum size bsontype. Defaults to false.
|
||||
}
|
||||
|
||||
// UIntCodec creates a new *UIntCodecOptions
|
||||
func UIntCodec() *UIntCodecOptions {
|
||||
return &UIntCodecOptions{}
|
||||
}
|
||||
|
||||
// SetEncodeToMinSize specifies if all uints except uint64 should be decoded to minimum size bsontype. Defaults to false.
|
||||
func (u *UIntCodecOptions) SetEncodeToMinSize(b bool) *UIntCodecOptions {
|
||||
u.EncodeToMinSize = &b
|
||||
return u
|
||||
}
|
||||
|
||||
// MergeUIntCodecOptions combines the given *UIntCodecOptions into a single *UIntCodecOptions in a last one wins fashion.
|
||||
func MergeUIntCodecOptions(opts ...*UIntCodecOptions) *UIntCodecOptions {
|
||||
u := UIntCodec()
|
||||
for _, opt := range opts {
|
||||
if opt == nil {
|
||||
continue
|
||||
}
|
||||
if opt.EncodeToMinSize != nil {
|
||||
u.EncodeToMinSize = opt.EncodeToMinSize
|
||||
}
|
||||
}
|
||||
|
||||
return u
|
||||
}
|
Reference in New Issue
Block a user