This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
4,040 additions
and
2,910 deletions.
There are no files selected for viewing
3 changes: 0 additions & 3 deletions
3
github.com/Azure/azure-storage-blob-go/2017-07-29/azblob/version.go
This file was deleted.
Oops, something went wrong.
132 changes: 65 additions & 67 deletions
132
...go/2017-07-29/azblob/access_conditions.go → ...orage-blob-go/azblob/access_conditions.go
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,65 @@ | ||
package azblob | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
// HTTPAccessConditions identifies standard HTTP access conditions which you optionally set. | ||
type HTTPAccessConditions struct { | ||
IfModifiedSince time.Time | ||
IfUnmodifiedSince time.Time | ||
IfMatch ETag | ||
IfNoneMatch ETag | ||
} | ||
|
||
// pointers is for internal infrastructure. It returns the fields as pointers. | ||
func (ac HTTPAccessConditions) pointers() (ims *time.Time, ius *time.Time, ime *ETag, inme *ETag) { | ||
if !ac.IfModifiedSince.IsZero() { | ||
ims = &ac.IfModifiedSince | ||
} | ||
if !ac.IfUnmodifiedSince.IsZero() { | ||
ius = &ac.IfUnmodifiedSince | ||
} | ||
if ac.IfMatch != ETagNone { | ||
ime = &ac.IfMatch | ||
} | ||
if ac.IfNoneMatch != ETagNone { | ||
inme = &ac.IfNoneMatch | ||
} | ||
return | ||
} | ||
|
||
// ContainerAccessConditions identifies container-specific access conditions which you optionally set. | ||
type ContainerAccessConditions struct { | ||
HTTPAccessConditions | ||
LeaseAccessConditions | ||
} | ||
|
||
// BlobAccessConditions identifies blob-specific access conditions which you optionally set. | ||
type BlobAccessConditions struct { | ||
HTTPAccessConditions | ||
LeaseAccessConditions | ||
AppendBlobAccessConditions | ||
PageBlobAccessConditions | ||
} | ||
|
||
// LeaseAccessConditions identifies lease access conditions for a container or blob which you optionally set. | ||
type LeaseAccessConditions struct { | ||
LeaseID string | ||
} | ||
|
||
// pointers is for internal infrastructure. It returns the fields as pointers. | ||
func (ac LeaseAccessConditions) pointers() (leaseID *string) { | ||
if ac.LeaseID != "" { | ||
leaseID = &ac.LeaseID | ||
} | ||
return | ||
} | ||
|
||
/* | ||
// getInt32 is for internal infrastructure. It is used with access condition values where | ||
// 0 (the default setting) is meaningful. The library interprets 0 as do not send the header | ||
// and the privately-storage field in the access condition object is stored as +1 higher than desired. | ||
// THis method returns true, if the value is > 0 (explicitly set) and the stored value - 1 (the set desired value). | ||
func getInt32(value int32) (bool, int32) { | ||
return value > 0, value - 1 | ||
} | ||
*/ | ||
package azblob | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
// ModifiedAccessConditions identifies standard HTTP access conditions which you optionally set. | ||
type ModifiedAccessConditions struct { | ||
IfModifiedSince time.Time | ||
IfUnmodifiedSince time.Time | ||
IfMatch ETag | ||
IfNoneMatch ETag | ||
} | ||
|
||
// pointers is for internal infrastructure. It returns the fields as pointers. | ||
func (ac ModifiedAccessConditions) pointers() (ims *time.Time, ius *time.Time, ime *ETag, inme *ETag) { | ||
if !ac.IfModifiedSince.IsZero() { | ||
ims = &ac.IfModifiedSince | ||
} | ||
if !ac.IfUnmodifiedSince.IsZero() { | ||
ius = &ac.IfUnmodifiedSince | ||
} | ||
if ac.IfMatch != ETagNone { | ||
ime = &ac.IfMatch | ||
} | ||
if ac.IfNoneMatch != ETagNone { | ||
inme = &ac.IfNoneMatch | ||
} | ||
return | ||
} | ||
|
||
// ContainerAccessConditions identifies container-specific access conditions which you optionally set. | ||
type ContainerAccessConditions struct { | ||
ModifiedAccessConditions | ||
LeaseAccessConditions | ||
} | ||
|
||
// BlobAccessConditions identifies blob-specific access conditions which you optionally set. | ||
type BlobAccessConditions struct { | ||
ModifiedAccessConditions | ||
LeaseAccessConditions | ||
} | ||
|
||
// LeaseAccessConditions identifies lease access conditions for a container or blob which you optionally set. | ||
type LeaseAccessConditions struct { | ||
LeaseID string | ||
} | ||
|
||
// pointers is for internal infrastructure. It returns the fields as pointers. | ||
func (ac LeaseAccessConditions) pointers() (leaseID *string) { | ||
if ac.LeaseID != "" { | ||
leaseID = &ac.LeaseID | ||
} | ||
return | ||
} | ||
|
||
/* | ||
// getInt32 is for internal infrastructure. It is used with access condition values where | ||
// 0 (the default setting) is meaningful. The library interprets 0 as do not send the header | ||
// and the privately-storage field in the access condition object is stored as +1 higher than desired. | ||
// THis method returns true, if the value is > 0 (explicitly set) and the stored value - 1 (the set desired value). | ||
func getInt32(value int32) (bool, int32) { | ||
return value > 0, value - 1 | ||
} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.