| @@ -23,7 +23,7 @@ func (b *Bitmap64) Weight() int { | |||||
| cnt := 0 | cnt := 0 | ||||
| for v > 0 { | for v > 0 { | ||||
| cnt++ | cnt++ | ||||
| v &= (v - 1) | |||||
| v &= v - 1 | |||||
| } | } | ||||
| return cnt | return cnt | ||||
| } | } | ||||
| @@ -98,7 +98,7 @@ func (s *VarSlots[T]) Clear(val *T) { | |||||
| } | } | ||||
| func (s *VarSlots[T]) RemoveAt(idx int) { | func (s *VarSlots[T]) RemoveAt(idx int) { | ||||
| (*s) = lo2.RemoveAt(*s, idx) | |||||
| *s = lo2.RemoveAt(*s, idx) | |||||
| } | } | ||||
| func (s *VarSlots[T]) RemoveRange(start int, cnt int) { | func (s *VarSlots[T]) RemoveRange(start int, cnt int) { | ||||
| @@ -87,28 +87,28 @@ func (s *DstList) Get(idx int) Node { | |||||
| } | } | ||||
| func (s *DstList) Add(n Node) int { | func (s *DstList) Add(n Node) int { | ||||
| (*s) = append((*s), n) | |||||
| *s = append(*s, n) | |||||
| return len(*s) - 1 | return len(*s) - 1 | ||||
| } | } | ||||
| func (s *DstList) Remove(n Node) { | func (s *DstList) Remove(n Node) { | ||||
| for i, e := range *s { | for i, e := range *s { | ||||
| if e == n { | if e == n { | ||||
| (*s) = lo2.RemoveAt((*s), i) | |||||
| *s = lo2.RemoveAt(*s, i) | |||||
| return | return | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| func (s *DstList) RemoveAt(idx int) { | func (s *DstList) RemoveAt(idx int) { | ||||
| lo2.RemoveAt((*s), idx) | |||||
| lo2.RemoveAt(*s, idx) | |||||
| } | } | ||||
| func (s *DstList) Resize(size int) { | func (s *DstList) Resize(size int) { | ||||
| if s.Len() < size { | if s.Len() < size { | ||||
| (*s) = append((*s), make([]Node, size-s.Len())...) | |||||
| *s = append(*s, make([]Node, size-s.Len())...) | |||||
| } else if s.Len() > size { | } else if s.Len() > size { | ||||
| (*s) = (*s)[:size] | |||||
| *s = (*s)[:size] | |||||
| } | } | ||||
| } | } | ||||
| @@ -44,6 +44,9 @@ const ( | |||||
| PreferencePriority = "preference" | PreferencePriority = "preference" | ||||
| SpecifyClusterPriority = "specify" | SpecifyClusterPriority = "specify" | ||||
| FailedStatus = "failed" | |||||
| SuccessStatus = "success" | |||||
| ) | ) | ||||
| type TaskID int64 | type TaskID int64 | ||||
| @@ -253,6 +256,11 @@ type BiasPriority struct { | |||||
| Options []string `json:"options"` | Options []string `json:"options"` | ||||
| } | } | ||||
| type TaskMessage struct { | |||||
| Status string `json:"status"` | |||||
| Message string `json:"message"` | |||||
| } | |||||
| type UploadParams struct { | type UploadParams struct { | ||||
| DataType string `json:"dataType"` | DataType string `json:"dataType"` | ||||
| UploadInfo UploadInfo `json:"uploadInfo"` | UploadInfo UploadInfo `json:"uploadInfo"` | ||||
| @@ -406,6 +414,11 @@ type ClusterImage struct { | |||||
| CardType string `json:"cardType"` | CardType string `json:"cardType"` | ||||
| } | } | ||||
| type QueryBindingFilters struct { | |||||
| Status string `json:"status"` | |||||
| Name string `json:"name"` | |||||
| } | |||||
| type QueryBindingDataParam interface { | type QueryBindingDataParam interface { | ||||
| Noop() | Noop() | ||||
| } | } | ||||
| @@ -32,7 +32,7 @@ func ChunkedSplit(stream io.Reader, chunkSize int, streamCount int, opts ...Chun | |||||
| loop: | loop: | ||||
| for { | for { | ||||
| for i := 0; i < streamCount; i++ { | for i := 0; i < streamCount; i++ { | ||||
| var rd int = 0 | |||||
| var rd = 0 | |||||
| if !eof { | if !eof { | ||||
| var err error | var err error | ||||
| rd, err = io.ReadFull(stream, buf) | rd, err = io.ReadFull(stream, buf) | ||||
| @@ -591,7 +591,7 @@ func Test_ObjectToJSON2(t *testing.T) { | |||||
| union := types.NewTypeUnion[Base](&St1{}, St2{}) | union := types.NewTypeUnion[Base](&St1{}, St2{}) | ||||
| UseTypeUnionExternallyTagged(&union) | UseTypeUnionExternallyTagged(&union) | ||||
| var val []Base = []Base{ | |||||
| var val = []Base{ | |||||
| &St1{Val: "asd", Type: "St1"}, | &St1{Val: "asd", Type: "St1"}, | ||||
| St2{Val: 123, Type: "St2"}, | St2{Val: 123, Type: "St2"}, | ||||
| } | } | ||||
| @@ -607,7 +607,7 @@ func Test_ObjectToJSON2(t *testing.T) { | |||||
| union := types.NewTypeUnion[Base](&St1{}, St2{}) | union := types.NewTypeUnion[Base](&St1{}, St2{}) | ||||
| UseTypeUnionInternallyTagged(&union, "Type") | UseTypeUnionInternallyTagged(&union, "Type") | ||||
| var val []Base = []Base{ | |||||
| var val = []Base{ | |||||
| &St1{Val: "asd", Type: "St1"}, | &St1{Val: "asd", Type: "St1"}, | ||||
| St2{Val: 123, Type: "St2"}, | St2{Val: 123, Type: "St2"}, | ||||
| } | } | ||||
| @@ -623,7 +623,7 @@ func Test_ObjectToJSON2(t *testing.T) { | |||||
| union := types.NewTypeUnion[Base](&St1{}, St2{}) | union := types.NewTypeUnion[Base](&St1{}, St2{}) | ||||
| UseTypeUnionExternallyTagged(&union) | UseTypeUnionExternallyTagged(&union) | ||||
| var val []Base = []Base{ | |||||
| var val = []Base{ | |||||
| nil, | nil, | ||||
| } | } | ||||
| data, err := ObjectToJSONEx(val) | data, err := ObjectToJSONEx(val) | ||||
| @@ -638,7 +638,7 @@ func Test_ObjectToJSON2(t *testing.T) { | |||||
| union := types.NewTypeUnion[Base](&St1{}, St2{}) | union := types.NewTypeUnion[Base](&St1{}, St2{}) | ||||
| UseTypeUnionInternallyTagged(&union, "Type") | UseTypeUnionInternallyTagged(&union, "Type") | ||||
| var val []Base = []Base{ | |||||
| var val = []Base{ | |||||
| nil, | nil, | ||||
| } | } | ||||
| data, err := ObjectToJSONEx(val) | data, err := ObjectToJSONEx(val) | ||||