feat: kubesphere 4.0 (#6115)
* feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> * feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> --------- Signed-off-by: ci-bot <ci-bot@kubesphere.io> Co-authored-by: ks-ci-bot <ks-ci-bot@example.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
committed by
GitHub
parent
b5015ec7b9
commit
447a51f08b
9
vendor/github.com/emirpasic/gods/lists/arraylist/arraylist.go
generated
vendored
9
vendor/github.com/emirpasic/gods/lists/arraylist/arraylist.go
generated
vendored
@@ -17,9 +17,8 @@ import (
|
||||
"github.com/emirpasic/gods/utils"
|
||||
)
|
||||
|
||||
func assertListImplementation() {
|
||||
var _ lists.List = (*List)(nil)
|
||||
}
|
||||
// Assert List implementation
|
||||
var _ lists.List = (*List)(nil)
|
||||
|
||||
// List holds the elements in a slice
|
||||
type List struct {
|
||||
@@ -83,8 +82,8 @@ func (list *List) Contains(values ...interface{}) bool {
|
||||
|
||||
for _, searchValue := range values {
|
||||
found := false
|
||||
for _, element := range list.elements {
|
||||
if element == searchValue {
|
||||
for index := 0; index < list.size; index++ {
|
||||
if list.elements[index] == searchValue {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
|
||||
5
vendor/github.com/emirpasic/gods/lists/arraylist/enumerable.go
generated
vendored
5
vendor/github.com/emirpasic/gods/lists/arraylist/enumerable.go
generated
vendored
@@ -6,9 +6,8 @@ package arraylist
|
||||
|
||||
import "github.com/emirpasic/gods/containers"
|
||||
|
||||
func assertEnumerableImplementation() {
|
||||
var _ containers.EnumerableWithIndex = (*List)(nil)
|
||||
}
|
||||
// Assert Enumerable implementation
|
||||
var _ containers.EnumerableWithIndex = (*List)(nil)
|
||||
|
||||
// Each calls the given function once for each element, passing that element's index and value.
|
||||
func (list *List) Each(f func(index int, value interface{})) {
|
||||
|
||||
33
vendor/github.com/emirpasic/gods/lists/arraylist/iterator.go
generated
vendored
33
vendor/github.com/emirpasic/gods/lists/arraylist/iterator.go
generated
vendored
@@ -6,9 +6,8 @@ package arraylist
|
||||
|
||||
import "github.com/emirpasic/gods/containers"
|
||||
|
||||
func assertIteratorImplementation() {
|
||||
var _ containers.ReverseIteratorWithIndex = (*Iterator)(nil)
|
||||
}
|
||||
// Assert Iterator implementation
|
||||
var _ containers.ReverseIteratorWithIndex = (*Iterator)(nil)
|
||||
|
||||
// Iterator holding the iterator's state
|
||||
type Iterator struct {
|
||||
@@ -81,3 +80,31 @@ func (iterator *Iterator) Last() bool {
|
||||
iterator.End()
|
||||
return iterator.Prev()
|
||||
}
|
||||
|
||||
// NextTo moves the iterator to the next element from current position that satisfies the condition given by the
|
||||
// passed function, and returns true if there was a next element in the container.
|
||||
// If NextTo() returns true, then next element's index and value can be retrieved by Index() and Value().
|
||||
// Modifies the state of the iterator.
|
||||
func (iterator *Iterator) NextTo(f func(index int, value interface{}) bool) bool {
|
||||
for iterator.Next() {
|
||||
index, value := iterator.Index(), iterator.Value()
|
||||
if f(index, value) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// PrevTo moves the iterator to the previous element from current position that satisfies the condition given by the
|
||||
// passed function, and returns true if there was a next element in the container.
|
||||
// If PrevTo() returns true, then next element's index and value can be retrieved by Index() and Value().
|
||||
// Modifies the state of the iterator.
|
||||
func (iterator *Iterator) PrevTo(f func(index int, value interface{}) bool) bool {
|
||||
for iterator.Prev() {
|
||||
index, value := iterator.Index(), iterator.Value()
|
||||
if f(index, value) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
17
vendor/github.com/emirpasic/gods/lists/arraylist/serialization.go
generated
vendored
17
vendor/github.com/emirpasic/gods/lists/arraylist/serialization.go
generated
vendored
@@ -9,10 +9,9 @@ import (
|
||||
"github.com/emirpasic/gods/containers"
|
||||
)
|
||||
|
||||
func assertSerializationImplementation() {
|
||||
var _ containers.JSONSerializer = (*List)(nil)
|
||||
var _ containers.JSONDeserializer = (*List)(nil)
|
||||
}
|
||||
// Assert Serialization implementation
|
||||
var _ containers.JSONSerializer = (*List)(nil)
|
||||
var _ containers.JSONDeserializer = (*List)(nil)
|
||||
|
||||
// ToJSON outputs the JSON representation of list's elements.
|
||||
func (list *List) ToJSON() ([]byte, error) {
|
||||
@@ -27,3 +26,13 @@ func (list *List) FromJSON(data []byte) error {
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// UnmarshalJSON @implements json.Unmarshaler
|
||||
func (list *List) UnmarshalJSON(bytes []byte) error {
|
||||
return list.FromJSON(bytes)
|
||||
}
|
||||
|
||||
// MarshalJSON @implements json.Marshaler
|
||||
func (list *List) MarshalJSON() ([]byte, error) {
|
||||
return list.ToJSON()
|
||||
}
|
||||
|
||||
1
vendor/github.com/emirpasic/gods/lists/lists.go
generated
vendored
1
vendor/github.com/emirpasic/gods/lists/lists.go
generated
vendored
@@ -30,4 +30,5 @@ type List interface {
|
||||
// Size() int
|
||||
// Clear()
|
||||
// Values() []interface{}
|
||||
// String() string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user