Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for parseRetMode (0.21 sec)

  1. internal/bucket/object/lock/lock.go

    )
    
    // Valid - returns if retention mode is valid
    func (r RetMode) Valid() bool {
    	switch r {
    	case RetGovernance, RetCompliance:
    		return true
    	}
    	return false
    }
    
    func parseRetMode(modeStr string) (mode RetMode) {
    	switch strings.ToUpper(modeStr) {
    	case "GOVERNANCE":
    		mode = RetGovernance
    	case "COMPLIANCE":
    		mode = RetCompliance
    	}
    	return mode
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 17.1K bytes
    - Viewed (0)
  2. internal/bucket/object/lock/lock_test.go

    			expectedMode: RetCompliance,
    		},
    		{
    			value:        "gce",
    			expectedMode: "",
    		},
    	}
    
    	for _, tc := range testCases {
    		if parseRetMode(tc.value) != tc.expectedMode {
    			t.Errorf("Expected Mode %s, got %s", tc.expectedMode, parseRetMode(tc.value))
    		}
    	}
    }
    
    func TestParseLegalHoldStatus(t *testing.T) {
    	tests := []struct {
    		value          string
    		expectedStatus LegalHoldStatus
    	}{
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 17.1K bytes
    - Viewed (0)
Back to top