package swifttest
import "github.com/ncw/swift/swifttest"
This implements a very basic Swift server Everything is stored in memory
This comes from the https://github.com/mitchellh/goamz and was adapted for Swift
Index ¶
- Variables
- type AutoExtractResponse
- type Folder
- type HandlerOverrideFunc
- type Key
- type Subdir
- type SwiftServer
Variables ¶
var ( DEBUG = false TEST_ACCOUNT = "swifttest" )
Types ¶
type AutoExtractResponse ¶
type AutoExtractResponse struct { CreatedFiles int64 `json:"Number Files Created"` Status string `json:"Response Status"` Errors [][]string `json:"Errors"` }
type Folder ¶
type Folder struct { Count int64 `json:"count"` Bytes int64 `json:"bytes"` Name string `json:"name"` }
The Folder type represents a container stored in an account
type HandlerOverrideFunc ¶
type HandlerOverrideFunc func(w http.ResponseWriter, r *http.Request, recorder *httptest.ResponseRecorder)
type Key ¶
type Key struct { Key string `json:"name"` LastModified string `json:"last_modified"` Size int64 `json:"bytes"` // ETag gives the hex-encoded MD5 sum of the contents, // surrounded with double-quotes. ETag string `json:"hash"` ContentType string `json:"content_type"` }
The Key type represents an item stored in an container.
type Subdir ¶
type Subdir struct { Subdir string `json:"subdir"` }
type SwiftServer ¶
type SwiftServer struct { sync.RWMutex Listener net.Listener AuthURL string URL string Accounts map[string]*account Sessions map[string]*session // contains filtered or unexported fields }
func NewSwiftServer ¶
func NewSwiftServer(address string) (*SwiftServer, error)
func (*SwiftServer) Close ¶
func (srv *SwiftServer) Close()
func (*SwiftServer) SetOverride ¶
func (s *SwiftServer) SetOverride(path string, fn HandlerOverrideFunc)
func (*SwiftServer) UnsetOverride ¶
func (s *SwiftServer) UnsetOverride(path string)
Source Files ¶
- Version
- v1.0.53 (latest)
- Published
- Jan 21, 2021
- Platform
- js/wasm
- Imports
- 29 packages
- Last checked
- 1 week ago –
Tools for package owners.