Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for sortIPs (0.16 sec)

  1. cmd/net.go

    	}
    
    	return ipList, err
    }
    
    // sortIPs - sort ips based on higher octets.
    // The logic to sort by last octet is implemented to
    // prefer CIDRs with higher octets, this in-turn skips the
    // localhost/loopback address to be not preferred as the
    // first ip on the list. Subsequently this list helps us print
    // a user friendly message with appropriate values.
    func sortIPs(ipList []string) []string {
    	if len(ipList) == 1 {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Mar 26 15:00:38 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  2. cmd/net_test.go

    		{
    			ipList:       []string{"127.0.0.1", "10.0.0.1", "192.168.0.1"},
    			sortedIPList: []string{"10.0.0.1", "192.168.0.1", "127.0.0.1"},
    		},
    	}
    	for i, testCase := range testCases {
    		gotIPList := sortIPs(testCase.ipList)
    		if !reflect.DeepEqual(testCase.sortedIPList, gotIPList) {
    			t.Errorf("Test %d: Expected %s, got %s", i+1, testCase.sortedIPList, gotIPList)
    		}
    	}
    }
    
    func TestMustGetLocalIP4(t *testing.T) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 19 08:43:09 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  3. cmd/erasure-server-pool-decom.go

    			},
    			NoAuditLog: true,
    		})
    	if err != nil {
    		err = fmt.Errorf("decommissionObject: PutObject() %w", err)
    	}
    	return err
    }
    
    // versionsSorter sorts FileInfo slices by version.
    //
    //msgp:ignore versionsSorter
    type versionsSorter []FileInfo
    
    func (v versionsSorter) reverse() {
    	sort.Slice(v, func(i, j int) bool {
    		return v[i].ModTime.Before(v[j].ModTime)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 15:18:21 GMT 2024
    - 41.5K bytes
    - Viewed (1)
  4. cmd/endpoint.go

    				u := &url.URL{
    					Scheme: endpoint.Scheme,
    					Host:   endpoint.Host,
    				}
    				return u.String()
    			}
    		}
    	}
    	host := globalMinioHost
    	if host == "" {
    		host = sortIPs(localIP4.ToSlice())[0]
    	}
    	return fmt.Sprintf("%s://%s", getURLScheme(globalIsTLS), net.JoinHostPort(host, globalMinioPort))
    }
    
    // LocalDisksPaths returns the disk paths of the local disks
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 21 11:43:18 GMT 2024
    - 34.1K bytes
    - Viewed (0)
  5. internal/kms/context.go

    // generated DEK such that the same context must be
    // provided when decrypting an encrypted DEK.
    type Context map[string]string
    
    // MarshalText returns a canonical text representation of
    // the Context.
    
    // MarshalText sorts the context keys and writes the sorted
    // key-value pairs as canonical JSON object. The sort order
    // is based on the un-escaped keys. It never returns an error.
    func (c Context) MarshalText() ([]byte, error) {
    	if len(c) == 0 {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 6K bytes
    - Viewed (0)
Back to top