Generated mostly functioning protocol layer. Some list containers tests are failing.
This commit is contained in:
Родитель
18c51cdded
Коммит
1b4a7c2a02
|
@ -24,8 +24,8 @@ type anonymousCredentialPolicyFactory struct {
|
|||
}
|
||||
|
||||
// New creates a credential policy object.
|
||||
func (f *anonymousCredentialPolicyFactory) New(node pipeline.Node) pipeline.Policy {
|
||||
return &anonymousCredentialPolicy{node: node}
|
||||
func (f *anonymousCredentialPolicyFactory) New(next pipeline.Policy, config *pipeline.Configuration) pipeline.Policy {
|
||||
return &anonymousCredentialPolicy{next: next}
|
||||
}
|
||||
|
||||
// credentialMarker is a package-internal method that exists just to satisfy the Credential interface.
|
||||
|
@ -33,11 +33,11 @@ func (*anonymousCredentialPolicyFactory) credentialMarker() {}
|
|||
|
||||
// anonymousCredentialPolicy is the credential's policy object.
|
||||
type anonymousCredentialPolicy struct {
|
||||
node pipeline.Node
|
||||
next pipeline.Policy
|
||||
}
|
||||
|
||||
// Do implements the credential's policy interface.
|
||||
func (p anonymousCredentialPolicy) Do(ctx context.Context, request pipeline.Request) (pipeline.Response, error) {
|
||||
// For anonymous credentials, this is effectively a no-op
|
||||
return p.node.Do(ctx, request)
|
||||
return p.next.Do(ctx, request)
|
||||
}
|
||||
|
|
|
@ -39,8 +39,8 @@ func (f SharedKeyCredential) AccountName() string {
|
|||
}
|
||||
|
||||
// New creates a credential policy object.
|
||||
func (f *SharedKeyCredential) New(node pipeline.Node) pipeline.Policy {
|
||||
return sharedKeyCredentialPolicy{node: node, factory: f}
|
||||
func (f *SharedKeyCredential) New(next pipeline.Policy, config *pipeline.Configuration) pipeline.Policy {
|
||||
return sharedKeyCredentialPolicy{factory: f, next: next, config: config}
|
||||
}
|
||||
|
||||
// credentialMarker is a package-internal method that exists just to satisfy the Credential interface.
|
||||
|
@ -48,8 +48,9 @@ func (*SharedKeyCredential) credentialMarker() {}
|
|||
|
||||
// sharedKeyCredentialPolicy is the credential's policy object.
|
||||
type sharedKeyCredentialPolicy struct {
|
||||
node pipeline.Node
|
||||
factory *SharedKeyCredential
|
||||
next pipeline.Policy
|
||||
config *pipeline.Configuration
|
||||
}
|
||||
|
||||
// Do implements the credential's policy interface.
|
||||
|
@ -63,10 +64,10 @@ func (p sharedKeyCredentialPolicy) Do(ctx context.Context, request pipeline.Requ
|
|||
authHeader := strings.Join([]string{"SharedKey ", p.factory.accountName, ":", signature}, "")
|
||||
request.Header[headerAuthorization] = []string{authHeader}
|
||||
|
||||
response, err := p.node.Do(ctx, request)
|
||||
response, err := p.next.Do(ctx, request)
|
||||
if err != nil && response != nil && response.Response() != nil && response.Response().StatusCode == http.StatusForbidden {
|
||||
// Service failed to authenticate request, log it
|
||||
p.node.Log(pipeline.LogError, "===== HTTP Forbidden status, String-to-Sign:\n"+stringToSign+"\n===============================\n")
|
||||
p.config.Log(pipeline.LogError, "===== HTTP Forbidden status, String-to-Sign:\n"+stringToSign+"\n===============================\n")
|
||||
}
|
||||
return response, err
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ func (f *TokenCredential) Token() string { return f.token.Load().(string) }
|
|||
func (f *TokenCredential) SetToken(token string) { f.token.Store(token) }
|
||||
|
||||
// New creates a credential policy object.
|
||||
func (f *TokenCredential) New(node pipeline.Node) pipeline.Policy {
|
||||
return &tokenCredentialPolicy{node: node, factory: f}
|
||||
func (f *TokenCredential) New(next pipeline.Policy, config *pipeline.Configuration) pipeline.Policy {
|
||||
return &tokenCredentialPolicy{factory: f, next: next}
|
||||
}
|
||||
|
||||
// credentialMarker is a package-internal method that exists just to satisfy the Credential interface.
|
||||
|
@ -34,8 +34,8 @@ func (*TokenCredential) credentialMarker() {}
|
|||
|
||||
// tokenCredentialPolicy is the credential's policy object.
|
||||
type tokenCredentialPolicy struct {
|
||||
node pipeline.Node
|
||||
factory *TokenCredential
|
||||
next pipeline.Policy
|
||||
}
|
||||
|
||||
// Do implements the credential's policy interface.
|
||||
|
@ -44,5 +44,5 @@ func (p tokenCredentialPolicy) Do(ctx context.Context, request pipeline.Request)
|
|||
panic("Token credentials require a URL using the https protocol scheme.")
|
||||
}
|
||||
request.Header[headerAuthorization] = []string{"Bearer " + p.factory.Token()}
|
||||
return p.node.Do(ctx, request)
|
||||
return p.next.Do(ctx, request)
|
||||
}
|
||||
|
|
|
@ -34,12 +34,13 @@ type requestLogPolicyFactory struct {
|
|||
o RequestLogOptions
|
||||
}
|
||||
|
||||
func (f *requestLogPolicyFactory) New(node pipeline.Node) pipeline.Policy {
|
||||
return &requestLogPolicy{node: node, o: f.o}
|
||||
func (f *requestLogPolicyFactory) New(next pipeline.Policy, config *pipeline.Configuration) pipeline.Policy {
|
||||
return &requestLogPolicy{o: f.o, next: next, config: config}
|
||||
}
|
||||
|
||||
type requestLogPolicy struct {
|
||||
node pipeline.Node
|
||||
next pipeline.Policy
|
||||
config *pipeline.Configuration
|
||||
o RequestLogOptions
|
||||
try int32
|
||||
operationStart time.Time
|
||||
|
@ -81,75 +82,68 @@ func (p *requestLogPolicy) Do(ctx context.Context, request pipeline.Request) (re
|
|||
}
|
||||
|
||||
// Log the outgoing request as informational
|
||||
if p.node.ShouldLog(pipeline.LogInfo) {
|
||||
if p.config.ShouldLog(pipeline.LogInfo) {
|
||||
b := &bytes.Buffer{}
|
||||
fmt.Fprintf(b, "==> OUTGOING REQUEST (Try=%d)\n", p.try)
|
||||
pipeline.WriteRequest(b, prepareRequestForLogging(request))
|
||||
p.node.Log(pipeline.LogInfo, b.String())
|
||||
pipeline.WriteRequestWithResponse(b, prepareRequestForLogging(request), nil, nil)
|
||||
p.config.Log(pipeline.LogInfo, b.String())
|
||||
}
|
||||
|
||||
// Set the time for this particular retry operation and then Do the operation.
|
||||
tryStart := time.Now()
|
||||
response, err = p.node.Do(ctx, request) // Make the request
|
||||
response, err = p.next.Do(ctx, request) // Make the request
|
||||
tryEnd := time.Now()
|
||||
tryDuration := tryEnd.Sub(tryStart)
|
||||
opDuration := tryEnd.Sub(p.operationStart)
|
||||
|
||||
severity := pipeline.LogInfo // Assume success and default to informational logging
|
||||
logMsg := func(b *bytes.Buffer) {
|
||||
b.WriteString("SUCCESSFUL OPERATION\n")
|
||||
pipeline.WriteRequestWithResponse(b, prepareRequestForLogging(request), response.Response())
|
||||
}
|
||||
logLevel, forceLog := pipeline.LogInfo, false // Default logging information
|
||||
|
||||
forceLog := false
|
||||
// If the response took too long, we'll upgrade to warning.
|
||||
if p.o.LogWarningIfTryOverThreshold > 0 && tryDuration > p.o.LogWarningIfTryOverThreshold {
|
||||
// Log a warning if the try duration exceeded the specified threshold
|
||||
severity = pipeline.LogWarning
|
||||
logMsg = func(b *bytes.Buffer) {
|
||||
fmt.Fprintf(b, "SLOW OPERATION [tryDuration > %v]\n", p.o.LogWarningIfTryOverThreshold)
|
||||
pipeline.WriteRequestWithResponse(b, prepareRequestForLogging(request), response.Response())
|
||||
forceLog = true // For CSS (Customer Support Services), we always log these to help diagnose latency issues
|
||||
}
|
||||
logLevel, forceLog = pipeline.LogWarning, true
|
||||
}
|
||||
|
||||
if err == nil { // We got a response from the service
|
||||
sc := response.Response().StatusCode
|
||||
if ((sc >= 400 && sc <= 499) && sc != http.StatusNotFound && sc != http.StatusConflict && sc != http.StatusPreconditionFailed && sc != http.StatusRequestedRangeNotSatisfiable) || (sc >= 500 && sc <= 599) {
|
||||
severity = pipeline.LogError // Promote to Error any 4xx (except those listed is an error) or any 5xx
|
||||
logMsg = func(b *bytes.Buffer) {
|
||||
// Write the error, the originating request and the stack
|
||||
fmt.Fprintf(b, "OPERATION ERROR:\n")
|
||||
pipeline.WriteRequestWithResponse(b, prepareRequestForLogging(request), response.Response())
|
||||
b.Write(stack()) // For errors, we append the stack trace (an expensive operation)
|
||||
forceLog = true // TODO: Do we really want this here?
|
||||
}
|
||||
logLevel, forceLog = pipeline.LogError, true // Promote to Error any 4xx (except those listed is an error) or any 5xx
|
||||
} else {
|
||||
// For other status codes, we leave the severity as is.
|
||||
// For other status codes, we leave the level as is.
|
||||
}
|
||||
} else { // This error did not get an HTTP response from the service; upgrade the severity to Error
|
||||
severity = pipeline.LogError
|
||||
logMsg = func(b *bytes.Buffer) {
|
||||
// Write the error, the originating request and the stack
|
||||
fmt.Fprintf(b, "NETWORK ERROR:\n%v\n", err)
|
||||
pipeline.WriteRequest(b, prepareRequestForLogging(request))
|
||||
b.Write(stack()) // For errors, we append the stack trace (an expensive operation)
|
||||
forceLog = true
|
||||
}
|
||||
logLevel, forceLog = pipeline.LogError, true
|
||||
}
|
||||
|
||||
if shouldLog := p.node.ShouldLog(severity); forceLog || shouldLog {
|
||||
if shouldLog := p.config.ShouldLog(logLevel); forceLog || shouldLog {
|
||||
// We're going to log this; build the string to log
|
||||
b := &bytes.Buffer{}
|
||||
fmt.Fprintf(b, "==> REQUEST/RESPONSE (Try=%d, TryDuration=%v, OpDuration=%v) -- ", p.try, tryDuration, opDuration)
|
||||
logMsg(b)
|
||||
slow := ""
|
||||
if p.o.LogWarningIfTryOverThreshold > 0 && tryDuration > p.o.LogWarningIfTryOverThreshold {
|
||||
slow = fmt.Sprintf("[SLOW >%v]", p.o.LogWarningIfTryOverThreshold)
|
||||
}
|
||||
fmt.Fprintf(b, "==> REQUEST/RESPONSE (Try=%d/%v%s, OpTime=%v) -- ", p.try, tryDuration, slow, opDuration)
|
||||
if err != nil { // This HTTP request did not get a response from the service
|
||||
fmt.Fprintf(b, "REQUEST ERROR\n")
|
||||
} else {
|
||||
if logLevel == pipeline.LogError {
|
||||
fmt.Fprintf(b, "RESPONSE STATUS CODE ERROR\n")
|
||||
} else {
|
||||
fmt.Fprintf(b, "RESPONSE SUCCESSFULLY RECEIVED\n")
|
||||
}
|
||||
}
|
||||
|
||||
pipeline.WriteRequestWithResponse(b, prepareRequestForLogging(request), response.Response(), err)
|
||||
if logLevel <= pipeline.LogError {
|
||||
b.Write(stack()) // For errors (or lower levels), we append the stack trace (an expensive operation)
|
||||
}
|
||||
msg := b.String()
|
||||
|
||||
if forceLog {
|
||||
pipeline.ForceLog(severity, msg)
|
||||
pipeline.ForceLog(logLevel, msg)
|
||||
}
|
||||
if shouldLog {
|
||||
p.node.Log(severity, msg)
|
||||
p.config.Log(logLevel, msg)
|
||||
}
|
||||
}
|
||||
return response, err
|
||||
|
|
|
@ -57,6 +57,18 @@ type RetryOptions struct {
|
|||
}
|
||||
|
||||
func (o RetryOptions) defaults() RetryOptions {
|
||||
if o.Policy != RetryPolicyExponential && o.Policy != RetryPolicyFixed {
|
||||
panic(errors.New("RetryPolicy must be RetryPolicyExponential or RetryPolicyFixed"))
|
||||
}
|
||||
if o.MaxTries < 0 {
|
||||
panic("MaxTries must be >= 0")
|
||||
}
|
||||
if o.TryTimeout < 0 || o.RetryDelay < 0 || o.MaxRetryDelay < 0 {
|
||||
panic("TryTimeout, RetryDelay, and MaxRetryDelay must all be >= 0")
|
||||
}
|
||||
if o.RetryDelay > o.MaxRetryDelay {
|
||||
panic("RetryDelay must be <= MaxRetryDelay")
|
||||
}
|
||||
if (o.RetryDelay == 0 && o.MaxRetryDelay != 0) || (o.RetryDelay != 0 && o.MaxRetryDelay == 0) {
|
||||
panic(errors.New("Both RetryDelay and MaxRetryDelay must be 0 or neither can be 0"))
|
||||
}
|
||||
|
@ -122,19 +134,20 @@ type retryPolicyFactory struct {
|
|||
o RetryOptions
|
||||
}
|
||||
|
||||
func (f *retryPolicyFactory) New(node pipeline.Node) pipeline.Policy {
|
||||
return &retryPolicy{node: node, o: f.o}
|
||||
func (f *retryPolicyFactory) New(next pipeline.Policy, config *pipeline.Configuration) pipeline.Policy {
|
||||
return &retryPolicy{o: f.o, next: next}
|
||||
}
|
||||
|
||||
type retryPolicy struct {
|
||||
node pipeline.Node
|
||||
next pipeline.Policy
|
||||
o RetryOptions
|
||||
}
|
||||
|
||||
// According to https://github.com/golang/go/wiki/CompilerOptimizations, the compiler will inline this method and hopefully optimize all calls to it away
|
||||
var logf = func(format string, a ...interface{}) {}
|
||||
|
||||
//var logf = fmt.Printf // Use this version to see the retry method's code path (import "fmt")
|
||||
// Use this version to see the retry method's code path (import "fmt")
|
||||
//var logf = fmt.Printf
|
||||
|
||||
func (p *retryPolicy) Do(ctx context.Context, request pipeline.Request) (response pipeline.Response, err error) {
|
||||
// Before each try, we'll select either the primary or secondary URL.
|
||||
|
@ -203,7 +216,7 @@ func (p *retryPolicy) Do(ctx context.Context, request pipeline.Request) (respons
|
|||
|
||||
// Set the time for this particular retry operation and then Do the operation.
|
||||
tryCtx, tryCancel := context.WithTimeout(ctx, time.Second*time.Duration(timeout))
|
||||
response, err = p.node.Do(tryCtx, requestCopy) // Make the request
|
||||
response, err = p.next.Do(tryCtx, requestCopy) // Make the request
|
||||
logf("Err=%v, response=%v\n", err, response)
|
||||
|
||||
action := "" // This MUST get changed within the switch code below
|
||||
|
|
|
@ -35,19 +35,19 @@ type telemetryPolicyFactory struct {
|
|||
}
|
||||
|
||||
// New creates a telemetryPolicy object.
|
||||
func (f *telemetryPolicyFactory) New(node pipeline.Node) pipeline.Policy {
|
||||
return &telemetryPolicy{node: node, factory: f}
|
||||
func (f *telemetryPolicyFactory) New(next pipeline.Policy, config *pipeline.Configuration) pipeline.Policy {
|
||||
return &telemetryPolicy{factory: f, next: next}
|
||||
}
|
||||
|
||||
// telemetryPolicy ...
|
||||
type telemetryPolicy struct {
|
||||
node pipeline.Node
|
||||
factory *telemetryPolicyFactory
|
||||
next pipeline.Policy
|
||||
}
|
||||
|
||||
func (p *telemetryPolicy) Do(ctx context.Context, request pipeline.Request) (pipeline.Response, error) {
|
||||
request.Header.Set("User-Agent", p.factory.telemetryValue)
|
||||
return p.node.Do(ctx, request)
|
||||
return p.next.Do(ctx, request)
|
||||
}
|
||||
|
||||
// NOTE: the ONLY function that should read OR write to this variable is platformInfo
|
||||
|
|
|
@ -22,13 +22,13 @@ type uniqueRequestIDPolicyFactory struct {
|
|||
}
|
||||
|
||||
// New creates a UniqueRequestIDPolicy object.
|
||||
func (f *uniqueRequestIDPolicyFactory) New(node pipeline.Node) pipeline.Policy {
|
||||
return &uniqueRequestIDPolicy{node: node}
|
||||
func (f *uniqueRequestIDPolicyFactory) New(next pipeline.Policy, config *pipeline.Configuration) pipeline.Policy {
|
||||
return &uniqueRequestIDPolicy{next: next}
|
||||
}
|
||||
|
||||
// UniqueRequestIDPolicy ...
|
||||
type uniqueRequestIDPolicy struct {
|
||||
node pipeline.Node
|
||||
next pipeline.Policy
|
||||
}
|
||||
|
||||
func (p *uniqueRequestIDPolicy) Do(ctx context.Context, request pipeline.Request) (pipeline.Response, error) {
|
||||
|
@ -36,7 +36,7 @@ func (p *uniqueRequestIDPolicy) Do(ctx context.Context, request pipeline.Request
|
|||
if id == "" { // Add a unique request ID if the caller didn't specify one already
|
||||
request.Header.Set(xMsClientRequestID, newUUID().String())
|
||||
}
|
||||
return p.node.Do(ctx, request)
|
||||
return p.next.Do(ctx, request)
|
||||
}
|
||||
|
||||
// The UUID reserved variants.
|
||||
|
|
|
@ -69,7 +69,7 @@ func (e *storageError) Error() string {
|
|||
}
|
||||
}
|
||||
req := pipeline.Request{Request: e.response.Request}.Copy() // Make a copy of the response's request
|
||||
pipeline.WriteRequestWithResponse(b, prepareRequestForLogging(req), e.response)
|
||||
pipeline.WriteRequestWithResponse(b, prepareRequestForLogging(req), e.response, nil)
|
||||
return e.ErrorNode.Error(b.String())
|
||||
}
|
||||
|
||||
|
|
|
@ -139,11 +139,11 @@ func ExampleNewPipeline() {
|
|||
|
||||
// Set LogOptions to control what & where all pipeline log events go
|
||||
Log: pipeline.LogOptions{
|
||||
Log: func(s pipeline.LogSeverity, m string) { // This func is called to log each event
|
||||
Log: func(s pipeline.LogLevel, m string) { // This func is called to log each event
|
||||
// This method is not called for filtered-out severities.
|
||||
logger.Output(2, m) // This example uses Go's standard logger
|
||||
},
|
||||
MinimumSeverityToLog: func() pipeline.LogSeverity { return pipeline.LogInfo }, // Log all events from informational to more severe
|
||||
MinimumLevelToLog: func() pipeline.LogLevel { return pipeline.LogInfo }, // Log all events from informational to more severe
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,7 @@ func ExampleAccountSASSignatureValues() {
|
|||
|
||||
// If you have a SAS query parameter string, you can parse it into its parts:
|
||||
values, _ := url.ParseQuery(qp)
|
||||
sasQueryParams = NewSASQueryParameters(values)
|
||||
sasQueryParams = NewSASQueryParameters(values, true)
|
||||
fmt.Printf("SAS expiry time=%v", sasQueryParams.ExpiryTime)
|
||||
|
||||
_ = serviceURL // Avoid compiler's "declared and not used" error
|
||||
|
@ -348,7 +348,7 @@ func ExampleBlobSASSignatureValues() {
|
|||
|
||||
// If you have a SAS query parameter string, you can parse it into its parts:
|
||||
values, _ := url.ParseQuery(qp)
|
||||
sasQueryParams = NewSASQueryParameters(values)
|
||||
sasQueryParams = NewSASQueryParameters(values, true)
|
||||
fmt.Printf("SAS expiry time=%v", sasQueryParams.ExpiryTime)
|
||||
|
||||
_ = blobURL // Avoid compiler's "declared and not used" error
|
||||
|
|
|
@ -31,11 +31,9 @@ func (s *aztestsSuite) TestRetryTestScenarioUntilSuccess(c *chk.C) {
|
|||
func (s *aztestsSuite) TestRetryTestScenarioUntilOperationCancel(c *chk.C) {
|
||||
testRetryTestScenario(c, retryTestScenarioRetryUntilOperationCancel)
|
||||
}
|
||||
|
||||
func (s *aztestsSuite) TestRetryTestScenarioUntilMaxRetries(c *chk.C) {
|
||||
testRetryTestScenario(c, retryTestScenarioRetryUntilMaxRetries)
|
||||
}
|
||||
|
||||
func newRetryTestPolicyFactory(c *chk.C, scenario retryTestScenario, maxRetries int32, cancel context.CancelFunc) *retryTestPolicyFactory {
|
||||
return &retryTestPolicyFactory{c: c, scenario: scenario, maxRetries: maxRetries, cancel: cancel}
|
||||
}
|
||||
|
@ -48,13 +46,13 @@ type retryTestPolicyFactory struct {
|
|||
try int32
|
||||
}
|
||||
|
||||
func (f *retryTestPolicyFactory) New(node pipeline.Node) pipeline.Policy {
|
||||
func (f *retryTestPolicyFactory) New(next pipeline.Policy, config *pipeline.Configuration) pipeline.Policy {
|
||||
f.try = 0 // Reset this for each test
|
||||
return &retryTestPolicy{node: node, factory: f}
|
||||
return &retryTestPolicy{factory: f, next: next}
|
||||
}
|
||||
|
||||
type retryTestPolicy struct {
|
||||
node pipeline.Node
|
||||
next pipeline.Policy
|
||||
factory *retryTestPolicyFactory
|
||||
}
|
||||
|
||||
|
@ -158,8 +156,8 @@ func testRetryTestScenario(c *chk.C, scenario retryTestScenario) {
|
|||
ctx, cancel := context.WithTimeout(ctx, 64 /*2^MaxTries(6)*/ *retryOptions.TryTimeout)
|
||||
retrytestPolicyFactory := newRetryTestPolicyFactory(c, scenario, retryOptions.MaxTries, cancel)
|
||||
factories := [...]pipeline.Factory{
|
||||
retrytestPolicyFactory,
|
||||
azblob.NewRetryPolicyFactory(retryOptions),
|
||||
retrytestPolicyFactory,
|
||||
}
|
||||
p := pipeline.NewPipeline(factories[:], pipeline.Options{})
|
||||
request, err := pipeline.NewRequest(http.MethodGet, *u, strings.NewReader("TestData"))
|
||||
|
@ -172,7 +170,7 @@ func testRetryTestScenario(c *chk.C, scenario retryTestScenario) {
|
|||
case retryTestScenarioRetryUntilMaxRetries:
|
||||
c.Assert(err, chk.NotNil) // Ensure we ended with an error
|
||||
c.Assert(response, chk.IsNil) // Ensure we ended without a valid response
|
||||
c.Assert(retrytestPolicyFactory.try, chk.Equals, retryOptions.MaxTries) // Ensure the operation end with the exact right number of tries
|
||||
c.Assert(retrytestPolicyFactory.try, chk.Equals, retryOptions.MaxTries) // Ensure the operation ends with the exact right number of tries
|
||||
case retryTestScenarioRetryUntilOperationCancel:
|
||||
c.Assert(err, chk.Equals, context.Canceled) // Ensure we ended due to cancellation
|
||||
c.Assert(response, chk.IsNil) // Ensure we ended without a valid response
|
||||
|
|
|
@ -296,7 +296,7 @@ func (s *aztestsSuite) TestAccountListContainersMaxResultsZero(c *chk.C) {
|
|||
|
||||
// Max Results = 0 means the value will be ignored, the header not set, and the server default used
|
||||
resp, err := bsu.ListContainers(ctx,
|
||||
azblob.Marker{}, *(&azblob.ListContainersOptions{Prefix: containerPrefix, MaxResults: 0}))
|
||||
azblob.Marker{}, azblob.ListContainersOptions{Prefix: containerPrefix, MaxResults: 0})
|
||||
|
||||
c.Assert(err, chk.IsNil)
|
||||
c.Assert(resp.Containers, chk.HasLen, 1)
|
||||
|
|
|
@ -13,14 +13,14 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// AppendBlobsClient is the client for the AppendBlobs methods of the Azblob service.
|
||||
type AppendBlobsClient struct {
|
||||
ManagementClient
|
||||
// appendBlobsClient is the client for the AppendBlobs methods of the Azblob service.
|
||||
type appendBlobsClient struct {
|
||||
managementClient
|
||||
}
|
||||
|
||||
// NewAppendBlobsClient creates an instance of the AppendBlobsClient client.
|
||||
func NewAppendBlobsClient(url url.URL, p pipeline.Pipeline) AppendBlobsClient {
|
||||
return AppendBlobsClient{NewManagementClient(url, p)}
|
||||
// newAppendBlobsClient creates an instance of the appendBlobsClient client.
|
||||
func newAppendBlobsClient(url url.URL, p pipeline.Pipeline) appendBlobsClient {
|
||||
return appendBlobsClient{newManagementClient(url, p)}
|
||||
}
|
||||
|
||||
// AppendBlock the Append Block operation commits a new block of data to the end of an existing append blob. The Append
|
||||
|
@ -43,7 +43,7 @@ func NewAppendBlobsClient(url url.URL, p pipeline.Pipeline) AppendBlobsClient {
|
|||
// operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a
|
||||
// matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
||||
// in the analytics logs when storage analytics logging is enabled.
|
||||
func (client AppendBlobsClient) AppendBlock(ctx context.Context, body io.ReadSeeker, timeout *int32, leaseID *string, maxSize *int32, appendPosition *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*AppendBlobsAppendBlockResponse, error) {
|
||||
func (client appendBlobsClient) AppendBlock(ctx context.Context, body io.ReadSeeker, timeout *int32, leaseID *string, maxSize *int32, appendPosition *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*AppendBlobsAppendBlockResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: body,
|
||||
constraints: []constraint{{target: "body", name: null, rule: true, chain: nil}}},
|
||||
|
@ -64,7 +64,7 @@ func (client AppendBlobsClient) AppendBlock(ctx context.Context, body io.ReadSee
|
|||
}
|
||||
|
||||
// appendBlockPreparer prepares the AppendBlock request.
|
||||
func (client AppendBlobsClient) appendBlockPreparer(body io.ReadSeeker, timeout *int32, leaseID *string, maxSize *int32, appendPosition *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client appendBlobsClient) appendBlockPreparer(body io.ReadSeeker, timeout *int32, leaseID *string, maxSize *int32, appendPosition *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, body)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -104,7 +104,7 @@ func (client AppendBlobsClient) appendBlockPreparer(body io.ReadSeeker, timeout
|
|||
}
|
||||
|
||||
// appendBlockResponder handles the response to the AppendBlock request.
|
||||
func (client AppendBlobsClient) appendBlockResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client appendBlobsClient) appendBlockResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusCreated)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
|
|
@ -13,14 +13,14 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// BlobsClient is the client for the Blobs methods of the Azblob service.
|
||||
type BlobsClient struct {
|
||||
ManagementClient
|
||||
// blobsClient is the client for the Blobs methods of the Azblob service.
|
||||
type blobsClient struct {
|
||||
managementClient
|
||||
}
|
||||
|
||||
// NewBlobsClient creates an instance of the BlobsClient client.
|
||||
func NewBlobsClient(url url.URL, p pipeline.Pipeline) BlobsClient {
|
||||
return BlobsClient{NewManagementClient(url, p)}
|
||||
// newBlobsClient creates an instance of the blobsClient client.
|
||||
func newBlobsClient(url url.URL, p pipeline.Pipeline) blobsClient {
|
||||
return blobsClient{newManagementClient(url, p)}
|
||||
}
|
||||
|
||||
// AbortCopy the Abort Copy Blob operation aborts a pending Copy Blob operation, and leaves a destination blob with
|
||||
|
@ -33,7 +33,7 @@ func NewBlobsClient(url url.URL, p pipeline.Pipeline) BlobsClient {
|
|||
// Timeouts for Blob Service Operations.</a> leaseID is if specified, the operation only succeeds if the container's
|
||||
// lease is active and matches this ID. requestID is provides a client-generated, opaque value with a 1 KB character
|
||||
// limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client BlobsClient) AbortCopy(ctx context.Context, copyID string, copyActionAbortConstant string, timeout *int32, leaseID *string, requestID *string) (*BlobsAbortCopyResponse, error) {
|
||||
func (client blobsClient) AbortCopy(ctx context.Context, copyID string, copyActionAbortConstant string, timeout *int32, leaseID *string, requestID *string) (*BlobsAbortCopyResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -52,7 +52,7 @@ func (client BlobsClient) AbortCopy(ctx context.Context, copyID string, copyActi
|
|||
}
|
||||
|
||||
// abortCopyPreparer prepares the AbortCopy request.
|
||||
func (client BlobsClient) abortCopyPreparer(copyID string, copyActionAbortConstant string, timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) abortCopyPreparer(copyID string, copyActionAbortConstant string, timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -76,7 +76,7 @@ func (client BlobsClient) abortCopyPreparer(copyID string, copyActionAbortConsta
|
|||
}
|
||||
|
||||
// abortCopyResponder handles the response to the AbortCopy request.
|
||||
func (client BlobsClient) abortCopyResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) abortCopyResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusNoContent)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -108,7 +108,7 @@ func (client BlobsClient) abortCopyResponder(resp pipeline.Response) (pipeline.R
|
|||
// and matches this ID. sourceLeaseID is specify this header to perform the operation only if the lease ID given
|
||||
// matches the active lease ID of the source blob. requestID is provides a client-generated, opaque value with a 1 KB
|
||||
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client BlobsClient) Copy(ctx context.Context, copySource string, timeout *int32, metadata map[string]string, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatches *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, leaseID *string, sourceLeaseID *string, requestID *string) (*BlobsCopyResponse, error) {
|
||||
func (client blobsClient) Copy(ctx context.Context, copySource string, timeout *int32, metadata map[string]string, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatches *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, leaseID *string, sourceLeaseID *string, requestID *string) (*BlobsCopyResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -130,7 +130,7 @@ func (client BlobsClient) Copy(ctx context.Context, copySource string, timeout *
|
|||
}
|
||||
|
||||
// copyPreparer prepares the Copy request.
|
||||
func (client BlobsClient) copyPreparer(copySource string, timeout *int32, metadata map[string]string, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatches *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, leaseID *string, sourceLeaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) copyPreparer(copySource string, timeout *int32, metadata map[string]string, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatches *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, leaseID *string, sourceLeaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -184,7 +184,7 @@ func (client BlobsClient) copyPreparer(copySource string, timeout *int32, metada
|
|||
}
|
||||
|
||||
// copyResponder handles the response to the Copy request.
|
||||
func (client BlobsClient) copyResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) copyResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusAccepted)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -210,7 +210,7 @@ func (client BlobsClient) copyResponder(resp pipeline.Response) (pipeline.Respon
|
|||
// on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching
|
||||
// value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
|
||||
// analytics logs when storage analytics logging is enabled.
|
||||
func (client BlobsClient) Delete(ctx context.Context, snapshot *time.Time, timeout *int32, leaseID *string, deleteSnapshots DeleteSnapshotsOptionType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlobsDeleteResponse, error) {
|
||||
func (client blobsClient) Delete(ctx context.Context, snapshot *time.Time, timeout *int32, leaseID *string, deleteSnapshots DeleteSnapshotsOptionType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlobsDeleteResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -229,7 +229,7 @@ func (client BlobsClient) Delete(ctx context.Context, snapshot *time.Time, timeo
|
|||
}
|
||||
|
||||
// deletePreparer prepares the Delete request.
|
||||
func (client BlobsClient) deletePreparer(snapshot *time.Time, timeout *int32, leaseID *string, deleteSnapshots DeleteSnapshotsOptionType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) deletePreparer(snapshot *time.Time, timeout *int32, leaseID *string, deleteSnapshots DeleteSnapshotsOptionType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("DELETE", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -268,7 +268,7 @@ func (client BlobsClient) deletePreparer(snapshot *time.Time, timeout *int32, le
|
|||
}
|
||||
|
||||
// deleteResponder handles the response to the Delete request.
|
||||
func (client BlobsClient) deleteResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) deleteResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusAccepted)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -293,7 +293,7 @@ func (client BlobsClient) deleteResponder(resp pipeline.Response) (pipeline.Resp
|
|||
// specify an ETag value to operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to
|
||||
// operate only on blobs without a matching value. requestID is provides a client-generated, opaque value with a 1 KB
|
||||
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client BlobsClient) Get(ctx context.Context, snapshot *time.Time, timeout *int32, rangeParameter *string, leaseID *string, rangeGetContentMD5 *bool, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*GetResponse, error) {
|
||||
func (client blobsClient) Get(ctx context.Context, snapshot *time.Time, timeout *int32, rangeParameter *string, leaseID *string, rangeGetContentMD5 *bool, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*GetResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -312,7 +312,7 @@ func (client BlobsClient) Get(ctx context.Context, snapshot *time.Time, timeout
|
|||
}
|
||||
|
||||
// getPreparer prepares the Get request.
|
||||
func (client BlobsClient) getPreparer(snapshot *time.Time, timeout *int32, rangeParameter *string, leaseID *string, rangeGetContentMD5 *bool, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) getPreparer(snapshot *time.Time, timeout *int32, rangeParameter *string, leaseID *string, rangeGetContentMD5 *bool, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("GET", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -354,7 +354,7 @@ func (client BlobsClient) getPreparer(snapshot *time.Time, timeout *int32, range
|
|||
}
|
||||
|
||||
// getResponder handles the response to the Get request.
|
||||
func (client BlobsClient) getResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) getResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusPartialContent)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -376,7 +376,7 @@ func (client BlobsClient) getResponder(resp pipeline.Response) (pipeline.Respons
|
|||
// on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching
|
||||
// value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
|
||||
// analytics logs when storage analytics logging is enabled.
|
||||
func (client BlobsClient) GetMetadata(ctx context.Context, snapshot *time.Time, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlobsGetMetadataResponse, error) {
|
||||
func (client blobsClient) GetMetadata(ctx context.Context, snapshot *time.Time, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlobsGetMetadataResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -395,7 +395,7 @@ func (client BlobsClient) GetMetadata(ctx context.Context, snapshot *time.Time,
|
|||
}
|
||||
|
||||
// getMetadataPreparer prepares the GetMetadata request.
|
||||
func (client BlobsClient) getMetadataPreparer(snapshot *time.Time, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) getMetadataPreparer(snapshot *time.Time, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("GET", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -432,7 +432,7 @@ func (client BlobsClient) getMetadataPreparer(snapshot *time.Time, timeout *int3
|
|||
}
|
||||
|
||||
// getMetadataResponder handles the response to the GetMetadata request.
|
||||
func (client BlobsClient) getMetadataResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) getMetadataResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -455,7 +455,7 @@ func (client BlobsClient) getMetadataResponder(resp pipeline.Response) (pipeline
|
|||
// on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching
|
||||
// value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
|
||||
// analytics logs when storage analytics logging is enabled.
|
||||
func (client BlobsClient) GetProperties(ctx context.Context, snapshot *time.Time, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlobsGetPropertiesResponse, error) {
|
||||
func (client blobsClient) GetProperties(ctx context.Context, snapshot *time.Time, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlobsGetPropertiesResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -474,7 +474,7 @@ func (client BlobsClient) GetProperties(ctx context.Context, snapshot *time.Time
|
|||
}
|
||||
|
||||
// getPropertiesPreparer prepares the GetProperties request.
|
||||
func (client BlobsClient) getPropertiesPreparer(snapshot *time.Time, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) getPropertiesPreparer(snapshot *time.Time, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("HEAD", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -510,7 +510,7 @@ func (client BlobsClient) getPropertiesPreparer(snapshot *time.Time, timeout *in
|
|||
}
|
||||
|
||||
// getPropertiesResponder handles the response to the GetProperties request.
|
||||
func (client BlobsClient) getPropertiesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) getPropertiesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -539,7 +539,7 @@ func (client BlobsClient) getPropertiesResponder(resp pipeline.Response) (pipeli
|
|||
// only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a
|
||||
// matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
||||
// in the analytics logs when storage analytics logging is enabled.
|
||||
func (client BlobsClient) Lease(ctx context.Context, action LeaseActionType, timeout *int32, leaseID *string, breakPeriod *int32, duration *int32, proposedLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlobsLeaseResponse, error) {
|
||||
func (client blobsClient) Lease(ctx context.Context, action LeaseActionType, timeout *int32, leaseID *string, breakPeriod *int32, duration *int32, proposedLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlobsLeaseResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -558,7 +558,7 @@ func (client BlobsClient) Lease(ctx context.Context, action LeaseActionType, tim
|
|||
}
|
||||
|
||||
// leasePreparer prepares the Lease request.
|
||||
func (client BlobsClient) leasePreparer(action LeaseActionType, timeout *int32, leaseID *string, breakPeriod *int32, duration *int32, proposedLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) leasePreparer(action LeaseActionType, timeout *int32, leaseID *string, breakPeriod *int32, duration *int32, proposedLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -602,7 +602,7 @@ func (client BlobsClient) leasePreparer(action LeaseActionType, timeout *int32,
|
|||
}
|
||||
|
||||
// leaseResponder handles the response to the Lease request.
|
||||
func (client BlobsClient) leaseResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) leaseResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -642,7 +642,7 @@ func (client BlobsClient) leaseResponder(resp pipeline.Response) (pipeline.Respo
|
|||
// user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and
|
||||
// 2^63 - 1. requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
|
||||
// analytics logs when storage analytics logging is enabled.
|
||||
func (client BlobsClient) Put(ctx context.Context, blobType map[string]interface{}, body io.ReadSeeker, timeout *int32, cacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 *string, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobContentLength *int64, blobSequenceNumber *int64, requestID *string) (*BlobsPutResponse, error) {
|
||||
func (client blobsClient) Put(ctx context.Context, blobType BlobType, body io.ReadSeeker, timeout *int32, cacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 *string, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobContentLength *int64, blobSequenceNumber *int64, requestID *string) (*BlobsPutResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -664,7 +664,7 @@ func (client BlobsClient) Put(ctx context.Context, blobType map[string]interface
|
|||
}
|
||||
|
||||
// putPreparer prepares the Put request.
|
||||
func (client BlobsClient) putPreparer(blobType map[string]interface{}, body io.ReadSeeker, timeout *int32, cacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 *string, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobContentLength *int64, blobSequenceNumber *int64, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) putPreparer(blobType BlobType, body io.ReadSeeker, timeout *int32, cacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 *string, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobContentLength *int64, blobSequenceNumber *int64, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, body)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -730,7 +730,7 @@ func (client BlobsClient) putPreparer(blobType map[string]interface{}, body io.R
|
|||
}
|
||||
|
||||
// putResponder handles the response to the Put request.
|
||||
func (client BlobsClient) putResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) putResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusCreated)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -748,7 +748,7 @@ func (client BlobsClient) putResponder(resp pipeline.Response) (pipeline.Respons
|
|||
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
|
||||
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
|
||||
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client BlobsClient) SetBlobTier(ctx context.Context, tier map[string]interface{}, timeout *int32, requestID *string) (*BlobsSetBlobTierResponse, error) {
|
||||
func (client blobsClient) SetBlobTier(ctx context.Context, tier map[string]interface{}, timeout *int32, requestID *string) (*BlobsSetBlobTierResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -767,7 +767,7 @@ func (client BlobsClient) SetBlobTier(ctx context.Context, tier map[string]inter
|
|||
}
|
||||
|
||||
// setBlobTierPreparer prepares the SetBlobTier request.
|
||||
func (client BlobsClient) setBlobTierPreparer(tier map[string]interface{}, timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) setBlobTierPreparer(tier map[string]interface{}, timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -787,7 +787,7 @@ func (client BlobsClient) setBlobTierPreparer(tier map[string]interface{}, timeo
|
|||
}
|
||||
|
||||
// setBlobTierResponder handles the response to the SetBlobTier request.
|
||||
func (client BlobsClient) setBlobTierResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) setBlobTierResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusAccepted)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -812,7 +812,7 @@ func (client BlobsClient) setBlobTierResponder(resp pipeline.Response) (pipeline
|
|||
// to operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs
|
||||
// without a matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is
|
||||
// recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client BlobsClient) SetMetadata(ctx context.Context, timeout *int32, metadata map[string]string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlobsSetMetadataResponse, error) {
|
||||
func (client blobsClient) SetMetadata(ctx context.Context, timeout *int32, metadata map[string]string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlobsSetMetadataResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -834,7 +834,7 @@ func (client BlobsClient) SetMetadata(ctx context.Context, timeout *int32, metad
|
|||
}
|
||||
|
||||
// setMetadataPreparer prepares the SetMetadata request.
|
||||
func (client BlobsClient) setMetadataPreparer(timeout *int32, metadata map[string]string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) setMetadataPreparer(timeout *int32, metadata map[string]string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -873,7 +873,7 @@ func (client BlobsClient) setMetadataPreparer(timeout *int32, metadata map[strin
|
|||
}
|
||||
|
||||
// setMetadataResponder handles the response to the SetMetadata request.
|
||||
func (client BlobsClient) setMetadataResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) setMetadataResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -905,7 +905,7 @@ func (client BlobsClient) setMetadataResponder(resp pipeline.Response) (pipeline
|
|||
// track requests. The value of the sequence number must be between 0 and 2^63 - 1. requestID is provides a
|
||||
// client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
|
||||
// analytics logging is enabled.
|
||||
func (client BlobsClient) SetProperties(ctx context.Context, timeout *int32, blobCacheControl *string, blobContentType *string, blobContentMD5 *string, blobContentEncoding *string, blobContentLanguage *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobContentDisposition *string, blobContentLength *int64, sequenceNumberAction SequenceNumberActionType, blobSequenceNumber *int64, requestID *string) (*BlobsSetPropertiesResponse, error) {
|
||||
func (client blobsClient) SetProperties(ctx context.Context, timeout *int32, blobCacheControl *string, blobContentType *string, blobContentMD5 *string, blobContentEncoding *string, blobContentLanguage *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobContentDisposition *string, blobContentLength *int64, sequenceNumberAction SequenceNumberActionType, blobSequenceNumber *int64, requestID *string) (*BlobsSetPropertiesResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -924,7 +924,7 @@ func (client BlobsClient) SetProperties(ctx context.Context, timeout *int32, blo
|
|||
}
|
||||
|
||||
// setPropertiesPreparer prepares the SetProperties request.
|
||||
func (client BlobsClient) setPropertiesPreparer(timeout *int32, blobCacheControl *string, blobContentType *string, blobContentMD5 *string, blobContentEncoding *string, blobContentLanguage *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobContentDisposition *string, blobContentLength *int64, sequenceNumberAction SequenceNumberActionType, blobSequenceNumber *int64, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) setPropertiesPreparer(timeout *int32, blobCacheControl *string, blobContentType *string, blobContentMD5 *string, blobContentEncoding *string, blobContentLanguage *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobContentDisposition *string, blobContentLength *int64, sequenceNumberAction SequenceNumberActionType, blobSequenceNumber *int64, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -985,7 +985,7 @@ func (client BlobsClient) setPropertiesPreparer(timeout *int32, blobCacheControl
|
|||
}
|
||||
|
||||
// setPropertiesResponder handles the response to the SetProperties request.
|
||||
func (client BlobsClient) setPropertiesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) setPropertiesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -1009,7 +1009,7 @@ func (client BlobsClient) setPropertiesResponder(resp pipeline.Response) (pipeli
|
|||
// without a matching value. leaseID is if specified, the operation only succeeds if the container's lease is active
|
||||
// and matches this ID. requestID is provides a client-generated, opaque value with a 1 KB character limit that is
|
||||
// recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client BlobsClient) TakeSnapshot(ctx context.Context, timeout *int32, metadata map[string]string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, leaseID *string, requestID *string) (*BlobsTakeSnapshotResponse, error) {
|
||||
func (client blobsClient) TakeSnapshot(ctx context.Context, timeout *int32, metadata map[string]string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, leaseID *string, requestID *string) (*BlobsTakeSnapshotResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -1031,7 +1031,7 @@ func (client BlobsClient) TakeSnapshot(ctx context.Context, timeout *int32, meta
|
|||
}
|
||||
|
||||
// takeSnapshotPreparer prepares the TakeSnapshot request.
|
||||
func (client BlobsClient) takeSnapshotPreparer(timeout *int32, metadata map[string]string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
func (client blobsClient) takeSnapshotPreparer(timeout *int32, metadata map[string]string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -1070,7 +1070,7 @@ func (client BlobsClient) takeSnapshotPreparer(timeout *int32, metadata map[stri
|
|||
}
|
||||
|
||||
// takeSnapshotResponder handles the response to the TakeSnapshot request.
|
||||
func (client BlobsClient) takeSnapshotResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blobsClient) takeSnapshotResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusCreated)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
|
|
@ -16,14 +16,14 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// BlockBlobsClient is the client for the BlockBlobs methods of the Azblob service.
|
||||
type BlockBlobsClient struct {
|
||||
ManagementClient
|
||||
// blockBlobsClient is the client for the BlockBlobs methods of the Azblob service.
|
||||
type blockBlobsClient struct {
|
||||
managementClient
|
||||
}
|
||||
|
||||
// NewBlockBlobsClient creates an instance of the BlockBlobsClient client.
|
||||
func NewBlockBlobsClient(url url.URL, p pipeline.Pipeline) BlockBlobsClient {
|
||||
return BlockBlobsClient{NewManagementClient(url, p)}
|
||||
// newBlockBlobsClient creates an instance of the blockBlobsClient client.
|
||||
func newBlockBlobsClient(url url.URL, p pipeline.Pipeline) blockBlobsClient {
|
||||
return blockBlobsClient{newManagementClient(url, p)}
|
||||
}
|
||||
|
||||
// GetBlockList the Get Block List operation retrieves the list of blocks that have been uploaded as part of a block
|
||||
|
@ -38,7 +38,7 @@ func NewBlockBlobsClient(url url.URL, p pipeline.Pipeline) BlockBlobsClient {
|
|||
// Timeouts for Blob Service Operations.</a> leaseID is if specified, the operation only succeeds if the container's
|
||||
// lease is active and matches this ID. requestID is provides a client-generated, opaque value with a 1 KB character
|
||||
// limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client BlockBlobsClient) GetBlockList(ctx context.Context, listType BlockListType, snapshot *time.Time, timeout *int32, leaseID *string, requestID *string) (*BlockList, error) {
|
||||
func (client blockBlobsClient) GetBlockList(ctx context.Context, listType BlockListType, snapshot *time.Time, timeout *int32, leaseID *string, requestID *string) (*BlockList, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -57,7 +57,7 @@ func (client BlockBlobsClient) GetBlockList(ctx context.Context, listType BlockL
|
|||
}
|
||||
|
||||
// getBlockListPreparer prepares the GetBlockList request.
|
||||
func (client BlockBlobsClient) getBlockListPreparer(listType BlockListType, snapshot *time.Time, timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
func (client blockBlobsClient) getBlockListPreparer(listType BlockListType, snapshot *time.Time, timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("GET", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -83,7 +83,7 @@ func (client BlockBlobsClient) getBlockListPreparer(listType BlockListType, snap
|
|||
}
|
||||
|
||||
// getBlockListResponder handles the response to the GetBlockList request.
|
||||
func (client BlockBlobsClient) getBlockListResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blockBlobsClient) getBlockListResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -117,7 +117,7 @@ func (client BlockBlobsClient) getBlockListResponder(resp pipeline.Response) (pi
|
|||
// Timeouts for Blob Service Operations.</a> leaseID is if specified, the operation only succeeds if the container's
|
||||
// lease is active and matches this ID. requestID is provides a client-generated, opaque value with a 1 KB character
|
||||
// limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client BlockBlobsClient) PutBlock(ctx context.Context, blockID string, body io.ReadSeeker, timeout *int32, leaseID *string, requestID *string) (*BlockBlobsPutBlockResponse, error) {
|
||||
func (client blockBlobsClient) PutBlock(ctx context.Context, blockID string, body io.ReadSeeker, timeout *int32, leaseID *string, requestID *string) (*BlockBlobsPutBlockResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: body,
|
||||
constraints: []constraint{{target: "body", name: null, rule: true, chain: nil}}},
|
||||
|
@ -138,7 +138,7 @@ func (client BlockBlobsClient) PutBlock(ctx context.Context, blockID string, bod
|
|||
}
|
||||
|
||||
// putBlockPreparer prepares the PutBlock request.
|
||||
func (client BlockBlobsClient) putBlockPreparer(blockID string, body io.ReadSeeker, timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
func (client blockBlobsClient) putBlockPreparer(blockID string, body io.ReadSeeker, timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, body)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -161,7 +161,7 @@ func (client BlockBlobsClient) putBlockPreparer(blockID string, body io.ReadSeek
|
|||
}
|
||||
|
||||
// putBlockResponder handles the response to the PutBlock request.
|
||||
func (client BlockBlobsClient) putBlockResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blockBlobsClient) putBlockResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusCreated)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -198,7 +198,7 @@ func (client BlockBlobsClient) putBlockResponder(resp pipeline.Response) (pipeli
|
|||
// ifNoneMatch is specify an ETag value to operate only on blobs without a matching value. requestID is provides a
|
||||
// client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
|
||||
// analytics logging is enabled.
|
||||
func (client BlockBlobsClient) PutBlockList(ctx context.Context, blocks BlockLookupList, timeout *int32, blobCacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlockBlobsPutBlockListResponse, error) {
|
||||
func (client blockBlobsClient) PutBlockList(ctx context.Context, blocks BlockLookupList, timeout *int32, blobCacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*BlockBlobsPutBlockListResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -220,7 +220,7 @@ func (client BlockBlobsClient) PutBlockList(ctx context.Context, blocks BlockLoo
|
|||
}
|
||||
|
||||
// putBlockListPreparer prepares the PutBlockList request.
|
||||
func (client BlockBlobsClient) putBlockListPreparer(blocks BlockLookupList, timeout *int32, blobCacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client blockBlobsClient) putBlockListPreparer(blocks BlockLookupList, timeout *int32, blobCacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -286,7 +286,7 @@ func (client BlockBlobsClient) putBlockListPreparer(blocks BlockLookupList, time
|
|||
}
|
||||
|
||||
// putBlockListResponder handles the response to the PutBlockList request.
|
||||
func (client BlockBlobsClient) putBlockListResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client blockBlobsClient) putBlockListResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusCreated)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
|
|
@ -13,26 +13,26 @@ const (
|
|||
ServiceVersion = "2016-05-31"
|
||||
)
|
||||
|
||||
// ManagementClient is the base client for Azblob.
|
||||
type ManagementClient struct {
|
||||
// managementClient is the base client for Azblob.
|
||||
type managementClient struct {
|
||||
url url.URL
|
||||
p pipeline.Pipeline
|
||||
}
|
||||
|
||||
// NewManagementClient creates an instance of the ManagementClient client.
|
||||
func NewManagementClient(url url.URL, p pipeline.Pipeline) ManagementClient {
|
||||
return ManagementClient{
|
||||
// newManagementClient creates an instance of the managementClient client.
|
||||
func newManagementClient(url url.URL, p pipeline.Pipeline) managementClient {
|
||||
return managementClient{
|
||||
url: url,
|
||||
p: p,
|
||||
}
|
||||
}
|
||||
|
||||
// URL returns a copy of the URL for this client.
|
||||
func (mc ManagementClient) URL() url.URL {
|
||||
func (mc managementClient) URL() url.URL {
|
||||
return mc.url
|
||||
}
|
||||
|
||||
// Pipeline returns the pipeline for this client.
|
||||
func (mc ManagementClient) Pipeline() pipeline.Pipeline {
|
||||
func (mc managementClient) Pipeline() pipeline.Pipeline {
|
||||
return mc.p
|
||||
}
|
||||
|
|
|
@ -15,14 +15,14 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// ContainerClient is the client for the Container methods of the Azblob service.
|
||||
type ContainerClient struct {
|
||||
ManagementClient
|
||||
// containerClient is the client for the Container methods of the Azblob service.
|
||||
type containerClient struct {
|
||||
managementClient
|
||||
}
|
||||
|
||||
// NewContainerClient creates an instance of the ContainerClient client.
|
||||
func NewContainerClient(url url.URL, p pipeline.Pipeline) ContainerClient {
|
||||
return ContainerClient{NewManagementClient(url, p)}
|
||||
// newContainerClient creates an instance of the containerClient client.
|
||||
func newContainerClient(url url.URL, p pipeline.Pipeline) containerClient {
|
||||
return containerClient{newManagementClient(url, p)}
|
||||
}
|
||||
|
||||
// Create creates a new container under the specified account. If the container with the same name already exists, the
|
||||
|
@ -38,7 +38,7 @@ func NewContainerClient(url url.URL, p pipeline.Pipeline) ContainerClient {
|
|||
// Containers, Blobs, and Metadata for more information. access is specifies whether data in the container may be
|
||||
// accessed publicly and the level of access requestID is provides a client-generated, opaque value with a 1 KB
|
||||
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client ContainerClient) Create(ctx context.Context, timeout *int32, metadata map[string]string, access PublicAccessType, requestID *string) (*ContainerCreateResponse, error) {
|
||||
func (client containerClient) Create(ctx context.Context, timeout *int32, metadata map[string]string, access PublicAccessType, requestID *string) (*ContainerCreateResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -60,7 +60,7 @@ func (client ContainerClient) Create(ctx context.Context, timeout *int32, metada
|
|||
}
|
||||
|
||||
// createPreparer prepares the Create request.
|
||||
func (client ContainerClient) createPreparer(timeout *int32, metadata map[string]string, access PublicAccessType, requestID *string) (pipeline.Request, error) {
|
||||
func (client containerClient) createPreparer(timeout *int32, metadata map[string]string, access PublicAccessType, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -87,7 +87,7 @@ func (client ContainerClient) createPreparer(timeout *int32, metadata map[string
|
|||
}
|
||||
|
||||
// createResponder handles the response to the Create request.
|
||||
func (client ContainerClient) createResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client containerClient) createResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusCreated)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -107,7 +107,7 @@ func (client ContainerClient) createResponder(resp pipeline.Response) (pipeline.
|
|||
// on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching
|
||||
// value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
|
||||
// analytics logs when storage analytics logging is enabled.
|
||||
func (client ContainerClient) Delete(ctx context.Context, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*ContainerDeleteResponse, error) {
|
||||
func (client containerClient) Delete(ctx context.Context, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*ContainerDeleteResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -126,7 +126,7 @@ func (client ContainerClient) Delete(ctx context.Context, timeout *int32, leaseI
|
|||
}
|
||||
|
||||
// deletePreparer prepares the Delete request.
|
||||
func (client ContainerClient) deletePreparer(timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client containerClient) deletePreparer(timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("DELETE", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -160,7 +160,7 @@ func (client ContainerClient) deletePreparer(timeout *int32, leaseID *string, if
|
|||
}
|
||||
|
||||
// deleteResponder handles the response to the Delete request.
|
||||
func (client ContainerClient) deleteResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client containerClient) deleteResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusAccepted)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -175,7 +175,7 @@ func (client ContainerClient) deleteResponder(resp pipeline.Response) (pipeline.
|
|||
// Timeouts for Blob Service Operations.</a> leaseID is if specified, the operation only succeeds if the container's
|
||||
// lease is active and matches this ID. requestID is provides a client-generated, opaque value with a 1 KB character
|
||||
// limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client ContainerClient) GetACL(ctx context.Context, timeout *int32, leaseID *string, requestID *string) (*SignedIdentifiers, error) {
|
||||
func (client containerClient) GetACL(ctx context.Context, timeout *int32, leaseID *string, requestID *string) (*SignedIdentifiers, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -194,7 +194,7 @@ func (client ContainerClient) GetACL(ctx context.Context, timeout *int32, leaseI
|
|||
}
|
||||
|
||||
// getACLPreparer prepares the GetACL request.
|
||||
func (client ContainerClient) getACLPreparer(timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
func (client containerClient) getACLPreparer(timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("GET", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -217,7 +217,7 @@ func (client ContainerClient) getACLPreparer(timeout *int32, leaseID *string, re
|
|||
}
|
||||
|
||||
// getACLResponder handles the response to the GetACL request.
|
||||
func (client ContainerClient) getACLResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client containerClient) getACLResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -247,7 +247,7 @@ func (client ContainerClient) getACLResponder(resp pipeline.Response) (pipeline.
|
|||
// Timeouts for Blob Service Operations.</a> leaseID is if specified, the operation only succeeds if the container's
|
||||
// lease is active and matches this ID. requestID is provides a client-generated, opaque value with a 1 KB character
|
||||
// limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client ContainerClient) GetMetadata(ctx context.Context, timeout *int32, leaseID *string, requestID *string) (*ContainerGetMetadataResponse, error) {
|
||||
func (client containerClient) GetMetadata(ctx context.Context, timeout *int32, leaseID *string, requestID *string) (*ContainerGetMetadataResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -266,7 +266,7 @@ func (client ContainerClient) GetMetadata(ctx context.Context, timeout *int32, l
|
|||
}
|
||||
|
||||
// getMetadataPreparer prepares the GetMetadata request.
|
||||
func (client ContainerClient) getMetadataPreparer(timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
func (client containerClient) getMetadataPreparer(timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("GET", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -289,7 +289,7 @@ func (client ContainerClient) getMetadataPreparer(timeout *int32, leaseID *strin
|
|||
}
|
||||
|
||||
// getMetadataResponder handles the response to the GetMetadata request.
|
||||
func (client ContainerClient) getMetadataResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client containerClient) getMetadataResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -305,7 +305,7 @@ func (client ContainerClient) getMetadataResponder(resp pipeline.Response) (pipe
|
|||
// Timeouts for Blob Service Operations.</a> leaseID is if specified, the operation only succeeds if the container's
|
||||
// lease is active and matches this ID. requestID is provides a client-generated, opaque value with a 1 KB character
|
||||
// limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client ContainerClient) GetProperties(ctx context.Context, timeout *int32, leaseID *string, requestID *string) (*ContainerGetPropertiesResponse, error) {
|
||||
func (client containerClient) GetProperties(ctx context.Context, timeout *int32, leaseID *string, requestID *string) (*ContainerGetPropertiesResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -324,7 +324,7 @@ func (client ContainerClient) GetProperties(ctx context.Context, timeout *int32,
|
|||
}
|
||||
|
||||
// getPropertiesPreparer prepares the GetProperties request.
|
||||
func (client ContainerClient) getPropertiesPreparer(timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
func (client containerClient) getPropertiesPreparer(timeout *int32, leaseID *string, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("GET", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -346,7 +346,7 @@ func (client ContainerClient) getPropertiesPreparer(timeout *int32, leaseID *str
|
|||
}
|
||||
|
||||
// getPropertiesResponder handles the response to the GetProperties request.
|
||||
func (client ContainerClient) getPropertiesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client containerClient) getPropertiesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -375,7 +375,7 @@ func (client ContainerClient) getPropertiesResponder(resp pipeline.Response) (pi
|
|||
// on a blob if it has not been modified since the specified date/time. requestID is provides a client-generated,
|
||||
// opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is
|
||||
// enabled.
|
||||
func (client ContainerClient) Lease(ctx context.Context, action LeaseActionType, timeout *int32, leaseID *string, breakPeriod *int32, duration *int32, proposedLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, requestID *string) (*ContainerLeaseResponse, error) {
|
||||
func (client containerClient) Lease(ctx context.Context, action LeaseActionType, timeout *int32, leaseID *string, breakPeriod *int32, duration *int32, proposedLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, requestID *string) (*ContainerLeaseResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -394,7 +394,7 @@ func (client ContainerClient) Lease(ctx context.Context, action LeaseActionType,
|
|||
}
|
||||
|
||||
// leasePreparer prepares the Lease request.
|
||||
func (client ContainerClient) leasePreparer(action LeaseActionType, timeout *int32, leaseID *string, breakPeriod *int32, duration *int32, proposedLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, requestID *string) (pipeline.Request, error) {
|
||||
func (client containerClient) leasePreparer(action LeaseActionType, timeout *int32, leaseID *string, breakPeriod *int32, duration *int32, proposedLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -433,7 +433,7 @@ func (client ContainerClient) leasePreparer(action LeaseActionType, timeout *int
|
|||
}
|
||||
|
||||
// leaseResponder handles the response to the Lease request.
|
||||
func (client ContainerClient) leaseResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client containerClient) leaseResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -460,7 +460,7 @@ func (client ContainerClient) leaseResponder(resp pipeline.Response) (pipeline.R
|
|||
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
|
||||
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
|
||||
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client ContainerClient) ListBlobs(ctx context.Context, prefix *string, delimiter *string, marker *string, maxresults *int32, include ListBlobsIncludeType, timeout *int32, requestID *string) (*ListBlobsResponse, error) {
|
||||
func (client containerClient) ListBlobs(ctx context.Context, prefix *string, delimiter *string, marker *string, maxresults *int32, include ListBlobsIncludeType, timeout *int32, requestID *string) (*ListBlobsResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: maxresults,
|
||||
constraints: []constraint{{target: "maxresults", name: null, rule: false,
|
||||
|
@ -482,7 +482,7 @@ func (client ContainerClient) ListBlobs(ctx context.Context, prefix *string, del
|
|||
}
|
||||
|
||||
// listBlobsPreparer prepares the ListBlobs request.
|
||||
func (client ContainerClient) listBlobsPreparer(prefix *string, delimiter *string, marker *string, maxresults *int32, include ListBlobsIncludeType, timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
func (client containerClient) listBlobsPreparer(prefix *string, delimiter *string, marker *string, maxresults *int32, include ListBlobsIncludeType, timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("GET", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -517,7 +517,7 @@ func (client ContainerClient) listBlobsPreparer(prefix *string, delimiter *strin
|
|||
}
|
||||
|
||||
// listBlobsResponder handles the response to the ListBlobs request.
|
||||
func (client ContainerClient) listBlobsResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client containerClient) listBlobsResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -553,7 +553,7 @@ func (client ContainerClient) listBlobsResponder(resp pipeline.Response) (pipeli
|
|||
// matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value. requestID is
|
||||
// provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when
|
||||
// storage analytics logging is enabled.
|
||||
func (client ContainerClient) SetACL(ctx context.Context, containerACL []SignedIdentifier, timeout *int32, leaseID *string, access PublicAccessType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*ContainerSetACLResponse, error) {
|
||||
func (client containerClient) SetACL(ctx context.Context, containerACL []SignedIdentifier, timeout *int32, leaseID *string, access PublicAccessType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*ContainerSetACLResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -572,7 +572,7 @@ func (client ContainerClient) SetACL(ctx context.Context, containerACL []SignedI
|
|||
}
|
||||
|
||||
// setACLPreparer prepares the SetACL request.
|
||||
func (client ContainerClient) setACLPreparer(containerACL []SignedIdentifier, timeout *int32, leaseID *string, access PublicAccessType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client containerClient) setACLPreparer(containerACL []SignedIdentifier, timeout *int32, leaseID *string, access PublicAccessType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -619,7 +619,7 @@ func (client ContainerClient) setACLPreparer(containerACL []SignedIdentifier, ti
|
|||
}
|
||||
|
||||
// setACLResponder handles the response to the SetACL request.
|
||||
func (client ContainerClient) setACLResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client containerClient) setACLResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -640,7 +640,7 @@ func (client ContainerClient) setACLResponder(resp pipeline.Response) (pipeline.
|
|||
// Containers, Blobs, and Metadata for more information. ifModifiedSince is specify this header value to operate only
|
||||
// on a blob if it has been modified since the specified date/time. requestID is provides a client-generated, opaque
|
||||
// value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client ContainerClient) SetMetadata(ctx context.Context, timeout *int32, leaseID *string, metadata map[string]string, ifModifiedSince *time.Time, requestID *string) (*ContainerSetMetadataResponse, error) {
|
||||
func (client containerClient) SetMetadata(ctx context.Context, timeout *int32, leaseID *string, metadata map[string]string, ifModifiedSince *time.Time, requestID *string) (*ContainerSetMetadataResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -662,7 +662,7 @@ func (client ContainerClient) SetMetadata(ctx context.Context, timeout *int32, l
|
|||
}
|
||||
|
||||
// setMetadataPreparer prepares the SetMetadata request.
|
||||
func (client ContainerClient) setMetadataPreparer(timeout *int32, leaseID *string, metadata map[string]string, ifModifiedSince *time.Time, requestID *string) (pipeline.Request, error) {
|
||||
func (client containerClient) setMetadataPreparer(timeout *int32, leaseID *string, metadata map[string]string, ifModifiedSince *time.Time, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -693,7 +693,7 @@ func (client ContainerClient) setMetadataPreparer(timeout *int32, leaseID *strin
|
|||
}
|
||||
|
||||
// setMetadataResponder handles the response to the SetMetadata request.
|
||||
func (client ContainerClient) setMetadataResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client containerClient) setMetadataResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
|
|
@ -2044,11 +2044,6 @@ func (gr GetResponse) BlobCommittedBlockCount() string {
|
|||
return gr.rawResponse.Header.Get("x-ms-blob-committed-block-count")
|
||||
}
|
||||
|
||||
// BlobContentMD5 returns the value for header x-ms-blob-content-md5.
|
||||
func (gr GetResponse) BlobContentMD5() string {
|
||||
return gr.rawResponse.Header.Get("x-ms-blob-content-md5")
|
||||
}
|
||||
|
||||
// BlobSequenceNumber returns the value for header x-ms-blob-sequence-number.
|
||||
func (gr GetResponse) BlobSequenceNumber() string {
|
||||
return gr.rawResponse.Header.Get("x-ms-blob-sequence-number")
|
||||
|
|
|
@ -15,14 +15,14 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// PageBlobsClient is the client for the PageBlobs methods of the Azblob service.
|
||||
type PageBlobsClient struct {
|
||||
ManagementClient
|
||||
// pageBlobsClient is the client for the PageBlobs methods of the Azblob service.
|
||||
type pageBlobsClient struct {
|
||||
managementClient
|
||||
}
|
||||
|
||||
// NewPageBlobsClient creates an instance of the PageBlobsClient client.
|
||||
func NewPageBlobsClient(url url.URL, p pipeline.Pipeline) PageBlobsClient {
|
||||
return PageBlobsClient{NewManagementClient(url, p)}
|
||||
// newPageBlobsClient creates an instance of the pageBlobsClient client.
|
||||
func newPageBlobsClient(url url.URL, p pipeline.Pipeline) pageBlobsClient {
|
||||
return pageBlobsClient{newManagementClient(url, p)}
|
||||
}
|
||||
|
||||
// GetPageRanges the Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a
|
||||
|
@ -45,7 +45,7 @@ func NewPageBlobsClient(url url.URL, p pipeline.Pipeline) PageBlobsClient {
|
|||
// with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value.
|
||||
// requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics
|
||||
// logs when storage analytics logging is enabled.
|
||||
func (client PageBlobsClient) GetPageRanges(ctx context.Context, snapshot *time.Time, timeout *int32, prevsnapshot *time.Time, rangeParameter *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageList, error) {
|
||||
func (client pageBlobsClient) GetPageRanges(ctx context.Context, snapshot *time.Time, timeout *int32, prevsnapshot *time.Time, rangeParameter *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageList, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -64,7 +64,7 @@ func (client PageBlobsClient) GetPageRanges(ctx context.Context, snapshot *time.
|
|||
}
|
||||
|
||||
// getPageRangesPreparer prepares the GetPageRanges request.
|
||||
func (client PageBlobsClient) getPageRangesPreparer(snapshot *time.Time, timeout *int32, prevsnapshot *time.Time, rangeParameter *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client pageBlobsClient) getPageRangesPreparer(snapshot *time.Time, timeout *int32, prevsnapshot *time.Time, rangeParameter *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("GET", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -107,7 +107,7 @@ func (client PageBlobsClient) getPageRangesPreparer(snapshot *time.Time, timeout
|
|||
}
|
||||
|
||||
// getPageRangesResponder handles the response to the GetPageRanges request.
|
||||
func (client PageBlobsClient) getPageRangesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client pageBlobsClient) getPageRangesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -151,7 +151,7 @@ func (client PageBlobsClient) getPageRangesResponder(resp pipeline.Response) (pi
|
|||
// to operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs
|
||||
// without a matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is
|
||||
// recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client PageBlobsClient) IncrementalCopy(ctx context.Context, copySource string, timeout *int32, metadata map[string]string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageBlobsIncrementalCopyResponse, error) {
|
||||
func (client pageBlobsClient) IncrementalCopy(ctx context.Context, copySource string, timeout *int32, metadata map[string]string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageBlobsIncrementalCopyResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -173,7 +173,7 @@ func (client PageBlobsClient) IncrementalCopy(ctx context.Context, copySource st
|
|||
}
|
||||
|
||||
// incrementalCopyPreparer prepares the IncrementalCopy request.
|
||||
func (client PageBlobsClient) incrementalCopyPreparer(copySource string, timeout *int32, metadata map[string]string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client pageBlobsClient) incrementalCopyPreparer(copySource string, timeout *int32, metadata map[string]string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -210,7 +210,7 @@ func (client PageBlobsClient) incrementalCopyPreparer(copySource string, timeout
|
|||
}
|
||||
|
||||
// incrementalCopyResponder handles the response to the IncrementalCopy request.
|
||||
func (client PageBlobsClient) incrementalCopyResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client pageBlobsClient) incrementalCopyResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusAccepted)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -239,7 +239,7 @@ func (client PageBlobsClient) incrementalCopyResponder(resp pipeline.Response) (
|
|||
// to operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs
|
||||
// without a matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is
|
||||
// recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client PageBlobsClient) PutPage(ctx context.Context, pageWrite PageWriteType, body io.ReadSeeker, timeout *int32, rangeParameter *string, leaseID *string, ifSequenceNumberLessThanOrEqualTo *int32, ifSequenceNumberLessThan *int32, ifSequenceNumberEqualTo *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageBlobsPutPageResponse, error) {
|
||||
func (client pageBlobsClient) PutPage(ctx context.Context, pageWrite PageWriteType, body io.ReadSeeker, timeout *int32, rangeParameter *string, leaseID *string, ifSequenceNumberLessThanOrEqualTo *int32, ifSequenceNumberLessThan *int32, ifSequenceNumberEqualTo *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageBlobsPutPageResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -258,7 +258,7 @@ func (client PageBlobsClient) PutPage(ctx context.Context, pageWrite PageWriteTy
|
|||
}
|
||||
|
||||
// putPagePreparer prepares the PutPage request.
|
||||
func (client PageBlobsClient) putPagePreparer(pageWrite PageWriteType, body io.ReadSeeker, timeout *int32, rangeParameter *string, leaseID *string, ifSequenceNumberLessThanOrEqualTo *int32, ifSequenceNumberLessThan *int32, ifSequenceNumberEqualTo *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
func (client pageBlobsClient) putPagePreparer(pageWrite PageWriteType, body io.ReadSeeker, timeout *int32, rangeParameter *string, leaseID *string, ifSequenceNumberLessThanOrEqualTo *int32, ifSequenceNumberLessThan *int32, ifSequenceNumberEqualTo *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, body)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -305,7 +305,7 @@ func (client PageBlobsClient) putPagePreparer(pageWrite PageWriteType, body io.R
|
|||
}
|
||||
|
||||
// putPageResponder handles the response to the PutPage request.
|
||||
func (client PageBlobsClient) putPageResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client pageBlobsClient) putPageResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusCreated)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
|
|
@ -6,8 +6,9 @@ package azblob
|
|||
import (
|
||||
"context"
|
||||
"encoding/xml"
|
||||
"github.com/Azure/azure-pipeline-go/pipeline"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/Azure/azure-pipeline-go/pipeline"
|
||||
)
|
||||
|
||||
type responder func(resp pipeline.Response) (result pipeline.Response, err error)
|
||||
|
@ -18,18 +19,18 @@ type responderPolicyFactory struct {
|
|||
}
|
||||
|
||||
// New creates a responder policy factory.
|
||||
func (arpf responderPolicyFactory) New(node pipeline.Node) pipeline.Policy {
|
||||
return responderPolicy{node: node, responder: arpf.responder}
|
||||
func (arpf responderPolicyFactory) New(next pipeline.Policy, config *pipeline.Configuration) pipeline.Policy {
|
||||
return responderPolicy{next: next, responder: arpf.responder}
|
||||
}
|
||||
|
||||
type responderPolicy struct {
|
||||
node pipeline.Node
|
||||
next pipeline.Policy
|
||||
responder responder
|
||||
}
|
||||
|
||||
// Do sends the request to the service and validates/deserializes the HTTP response.
|
||||
func (arp responderPolicy) Do(ctx context.Context, request pipeline.Request) (pipeline.Response, error) {
|
||||
resp, err := arp.node.Do(ctx, request)
|
||||
resp, err := arp.next.Do(ctx, request)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
|
|
|
@ -14,14 +14,14 @@ import (
|
|||
"net/url"
|
||||
)
|
||||
|
||||
// ServiceClient is the client for the Service methods of the Azblob service.
|
||||
type ServiceClient struct {
|
||||
ManagementClient
|
||||
// serviceClient is the client for the Service methods of the Azblob service.
|
||||
type serviceClient struct {
|
||||
managementClient
|
||||
}
|
||||
|
||||
// NewServiceClient creates an instance of the ServiceClient client.
|
||||
func NewServiceClient(url url.URL, p pipeline.Pipeline) ServiceClient {
|
||||
return ServiceClient{NewManagementClient(url, p)}
|
||||
// newServiceClient creates an instance of the serviceClient client.
|
||||
func newServiceClient(url url.URL, p pipeline.Pipeline) serviceClient {
|
||||
return serviceClient{newManagementClient(url, p)}
|
||||
}
|
||||
|
||||
// GetProperties gets the properties of a storage account's Blob service, including properties for Storage Analytics
|
||||
|
@ -31,7 +31,7 @@ func NewServiceClient(url url.URL, p pipeline.Pipeline) ServiceClient {
|
|||
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
|
||||
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
|
||||
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client ServiceClient) GetProperties(ctx context.Context, timeout *int32, requestID *string) (*StorageServiceProperties, error) {
|
||||
func (client serviceClient) GetProperties(ctx context.Context, timeout *int32, requestID *string) (*StorageServiceProperties, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -50,7 +50,7 @@ func (client ServiceClient) GetProperties(ctx context.Context, timeout *int32, r
|
|||
}
|
||||
|
||||
// getPropertiesPreparer prepares the GetProperties request.
|
||||
func (client ServiceClient) getPropertiesPreparer(timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
func (client serviceClient) getPropertiesPreparer(timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("GET", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -70,7 +70,7 @@ func (client ServiceClient) getPropertiesPreparer(timeout *int32, requestID *str
|
|||
}
|
||||
|
||||
// getPropertiesResponder handles the response to the GetProperties request.
|
||||
func (client ServiceClient) getPropertiesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client serviceClient) getPropertiesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -100,7 +100,7 @@ func (client ServiceClient) getPropertiesResponder(resp pipeline.Response) (pipe
|
|||
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
|
||||
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
|
||||
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client ServiceClient) GetStats(ctx context.Context, timeout *int32, requestID *string) (*StorageServiceStats, error) {
|
||||
func (client serviceClient) GetStats(ctx context.Context, timeout *int32, requestID *string) (*StorageServiceStats, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: timeout,
|
||||
constraints: []constraint{{target: "timeout", name: null, rule: false,
|
||||
|
@ -119,7 +119,7 @@ func (client ServiceClient) GetStats(ctx context.Context, timeout *int32, reques
|
|||
}
|
||||
|
||||
// getStatsPreparer prepares the GetStats request.
|
||||
func (client ServiceClient) getStatsPreparer(timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
func (client serviceClient) getStatsPreparer(timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("GET", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -139,7 +139,7 @@ func (client ServiceClient) getStatsPreparer(timeout *int32, requestID *string)
|
|||
}
|
||||
|
||||
// getStatsResponder handles the response to the GetStats request.
|
||||
func (client ServiceClient) getStatsResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client serviceClient) getStatsResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -179,7 +179,7 @@ func (client ServiceClient) getStatsResponder(resp pipeline.Response) (pipeline.
|
|||
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
|
||||
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
|
||||
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client ServiceClient) ListContainers(ctx context.Context, prefix *string, marker *string, maxresults *int32, include ListContainersIncludeType, timeout *int32, requestID *string) (*ListContainersResponse, error) {
|
||||
func (client serviceClient) ListContainers(ctx context.Context, prefix *string, marker *string, maxresults *int32, include ListContainersIncludeType, timeout *int32, requestID *string) (*ListContainersResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: maxresults,
|
||||
constraints: []constraint{{target: "maxresults", name: null, rule: false,
|
||||
|
@ -201,7 +201,7 @@ func (client ServiceClient) ListContainers(ctx context.Context, prefix *string,
|
|||
}
|
||||
|
||||
// listContainersPreparer prepares the ListContainers request.
|
||||
func (client ServiceClient) listContainersPreparer(prefix *string, marker *string, maxresults *int32, include ListContainersIncludeType, timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
func (client serviceClient) listContainersPreparer(prefix *string, marker *string, maxresults *int32, include ListContainersIncludeType, timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("GET", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -232,7 +232,7 @@ func (client ServiceClient) listContainersPreparer(prefix *string, marker *strin
|
|||
}
|
||||
|
||||
// listContainersResponder handles the response to the ListContainers request.
|
||||
func (client ServiceClient) listContainersResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client serviceClient) listContainersResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
@ -263,7 +263,7 @@ func (client ServiceClient) listContainersResponder(resp pipeline.Response) (pip
|
|||
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
|
||||
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
|
||||
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
|
||||
func (client ServiceClient) SetProperties(ctx context.Context, storageServiceProperties StorageServiceProperties, timeout *int32, requestID *string) (*ServiceSetPropertiesResponse, error) {
|
||||
func (client serviceClient) SetProperties(ctx context.Context, storageServiceProperties StorageServiceProperties, timeout *int32, requestID *string) (*ServiceSetPropertiesResponse, error) {
|
||||
if err := validate([]validation{
|
||||
{targetValue: storageServiceProperties,
|
||||
constraints: []constraint{{target: "storageServiceProperties.Logging", name: null, rule: true,
|
||||
|
@ -315,7 +315,7 @@ func (client ServiceClient) SetProperties(ctx context.Context, storageServicePro
|
|||
}
|
||||
|
||||
// setPropertiesPreparer prepares the SetProperties request.
|
||||
func (client ServiceClient) setPropertiesPreparer(storageServiceProperties StorageServiceProperties, timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
func (client serviceClient) setPropertiesPreparer(storageServiceProperties StorageServiceProperties, timeout *int32, requestID *string) (pipeline.Request, error) {
|
||||
req, err := pipeline.NewRequest("PUT", client.url, nil)
|
||||
if err != nil {
|
||||
return req, pipeline.NewError(err, "failed to create request")
|
||||
|
@ -344,7 +344,7 @@ func (client ServiceClient) setPropertiesPreparer(storageServiceProperties Stora
|
|||
}
|
||||
|
||||
// setPropertiesResponder handles the response to the SetProperties request.
|
||||
func (client ServiceClient) setPropertiesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
func (client serviceClient) setPropertiesResponder(resp pipeline.Response) (pipeline.Response, error) {
|
||||
err := validateResponse(resp, http.StatusOK, http.StatusAccepted)
|
||||
if resp == nil {
|
||||
return nil, err
|
||||
|
|
Загрузка…
Ссылка в новой задаче