• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






张伯雨

学习使人快乐
 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 37 下一页

2017年9月1日

admin-handlers.go
摘要: package managerimport ( "net/http" "regexp" "strconv" "io" "fmt" "github.com/030io/whalefs/manager/volume" "gopkg.in/redis.v2" "os")var ( postVolumeUrl *regexp.Regexp //提交卷... 阅读全文
posted @ 2017-09-01 09:24 张伯雨 阅读(173) 评论(0) 推荐(0)
 
mime.go
摘要: package managerimport ( "mime" "path")//初始化数据func init() { if mime.TypeByExtension(".txt") == "" { panic("mime.types not found") }}//获取文件扩展名对应的媒体(内容)类型func get_content_type(filepath... 阅读全文
posted @ 2017-09-01 09:24 张伯雨 阅读(199) 评论(0) 推荐(0)
 
status.go
摘要: package volumeimport ( "github.com/syndtr/goleveldb/leveldb" "sync" "encoding/binary" "github.com/syndtr/goleveldb/leveldb/util" "errors" "path/filepath" "strconv" "fmt")const ... 阅读全文
posted @ 2017-09-01 09:22 张伯雨 阅读(224) 评论(0) 推荐(0)
 
index_levedb.go
摘要: package volumeimport ( "github.com/syndtr/goleveldb/leveldb" "encoding/binary" "path/filepath" "strconv")//文件索引结构体type LevelDBIndex struct { path string db *leveldb.DB}//创建leveldb索... 阅读全文
posted @ 2017-09-01 09:22 张伯雨 阅读(235) 评论(0) 推荐(0)
 
volume.go
摘要: package volumeimport ( "os" "path/filepath" "strconv" "sync" "time" "encoding/binary" "errors")var ( TruncateSize uint64 = 1 = MaxVolumeSize { return } //清空指定偏移... 阅读全文
posted @ 2017-09-01 09:22 张伯雨 阅读(244) 评论(0) 推荐(0)
 
file.go
摘要: package volumeimport ( "time" "encoding/binary" "errors" "os" "io")//文件基本信息结构体type FileInfo struct { Fid uint64 Offset uint64 Size uint64 Ctime time.Time Mt... 阅读全文
posted @ 2017-09-01 09:21 张伯雨 阅读(543) 评论(0) 推荐(0)
 
index.go
摘要: package volumeimport "io"//文件基本读写 存在与否 关闭type Index interface { Has(fid uint64) bool Get(fid uint64) (*FileInfo, error) Set(fi *FileInfo) error Delete(fid uint64) error io.Closer} 阅读全文
posted @ 2017-09-01 09:21 张伯雨 阅读(175) 评论(0) 推荐(0)
 
upload.go
摘要: package apiimport ( "os" "bytes" "mime/multipart" "path/filepath" "io" "net/http" "errors" "fmt" "io/ioutil")//上传文件到指定的位置func Upload(host string, port int, vid uint64, fid u... 阅读全文
posted @ 2017-09-01 09:20 张伯雨 阅读(218) 评论(0) 推荐(0)
 
get.go
摘要: package apiimport ( "net/http" "fmt" "io/ioutil")const bufferSize = 512 * 1024//获取空间文件func Get(host string, port int, vid uint64, fid uint64, filename string) ([]byte, error) { url := fmt.... 阅读全文
posted @ 2017-09-01 09:19 张伯雨 阅读(180) 评论(0) 推荐(0)
 
delete.go
摘要: package apiimport ( "net/http" "fmt" "io/ioutil" "errors")//删除空间资源func Delete(host string, port int, vid uint64, fid uint64, filename string) error { url := fmt.Sprintf("http://%s:%d/%d... 阅读全文
posted @ 2017-09-01 09:18 张伯雨 阅读(115) 评论(0) 推荐(0)
 
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 37 下一页