mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-11-03 09:40:55 +08:00
chore: upgrade go mod library
This commit is contained in:
13
vendor/github.com/docker/cli/opts/ulimit.go
generated
vendored
13
vendor/github.com/docker/cli/opts/ulimit.go
generated
vendored
@@ -4,24 +4,27 @@ import (
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/go-units"
|
||||
)
|
||||
|
||||
// UlimitOpt defines a map of Ulimits
|
||||
type UlimitOpt struct {
|
||||
values *map[string]*units.Ulimit
|
||||
values *map[string]*container.Ulimit
|
||||
}
|
||||
|
||||
// NewUlimitOpt creates a new UlimitOpt. Ulimits are not validated.
|
||||
func NewUlimitOpt(ref *map[string]*units.Ulimit) *UlimitOpt {
|
||||
func NewUlimitOpt(ref *map[string]*container.Ulimit) *UlimitOpt {
|
||||
// TODO(thaJeztah): why do we need a map with pointers here?
|
||||
if ref == nil {
|
||||
ref = &map[string]*units.Ulimit{}
|
||||
ref = &map[string]*container.Ulimit{}
|
||||
}
|
||||
return &UlimitOpt{ref}
|
||||
}
|
||||
|
||||
// Set validates a Ulimit and sets its name as a key in UlimitOpt
|
||||
func (o *UlimitOpt) Set(val string) error {
|
||||
// FIXME(thaJeztah): these functions also need to be moved over from go-units.
|
||||
l, err := units.ParseUlimit(val)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -43,8 +46,8 @@ func (o *UlimitOpt) String() string {
|
||||
}
|
||||
|
||||
// GetList returns a slice of pointers to Ulimits. Values are sorted by name.
|
||||
func (o *UlimitOpt) GetList() []*units.Ulimit {
|
||||
ulimits := make([]*units.Ulimit, 0, len(*o.values))
|
||||
func (o *UlimitOpt) GetList() []*container.Ulimit {
|
||||
ulimits := make([]*container.Ulimit, 0, len(*o.values))
|
||||
for _, v := range *o.values {
|
||||
ulimits = append(ulimits, v)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user