Documentation ¶
Index ¶
Constants ¶
View Source
const (
// StorageAPIVersion is the API version this mock server follows.
StorageAPIVersion = "2017-06-01"
)
Variables ¶
This section is empty.
Functions ¶
func NewForwardTransport ¶
func NewForwardTransport(target *url.URL, parent http.RoundTripper) http.RoundTripper
NewForwardTransport creates a round tripper which forwards requests to a given target's host. It also sends request a given parent round tripper. If the parent is not given, http.DefaultTransport will be used.
Types ¶
type ForwardTransport ¶
type ForwardTransport struct {
// contains filtered or unexported fields
}
ForwardTransport is a http.RoundTripper which forwards requests to a given target URL's host.
type Object ¶
type Object struct { Body string Properties storage.BlobProperties Metadata map[string][]string }
Object represents an object stored in StorageServer.
type StorageServer ¶
type StorageServer struct { // Items hold blob items in this mock server. This is a map of which keys // represent container names and the associated value represents a container. Items map[string]Container // contains filtered or unexported fields }
StorageServer provides a mocked server. See https://docs.microsoft.com/en-us/rest/api/storageservices/
func NewStorageServer ¶
func NewStorageServer() (res *StorageServer)
NewStorageServer creates a new mock storage server.
func (*StorageServer) GetClient ¶
func (s *StorageServer) GetClient() (cli storage.Client, err error)
GetClient returns a storage client which is forareded to this mock server.
func (*StorageServer) ServeHTTP ¶
func (s *StorageServer) ServeHTTP(res http.ResponseWriter, req *http.Request)
ServeHTTP handles requests.
Click to show internal directories.
Click to hide internal directories.