Documentation ¶
Index ¶
- Constants
- Variables
- func NewSkipReader(r io.Reader, offset uint64) io.Reader
- func SerializeBlocklistXML(bl *XBlockListOut) ([]byte, error)
- func UseBuiltinCompression() bool
- type Block
- type DebugResponseWriter
- type Index
- func (idx *Index) Clear() []string
- func (idx *Index) GetBlockList(ltype string) *XBlockListOut
- func (idx *Index) GetSections(rangeMin, rangeMax uint64) []Section
- func (idx *Index) Load() error
- func (idx *Index) PutBlock(id string, size uint64) string
- func (idx *Index) PutBlockList(xblocklist *XBlockListIn) ([]string, error)
- func (idx *Index) Save() error
- func (idx *Index) SaveDelayed()
- type Lease
- type Section
- type Server
- func (bs *Server) AcquireLock() (io.Closer, error)
- func (bs *Server) HandleAcquireLease(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleBlob(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleBlobDelete(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleBlobGet(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleBlobHead(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleBlobPut(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleBlock(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleBlockList(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleBlockListGet(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleBlockListPut(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleBlockPut(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleChangeLease(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleLease(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleReleaseLease(w http.ResponseWriter, req *http.Request)
- func (bs *Server) HandleRenewLease(w http.ResponseWriter, req *http.Request)
- func (bs *Server) Run(ctx context.Context) error
- func (bs *Server) RunBackground(ctx context.Context, cancel context.CancelFunc) error
- func (bs *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (bs *Server) ServeHTTP2(w http.ResponseWriter, req *http.Request)
- func (bs *Server) Shutdown() error
- func (bs *Server) WaitReady(ctx context.Context, timeout time.Duration) error
- type SkipReader
- type XBlockIn
- type XBlockListIn
- type XBlockListOut
- type XBlockOut
Constants ¶
View Source
const ( BlockListTag = "BlockList" BlockLatest = "Latest" BlockCommitted = "Committed" BlockUncommitted = "Uncommitted" BlockAll = "All" )
View Source
const BgSaveInterval = 30 * time.Second
View Source
const BlockReadCacheSize = 16
View Source
const DefaultConcurrency = 8
View Source
const IndexFileName = "__blob_index.json"
View Source
const MaxCacheBlockSize = 16 * 1024 * 1024 // 16M
View Source
const ProxyStartTimeout = 10 * time.Second
View Source
const ReqIDHeader = "X-Ms-Request-Id"
View Source
const SQLServerCompressionMethod = "sqlserver"
Variables ¶
View Source
var ErrBadRequest = errors.New("invalid request")
View Source
var ErrNoLease = errors.New("no lease")
View Source
var ErrNotFound = errors.New("object not found")
Functions ¶
func SerializeBlocklistXML ¶
func SerializeBlocklistXML(bl *XBlockListOut) ([]byte, error)
func UseBuiltinCompression ¶
func UseBuiltinCompression() bool
Types ¶
type DebugResponseWriter ¶
type DebugResponseWriter struct {
// contains filtered or unexported fields
}
func (*DebugResponseWriter) Header ¶
func (drw *DebugResponseWriter) Header() http.Header
func (*DebugResponseWriter) WriteHeader ¶
func (drw *DebugResponseWriter) WriteHeader(s int)
type Index ¶
type Index struct { sync.Mutex Size uint64 `json:"size"` Blocks []*Block `json:"blocks"` Compression string `json:"compression"` Encryption string `json:"encryption"` // contains filtered or unexported fields }
func (*Index) GetBlockList ¶
func (idx *Index) GetBlockList(ltype string) *XBlockListOut
func (*Index) GetSections ¶
func (*Index) PutBlockList ¶
func (idx *Index) PutBlockList(xblocklist *XBlockListIn) ([]string, error)
nolint: funlen,gocyclo
func (*Index) SaveDelayed ¶
func (idx *Index) SaveDelayed()
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) HandleAcquireLease ¶
func (bs *Server) HandleAcquireLease(w http.ResponseWriter, req *http.Request)
func (*Server) HandleBlob ¶
func (bs *Server) HandleBlob(w http.ResponseWriter, req *http.Request)
Index operations
func (*Server) HandleBlobDelete ¶
func (bs *Server) HandleBlobDelete(w http.ResponseWriter, req *http.Request)
func (*Server) HandleBlobGet ¶
func (bs *Server) HandleBlobGet(w http.ResponseWriter, req *http.Request)
func (*Server) HandleBlobHead ¶
func (bs *Server) HandleBlobHead(w http.ResponseWriter, req *http.Request)
func (*Server) HandleBlobPut ¶
func (bs *Server) HandleBlobPut(w http.ResponseWriter, req *http.Request)
func (*Server) HandleBlock ¶
func (bs *Server) HandleBlock(w http.ResponseWriter, req *http.Request)
Block operations
func (*Server) HandleBlockList ¶
func (bs *Server) HandleBlockList(w http.ResponseWriter, req *http.Request)
BlockList operations
func (*Server) HandleBlockListGet ¶
func (bs *Server) HandleBlockListGet(w http.ResponseWriter, req *http.Request)
func (*Server) HandleBlockListPut ¶
func (bs *Server) HandleBlockListPut(w http.ResponseWriter, req *http.Request)
func (*Server) HandleBlockPut ¶
func (bs *Server) HandleBlockPut(w http.ResponseWriter, req *http.Request)
func (*Server) HandleChangeLease ¶
func (bs *Server) HandleChangeLease(w http.ResponseWriter, req *http.Request)
func (*Server) HandleLease ¶
func (bs *Server) HandleLease(w http.ResponseWriter, req *http.Request)
Lease operations
func (*Server) HandleReleaseLease ¶
func (bs *Server) HandleReleaseLease(w http.ResponseWriter, req *http.Request)
func (*Server) HandleRenewLease ¶
func (bs *Server) HandleRenewLease(w http.ResponseWriter, req *http.Request)
func (*Server) RunBackground ¶
func (*Server) ServeHTTP2 ¶
func (bs *Server) ServeHTTP2(w http.ResponseWriter, req *http.Request)
type SkipReader ¶
type SkipReader struct {
// contains filtered or unexported fields
}
type XBlockListIn ¶
type XBlockListIn struct {
Blocks []XBlockIn
}
func ParseBlocklistXML ¶
func ParseBlocklistXML(data []byte) (*XBlockListIn, error)
func (*XBlockListIn) MarshalXML ¶
func (bl *XBlockListIn) MarshalXML(e *xml.Encoder, start xml.StartElement) error
func (*XBlockListIn) UnmarshalXML ¶
func (bl *XBlockListIn) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type XBlockListOut ¶
Click to show internal directories.
Click to hide internal directories.