Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ParseObjectRetention (0.15 sec)

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

    	RetainUntilDate RetentionDate `xml:"RetainUntilDate,omitempty"`
    }
    
    // Maximum 4KiB size per object retention config.
    const maxObjectRetentionSize = 1 << 12
    
    // ParseObjectRetention constructs ObjectRetention struct from xml input
    func ParseObjectRetention(reader io.Reader) (*ObjectRetention, error) {
    	ret := ObjectRetention{}
    	if err := xml.NewDecoder(io.LimitReader(reader, maxObjectRetentionSize)).Decode(&ret); err != nil {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Jun 29 01:20:27 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  2. internal/bucket/object/lock/lock_test.go

    			expectedErr: nil,
    			expectErr:   false,
    		},
    	}
    	for _, tt := range tests {
    		tt := tt
    		t.Run("", func(t *testing.T) {
    			_, err := ParseObjectRetention(strings.NewReader(tt.value))
    			//nolint:gocritic
    			if tt.expectedErr == nil {
    				if err != nil {
    					t.Fatalf("error: expected = <nil>, got = %v", err)
    				}
    			} else if err == nil {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Jun 29 01:20:27 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  3. cmd/object-handlers.go

    		writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrInvalidBucketObjectLockConfiguration), r.URL)
    		return
    	}
    
    	objRetention, err := objectlock.ParseObjectRetention(r.Body)
    	if err != nil {
    		apiErr := errorCodes.ToAPIErr(ErrMalformedXML)
    		apiErr.Description = err.Error()
    		writeErrorResponse(ctx, w, apiErr, r.URL)
    		return
    	}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Oct 05 05:16:15 UTC 2024
    - 117.4K bytes
    - Viewed (0)
Back to top