99 "net/http"
1010 "net/url"
1111 "path"
12- "runtime/debug"
1312 "strings"
1413 "time"
1514
@@ -71,7 +70,6 @@ func (d *driver) Delete(ctx context.Context, path string) error {
7170// GetContent implements driver.StorageDriver.
7271func (d * driver ) GetContent (ctx context.Context , path string ) ([]byte , error ) {
7372 fmt .Println ("Getting content for path:" , path )
74- debug .PrintStack ()
7573 return d .client .Download (path )
7674}
7775
@@ -123,11 +121,13 @@ func (d *driver) Name() string {
123121
124122// PutContent implements driver.StorageDriver.
125123func (d * driver ) PutContent (ctx context.Context , path string , content []byte ) error {
124+ fmt .Println ("Putting content to path:" , path )
126125 return d .client .Upload (path , content , true )
127126}
128127
129128// Reader implements driver.StorageDriver.
130129func (d * driver ) Reader (ctx context.Context , path string , offset int64 ) (io.ReadCloser , error ) {
130+ fmt .Println ("Creating reader for path:" , path , "with offset:" , offset )
131131 return & bunnyFileReader {
132132 client : d .client ,
133133 path : path ,
@@ -137,11 +137,13 @@ func (d *driver) Reader(ctx context.Context, path string, offset int64) (io.Read
137137
138138// RedirectURL implements driver.StorageDriver.
139139func (d * driver ) RedirectURL (r * http.Request , path string ) (string , error ) {
140+ fmt .Println ("Creating redirect URL for path:" , path )
140141 return d .pullZone .JoinPath (path ).String (), nil
141142}
142143
143144// Stat implements driver.StorageDriver.
144145func (d * driver ) Stat (ctx context.Context , path string ) (storagedriver.FileInfo , error ) {
146+ fmt .Println ("Getting file info for path:" , path )
145147 info , err := d .client .Describe (path )
146148 if err != nil {
147149 return nil , err
@@ -263,5 +265,8 @@ func (b *BunnyFileWriter) Close() error {
263265 }
264266 err := b .client .Upload (b .path , b .buffer , true )
265267 fmt .Println ("Upload completed for path:" , b .path )
268+ if err != nil {
269+ fmt .Println ("Error uploading to Bunny:" , err )
270+ }
266271 return err
267272}
0 commit comments