|
7 | 7 | package exported |
8 | 8 |
|
9 | 9 | import ( |
10 | | - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" |
11 | | - "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated" |
12 | 10 | "net/http" |
13 | 11 | "strconv" |
14 | 12 | "time" |
| 13 | + |
| 14 | + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" |
| 15 | + "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated" |
15 | 16 | ) |
16 | 17 |
|
17 | 18 | // ExpiryType defines values for ExpiryType |
18 | 19 | type ExpiryType interface { |
19 | 20 | Format(o *SetExpiryOptions) (generated.ExpiryOptions, *generated.BlobClientSetExpiryOptions) |
| 21 | + notPubliclyImplementable() |
20 | 22 | } |
21 | 23 |
|
22 | 24 | // ExpiryTypeAbsolute defines the absolute time for the blob expiry |
@@ -44,18 +46,26 @@ func (e ExpiryTypeAbsolute) Format(o *SetExpiryOptions) (generated.ExpiryOptions |
44 | 46 | } |
45 | 47 | } |
46 | 48 |
|
| 49 | +func (e ExpiryTypeAbsolute) notPubliclyImplementable() {} |
| 50 | + |
47 | 51 | func (e ExpiryTypeRelativeToNow) Format(o *SetExpiryOptions) (generated.ExpiryOptions, *generated.BlobClientSetExpiryOptions) { |
48 | 52 | return generated.ExpiryOptionsRelativeToNow, &generated.BlobClientSetExpiryOptions{ |
49 | 53 | ExpiresOn: to.Ptr(strconv.FormatInt(time.Duration(e).Milliseconds(), 10)), |
50 | 54 | } |
51 | 55 | } |
52 | 56 |
|
| 57 | +func (e ExpiryTypeRelativeToNow) notPubliclyImplementable() {} |
| 58 | + |
53 | 59 | func (e ExpiryTypeRelativeToCreation) Format(o *SetExpiryOptions) (generated.ExpiryOptions, *generated.BlobClientSetExpiryOptions) { |
54 | 60 | return generated.ExpiryOptionsRelativeToCreation, &generated.BlobClientSetExpiryOptions{ |
55 | 61 | ExpiresOn: to.Ptr(strconv.FormatInt(time.Duration(e).Milliseconds(), 10)), |
56 | 62 | } |
57 | 63 | } |
58 | 64 |
|
| 65 | +func (e ExpiryTypeRelativeToCreation) notPubliclyImplementable() {} |
| 66 | + |
59 | 67 | func (e ExpiryTypeNever) Format(o *SetExpiryOptions) (generated.ExpiryOptions, *generated.BlobClientSetExpiryOptions) { |
60 | 68 | return generated.ExpiryOptionsNeverExpire, nil |
61 | 69 | } |
| 70 | + |
| 71 | +func (e ExpiryTypeNever) notPubliclyImplementable() {} |
0 commit comments