Documentation ¶
Index ¶
- func RequestRecorder(requests *[]*http.Request) autorest.PrepareDecorator
- type MockSender
- type MockStorageBlob
- type MockStorageClient
- func (c *MockStorageClient) GetBlobService() azurestorage.BlobStorageClient
- func (c *MockStorageClient) GetContainerReference(name string) azurestorage.Container
- func (c *MockStorageClient) NewClient(accountName, accountKey, blobServiceBaseURL, apiVersion string, useHTTPS bool) (azurestorage.Client, error)
- type MockStorageContainer
- type Senders
- type SerialSender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestRecorder ¶
func RequestRecorder(requests *[]*http.Request) autorest.PrepareDecorator
RequestRecorder returns an autorest.PrepareDecorator that records requests to ghe given slice.
Types ¶
type MockSender ¶
type MockSender struct { *mocks.Sender // PathPattern, if non-empty, is assumed to be a regular expression // that must match the request path. PathPattern string }
MockSender is a wrapper around autorest/mocks.Sender, extending it with request path checking to ease testing.
func NewSenderWithValue ¶
func NewSenderWithValue(v interface{}) *MockSender
NewSenderWithValue returns a *mocks.Sender that marshals the provided object to JSON and sets it as the content. This function will panic if marshalling fails.
type MockStorageBlob ¶
type MockStorageBlob struct { testing.Stub Name_ string Properties_ storage.BlobProperties }
func (*MockStorageBlob) DeleteIfExists ¶
func (c *MockStorageBlob) DeleteIfExists(opts *storage.DeleteBlobOptions) (bool, error)
func (*MockStorageBlob) Name ¶
func (c *MockStorageBlob) Name() string
func (*MockStorageBlob) Properties ¶
func (c *MockStorageBlob) Properties() storage.BlobProperties
type MockStorageClient ¶
type MockStorageClient struct { testing.Stub Containers map[string]azurestorage.Container }
func (*MockStorageClient) GetBlobService ¶
func (c *MockStorageClient) GetBlobService() azurestorage.BlobStorageClient
func (*MockStorageClient) GetContainerReference ¶
func (c *MockStorageClient) GetContainerReference(name string) azurestorage.Container
func (*MockStorageClient) NewClient ¶
func (c *MockStorageClient) NewClient( accountName, accountKey, blobServiceBaseURL, apiVersion string, useHTTPS bool, ) (azurestorage.Client, error)
NewClient exists to satisfy users who want a NewClientFunc.
type MockStorageContainer ¶
type MockStorageContainer struct { testing.Stub Blobs_ []azurestorage.Blob }
func (*MockStorageContainer) Blob ¶
func (c *MockStorageContainer) Blob(name string) azurestorage.Blob
func (*MockStorageContainer) Blobs ¶
func (c *MockStorageContainer) Blobs() ([]azurestorage.Blob, error)
type Senders ¶
Senders is a Sender that includes a collection of Senders, which will be called in sequence.
type SerialSender ¶
type SerialSender struct {
// contains filtered or unexported fields
}
SerialSender is a Sender that permits only one active Do call at a time.
func NewSerialSender ¶
func NewSerialSender(s autorest.Sender) *SerialSender
Click to show internal directories.
Click to hide internal directories.