├── .DS_Store ├── filestore-server-charter10 ├── .gitignore ├── README.md ├── cache │ └── redis │ │ └── conn.go ├── common │ ├── code.go │ └── store.go ├── config │ ├── ceph.go │ ├── db.go │ ├── oss.go │ ├── rabbitmq.go │ ├── service.go │ ├── store.go │ └── user.go ├── db │ ├── file.go │ ├── mysql │ │ └── conn.go │ ├── user.go │ └── userfile.go ├── doc │ ├── about_gin.png │ ├── centos7安装docker-ce.md │ ├── ci-cd.png │ ├── consul-ui.png │ ├── docker_ceph_cluster.md │ ├── docker_consul_deploy.md │ ├── gomicro-grpc.md │ ├── microservice_interact_archi.png │ ├── mysql_master_slave_setup.md │ ├── structure.png │ └── table.sql ├── handler │ ├── auth.go │ ├── mpupload.go │ ├── upload.go │ └── user.go ├── mq │ ├── consumer.go │ ├── define.go │ └── producer.go ├── route │ └── router.go ├── service │ ├── account │ │ ├── handler │ │ │ ├── user.go │ │ │ └── user_file.go │ │ ├── main.go │ │ └── proto │ │ │ ├── user.micro.go │ │ │ ├── user.pb.go │ │ │ └── user.proto │ ├── apigw │ │ ├── handler │ │ │ ├── user.go │ │ │ └── user_file.go │ │ ├── main.go │ │ └── route │ │ │ └── router.go │ ├── dbproxy │ │ ├── client │ │ │ ├── client.go │ │ │ └── sort.go │ │ ├── config │ │ │ └── db.go │ │ ├── conn │ │ │ └── conn.go │ │ ├── main.go │ │ ├── mapper │ │ │ └── mapper.go │ │ ├── orm │ │ │ ├── define.go │ │ │ ├── file.go │ │ │ ├── user.go │ │ │ └── userfile.go │ │ ├── proto │ │ │ ├── proxy.micro.go │ │ │ ├── proxy.pb.go │ │ │ └── proxy.proto │ │ └── rpc │ │ │ └── proxy.go │ ├── download │ │ ├── api │ │ │ └── download.go │ │ ├── config │ │ │ └── config.go │ │ ├── main.go │ │ ├── proto │ │ │ ├── download.micro.go │ │ │ ├── download.pb.go │ │ │ └── download.proto │ │ ├── route │ │ │ └── router.go │ │ └── rpc │ │ │ └── entry.go │ ├── start-all.sh │ ├── stop-all.sh │ ├── transfer │ │ └── main.go │ └── upload │ │ ├── api │ │ ├── mpupload.go │ │ └── upload.go │ │ ├── config │ │ └── config.go │ │ ├── main.go │ │ ├── proto │ │ ├── upload.micro.go │ │ ├── upload.pb.go │ │ └── upload.proto │ │ ├── route │ │ └── router.go │ │ └── rpc │ │ └── entry.go ├── static │ ├── css │ │ ├── bootstrap.min.css │ │ └── fileinput.min.css │ ├── img │ │ ├── avatar.jpeg │ │ └── loading.gif │ ├── js │ │ ├── FileSaver.js │ │ ├── StreamSaver.js │ │ ├── auth.js │ │ ├── bootstrap.min.js │ │ ├── fileinput.min.js │ │ ├── jquery-3.2.1.min.js │ │ ├── layui.js │ │ ├── piexif.min.js │ │ ├── polyfill.min.js │ │ ├── popper.min.js │ │ ├── purify.min.js │ │ ├── sortable.min.js │ │ ├── sw.js │ │ └── theme.js │ └── view │ │ ├── download.html │ │ ├── home.html │ │ ├── signin.html │ │ ├── signup.html │ │ └── upload.html ├── store │ ├── ceph │ │ └── ceph_conn.go │ └── oss │ │ └── oss_conn.go ├── test │ ├── test_ceph.go │ ├── test_fastupload.go │ └── test_mpupload.go └── util │ ├── resp.go │ ├── shell.go │ └── util.go ├── filestore-server-charter8 ├── cache │ └── redis │ │ └── conn.go ├── common │ ├── code.go │ └── store.go ├── config │ ├── ceph.go │ ├── oss.go │ └── store.go ├── db │ ├── file.go │ ├── mysql │ │ └── conn.go │ ├── user.go │ └── userfile.go ├── doc │ ├── mysql_master_slave_setup.md │ └── table.sql ├── go.mod ├── go.sum ├── handler │ ├── auth.go │ ├── handler.go │ ├── mpupload.go │ └── user.go ├── main.go ├── meta │ ├── filemeta.go │ └── sort.go ├── static │ ├── img │ │ └── avatar.jpeg │ ├── js │ │ └── auth.js │ └── view │ │ ├── home.html │ │ ├── index.html │ │ ├── signin.html │ │ └── signup.html ├── store │ ├── ceph │ │ └── conn.go │ └── oss │ │ └── oss_conn.go ├── test │ ├── test_ceph.go │ └── test_mpupload.go └── util │ ├── resp.go │ └── util.go ├── filestore-server-charter9 ├── README.md ├── cache │ └── redis │ │ └── conn.go ├── common │ ├── code.go │ └── store.go ├── config │ ├── ceph.go │ ├── db.go │ ├── oss.go │ ├── rabbitmq.go │ ├── service.go │ └── store.go ├── db │ ├── file.go │ ├── mysql │ │ └── conn.go │ ├── user.go │ └── userfile.go ├── doc │ ├── ci-cd.png │ ├── docker_ceph_cluster.md │ ├── mysql_master_slave_setup.md │ ├── structure.png │ └── table.sql ├── go.mod ├── go.sum ├── handler │ ├── auth.go │ ├── mpupload.go │ ├── upload.go │ └── user.go ├── meta │ ├── filemeta.go │ └── sort.go ├── mq │ ├── consumer.go │ ├── define.go │ └── producer.go ├── service │ ├── transfer │ │ └── main.go │ └── upload │ │ └── main.go ├── static │ ├── img │ │ └── avatar.jpeg │ ├── js │ │ └── auth.js │ └── view │ │ ├── home.html │ │ ├── index.html │ │ ├── signin.html │ │ └── signup.html ├── store │ ├── ceph │ │ └── ceph_conn.go │ └── oss │ │ └── oss_conn.go ├── test │ ├── test_ceph.go │ └── test_mpupload.go └── util │ ├── resp.go │ └── util.go ├── filestore-server-gin ├── README.md ├── cache │ └── redis │ │ └── conn.go ├── common │ └── store.go ├── config │ ├── ceph.go │ ├── db.go │ ├── oss.go │ ├── service.go │ └── store.go ├── db │ ├── file.go │ ├── mysql │ │ └── conn.go │ ├── user.go │ └── userfile.go ├── doc │ ├── ci-cd.png │ ├── structure.png │ └── table.sql ├── go.mod ├── go.sum ├── handler │ ├── auth.go │ ├── mpupload.go │ ├── upload.go │ └── user.go ├── main.go ├── meta │ ├── filemeta.go │ └── sort.go ├── route │ └── router.go ├── static │ ├── img │ │ └── avatar.jpeg │ └── view │ │ ├── home.html │ │ ├── signin.html │ │ ├── signup.html │ │ └── upload.html ├── store │ ├── ceph │ │ └── ceph_conn.go │ └── oss │ │ └── oss_conn.go ├── test │ ├── test_ceph.go │ └── test_mpupload.go └── util │ ├── resp.go │ └── util.go ├── filestore-server-master ├── .gitignore ├── README.md ├── assets │ └── asset.go ├── cache │ └── redis │ │ └── conn.go ├── common │ ├── code.go │ ├── flags.go │ └── store.go ├── config │ ├── ceph.go │ ├── db.go │ ├── oss.go │ ├── rabbitmq.go │ ├── service.go │ ├── store.go │ └── user.go ├── deploy │ ├── ci-cd │ │ ├── gitlab │ │ │ ├── README.md │ │ │ └── docker-compose.yml │ │ ├── harbor │ │ │ └── README.md │ │ └── jenkins │ │ │ └── README.md │ ├── docker_build.sh │ ├── service │ │ ├── account │ │ │ └── Dockerfile │ │ ├── apigw │ │ │ └── Dockerfile │ │ ├── dbproxy │ │ │ └── Dockerfile │ │ ├── download │ │ │ └── Dockerfile │ │ ├── transfer │ │ │ └── Dockerfile │ │ └── upload │ │ │ └── Dockerfile │ ├── service_dc │ │ ├── .env │ │ └── docker-compose.yml │ ├── service_k8s │ │ ├── batch_deploy.sh │ │ ├── batch_undeploy.sh │ │ ├── service-ingress.yaml │ │ ├── svc_account.yaml │ │ ├── svc_apigw.yaml │ │ ├── svc_dbproxy.yaml │ │ ├── svc_download.yaml │ │ ├── svc_transfer.yaml │ │ └── svc_upload.yaml │ ├── start_all.sh │ ├── stop_all.sh │ ├── traefik_dc │ │ ├── docker-compose.yml │ │ └── traefik.toml │ └── traefik_k8s │ │ ├── README │ │ ├── traefik-ds.yaml │ │ ├── traefik-rbac.yaml │ │ ├── traefik-ui.yaml │ │ └── traefik.toml ├── doc │ ├── about_gin.png │ ├── centos7安装docker-ce.md │ ├── ci-cd.png │ ├── consul-ui.png │ ├── docker_ceph_cluster.md │ ├── docker_consul_deploy.md │ ├── gomicro-grpc.md │ ├── k8s_v1.14.1_dashboard.png │ ├── microservice_interact_archi.png │ ├── mysql_master_slave_setup.md │ ├── structure.png │ ├── table.sql │ ├── ubuntu18_k8s(v1.14.1)_dashboard.md │ ├── ubuntu18_k8s(v1.14.1)_singlenode.md │ ├── 云存储系统.png │ └── 课程技能树.png ├── mq │ ├── conn.go │ ├── consumer.go │ ├── define.go │ └── producer.go ├── service │ ├── account │ │ ├── handler │ │ │ ├── user.go │ │ │ └── user_file.go │ │ ├── main.go │ │ └── proto │ │ │ ├── user.micro.go │ │ │ ├── user.pb.go │ │ │ └── user.proto │ ├── apigw │ │ ├── handler │ │ │ ├── auth.go │ │ │ ├── user.go │ │ │ └── user_file.go │ │ ├── main.go │ │ └── route │ │ │ └── router.go │ ├── dbproxy │ │ ├── client │ │ │ ├── client.go │ │ │ └── sort.go │ │ ├── config │ │ │ └── db.go │ │ ├── conn │ │ │ └── conn.go │ │ ├── main.go │ │ ├── mapper │ │ │ └── mapper.go │ │ ├── orm │ │ │ ├── define.go │ │ │ ├── file.go │ │ │ ├── user.go │ │ │ └── userfile.go │ │ ├── proto │ │ │ ├── proxy.micro.go │ │ │ ├── proxy.pb.go │ │ │ └── proxy.proto │ │ └── rpc │ │ │ └── proxy.go │ ├── download │ │ ├── api │ │ │ └── download.go │ │ ├── config │ │ │ └── config.go │ │ ├── main.go │ │ ├── proto │ │ │ ├── download.micro.go │ │ │ ├── download.pb.go │ │ │ └── download.proto │ │ ├── route │ │ │ └── router.go │ │ └── rpc │ │ │ └── entry.go │ ├── start-all.sh │ ├── stop-all.sh │ ├── transfer │ │ ├── main.go │ │ └── process │ │ │ └── transfer.go │ └── upload │ │ ├── api │ │ ├── mpupload.go │ │ └── upload.go │ │ ├── config │ │ └── config.go │ │ ├── main.go │ │ ├── proto │ │ ├── upload.micro.go │ │ ├── upload.pb.go │ │ └── upload.proto │ │ ├── route │ │ └── router.go │ │ └── rpc │ │ └── entry.go ├── static │ ├── css │ │ ├── bootstrap.min.css │ │ └── fileinput.min.css │ ├── img │ │ ├── avatar.jpeg │ │ └── loading.gif │ ├── js │ │ ├── FileSaver.js │ │ ├── StreamSaver.js │ │ ├── auth.js │ │ ├── bootstrap.min.js │ │ ├── fileinput.min.js │ │ ├── jquery-3.2.1.min.js │ │ ├── layui.js │ │ ├── piexif.min.js │ │ ├── polyfill.min.js │ │ ├── popper.min.js │ │ ├── purify.min.js │ │ ├── sortable.min.js │ │ ├── sw.js │ │ └── theme.js │ └── view │ │ ├── download.html │ │ ├── home.html │ │ ├── signin.html │ │ ├── signup.html │ │ └── upload.html ├── store │ ├── ceph │ │ └── ceph_conn.go │ └── oss │ │ └── oss_conn.go ├── test │ ├── test_ceph.go │ ├── test_fastupload.go │ └── test_mpupload.go ├── util │ ├── resp.go │ ├── shell.go │ └── util.go └── vendor │ ├── filestore-server │ ├── assets │ │ └── asset.go │ ├── cache │ │ └── redis │ │ │ └── conn.go │ ├── common │ │ ├── code.go │ │ ├── flags.go │ │ └── store.go │ ├── config │ │ ├── ceph.go │ │ ├── db.go │ │ ├── oss.go │ │ ├── rabbitmq.go │ │ ├── service.go │ │ ├── store.go │ │ └── user.go │ ├── mq │ │ ├── conn.go │ │ ├── consumer.go │ │ ├── define.go │ │ └── producer.go │ ├── store │ │ ├── ceph │ │ │ └── ceph_conn.go │ │ └── oss │ │ │ └── oss_conn.go │ └── util │ │ ├── resp.go │ │ ├── shell.go │ │ └── util.go │ ├── github.com │ ├── afex │ │ └── hystrix-go │ │ │ ├── LICENSE │ │ │ └── hystrix │ │ │ ├── circuit.go │ │ │ ├── doc.go │ │ │ ├── eventstream.go │ │ │ ├── hystrix.go │ │ │ ├── logger.go │ │ │ ├── metric_collector │ │ │ ├── default_metric_collector.go │ │ │ └── metric_collector.go │ │ │ ├── metrics.go │ │ │ ├── pool.go │ │ │ ├── pool_metrics.go │ │ │ ├── rolling │ │ │ ├── rolling.go │ │ │ └── rolling_timing.go │ │ │ └── settings.go │ ├── aliyun │ │ └── aliyun-oss-go-sdk │ │ │ └── oss │ │ │ ├── auth.go │ │ │ ├── bucket.go │ │ │ ├── client.go │ │ │ ├── conf.go │ │ │ ├── conn.go │ │ │ ├── const.go │ │ │ ├── crc.go │ │ │ ├── download.go │ │ │ ├── error.go │ │ │ ├── limit_reader_1_6.go │ │ │ ├── limit_reader_1_7.go │ │ │ ├── livechannel.go │ │ │ ├── mime.go │ │ │ ├── model.go │ │ │ ├── multicopy.go │ │ │ ├── multipart.go │ │ │ ├── option.go │ │ │ ├── progress.go │ │ │ ├── transport_1_6.go │ │ │ ├── transport_1_7.go │ │ │ ├── type.go │ │ │ ├── upload.go │ │ │ └── utils.go │ ├── armon │ │ └── go-metrics │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── const_unix.go │ │ │ ├── const_windows.go │ │ │ ├── inmem.go │ │ │ ├── inmem_endpoint.go │ │ │ ├── inmem_signal.go │ │ │ ├── metrics.go │ │ │ ├── sink.go │ │ │ ├── start.go │ │ │ ├── statsd.go │ │ │ └── statsite.go │ ├── garyburd │ │ └── redigo │ │ │ ├── LICENSE │ │ │ ├── internal │ │ │ └── commandinfo.go │ │ │ └── redis │ │ │ ├── conn.go │ │ │ ├── doc.go │ │ │ ├── go16.go │ │ │ ├── go17.go │ │ │ ├── go18.go │ │ │ ├── log.go │ │ │ ├── pool.go │ │ │ ├── pool17.go │ │ │ ├── pubsub.go │ │ │ ├── redis.go │ │ │ ├── reply.go │ │ │ ├── scan.go │ │ │ └── script.go │ ├── gin-contrib │ │ ├── cors │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── config.go │ │ │ ├── cors.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── utils.go │ │ └── sse │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── sse-decoder.go │ │ │ ├── sse-encoder.go │ │ │ └── writer.go │ ├── gin-gonic │ │ ├── contrib │ │ │ └── static │ │ │ │ ├── README.md │ │ │ │ └── static.go │ │ └── gin │ │ │ ├── AUTHORS.md │ │ │ ├── BENCHMARKS.md │ │ │ ├── CHANGELOG.md │ │ │ ├── CODE_OF_CONDUCT.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── auth.go │ │ │ ├── binding │ │ │ ├── binding.go │ │ │ ├── default_validator.go │ │ │ ├── form.go │ │ │ ├── form_mapping.go │ │ │ ├── json.go │ │ │ ├── msgpack.go │ │ │ ├── protobuf.go │ │ │ ├── query.go │ │ │ ├── uri.go │ │ │ ├── xml.go │ │ │ └── yaml.go │ │ │ ├── codecov.yml │ │ │ ├── context.go │ │ │ ├── context_17.go │ │ │ ├── context_appengine.go │ │ │ ├── debug.go │ │ │ ├── deprecated.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── fs.go │ │ │ ├── gin.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── internal │ │ │ └── json │ │ │ │ ├── json.go │ │ │ │ └── jsoniter.go │ │ │ ├── logger.go │ │ │ ├── mode.go │ │ │ ├── path.go │ │ │ ├── recovery.go │ │ │ ├── render │ │ │ ├── data.go │ │ │ ├── html.go │ │ │ ├── json.go │ │ │ ├── json_17.go │ │ │ ├── msgpack.go │ │ │ ├── protobuf.go │ │ │ ├── reader.go │ │ │ ├── redirect.go │ │ │ ├── render.go │ │ │ ├── text.go │ │ │ ├── xml.go │ │ │ └── yaml.go │ │ │ ├── response_writer.go │ │ │ ├── response_writer_1.7.go │ │ │ ├── response_writer_1.8.go │ │ │ ├── routergroup.go │ │ │ ├── test_helpers.go │ │ │ ├── tree.go │ │ │ ├── utils.go │ │ │ └── version.go │ ├── go-log │ │ └── log │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── log.go │ │ │ └── log │ │ │ └── log.go │ ├── go-sql-driver │ │ └── mysql │ │ │ ├── AUTHORS │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── appengine.go │ │ │ ├── auth.go │ │ │ ├── buffer.go │ │ │ ├── collations.go │ │ │ ├── connection.go │ │ │ ├── const.go │ │ │ ├── driver.go │ │ │ ├── dsn.go │ │ │ ├── errors.go │ │ │ ├── fields.go │ │ │ ├── infile.go │ │ │ ├── packets.go │ │ │ ├── result.go │ │ │ ├── rows.go │ │ │ ├── statement.go │ │ │ ├── transaction.go │ │ │ └── utils.go │ ├── golang │ │ └── protobuf │ │ │ ├── LICENSE │ │ │ └── proto │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── deprecated.go │ │ │ ├── discard.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── table_marshal.go │ │ │ ├── table_merge.go │ │ │ ├── table_unmarshal.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ ├── gomodule │ │ └── redigo │ │ │ ├── LICENSE │ │ │ └── redis │ │ │ ├── commandinfo.go │ │ │ ├── conn.go │ │ │ ├── doc.go │ │ │ ├── go17.go │ │ │ ├── go18.go │ │ │ ├── log.go │ │ │ ├── pool.go │ │ │ ├── pubsub.go │ │ │ ├── redis.go │ │ │ ├── reply.go │ │ │ ├── scan.go │ │ │ └── script.go │ ├── google │ │ ├── btree │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── btree.go │ │ │ ├── btree_mem.go │ │ │ └── go.mod │ │ └── uuid │ │ │ ├── CONTRIBUTING.md │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── dce.go │ │ │ ├── doc.go │ │ │ ├── go.mod │ │ │ ├── hash.go │ │ │ ├── marshal.go │ │ │ ├── node.go │ │ │ ├── node_js.go │ │ │ ├── node_net.go │ │ │ ├── sql.go │ │ │ ├── time.go │ │ │ ├── util.go │ │ │ ├── uuid.go │ │ │ ├── version1.go │ │ │ └── version4.go │ ├── hashicorp │ │ ├── consul │ │ │ ├── LICENSE │ │ │ ├── NOTICE.md │ │ │ ├── api │ │ │ │ ├── README.md │ │ │ │ ├── acl.go │ │ │ │ ├── agent.go │ │ │ │ ├── api.go │ │ │ │ ├── catalog.go │ │ │ │ ├── connect.go │ │ │ │ ├── connect_ca.go │ │ │ │ ├── connect_intention.go │ │ │ │ ├── coordinate.go │ │ │ │ ├── debug.go │ │ │ │ ├── event.go │ │ │ │ ├── go.mod │ │ │ │ ├── go.sum │ │ │ │ ├── health.go │ │ │ │ ├── kv.go │ │ │ │ ├── lock.go │ │ │ │ ├── operator.go │ │ │ │ ├── operator_area.go │ │ │ │ ├── operator_autopilot.go │ │ │ │ ├── operator_keyring.go │ │ │ │ ├── operator_raft.go │ │ │ │ ├── operator_segment.go │ │ │ │ ├── prepared_query.go │ │ │ │ ├── raw.go │ │ │ │ ├── semaphore.go │ │ │ │ ├── session.go │ │ │ │ ├── snapshot.go │ │ │ │ ├── status.go │ │ │ │ └── txn.go │ │ │ └── watch │ │ │ │ ├── funcs.go │ │ │ │ ├── plan.go │ │ │ │ └── watch.go │ │ ├── errwrap │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── errwrap.go │ │ │ └── go.mod │ │ ├── go-cleanhttp │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── cleanhttp.go │ │ │ ├── doc.go │ │ │ ├── go.mod │ │ │ └── handlers.go │ │ ├── go-immutable-radix │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── edges.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── iradix.go │ │ │ ├── iter.go │ │ │ ├── node.go │ │ │ └── raw_iter.go │ │ ├── go-msgpack │ │ │ ├── LICENSE │ │ │ └── codec │ │ │ │ ├── 0doc.go │ │ │ │ ├── README.md │ │ │ │ ├── binc.go │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── helper.go │ │ │ │ ├── helper_internal.go │ │ │ │ ├── msgpack.go │ │ │ │ ├── msgpack_test.py │ │ │ │ ├── rpc.go │ │ │ │ ├── simple.go │ │ │ │ └── time.go │ │ ├── go-multierror │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── append.go │ │ │ ├── flatten.go │ │ │ ├── format.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── multierror.go │ │ │ ├── prefix.go │ │ │ └── sort.go │ │ ├── go-rootcerts │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── rootcerts.go │ │ │ ├── rootcerts_base.go │ │ │ └── rootcerts_darwin.go │ │ ├── go-sockaddr │ │ │ ├── GNUmakefile │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── ifaddr.go │ │ │ ├── ifaddrs.go │ │ │ ├── ifattr.go │ │ │ ├── ipaddr.go │ │ │ ├── ipaddrs.go │ │ │ ├── ipv4addr.go │ │ │ ├── ipv6addr.go │ │ │ ├── rfc.go │ │ │ ├── route_info.go │ │ │ ├── route_info_android.go │ │ │ ├── route_info_bsd.go │ │ │ ├── route_info_default.go │ │ │ ├── route_info_linux.go │ │ │ ├── route_info_solaris.go │ │ │ ├── route_info_windows.go │ │ │ ├── sockaddr.go │ │ │ ├── sockaddrs.go │ │ │ └── unixsock.go │ │ ├── golang-lru │ │ │ ├── LICENSE │ │ │ └── simplelru │ │ │ │ ├── lru.go │ │ │ │ └── lru_interface.go │ │ ├── memberlist │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── alive_delegate.go │ │ │ ├── awareness.go │ │ │ ├── broadcast.go │ │ │ ├── config.go │ │ │ ├── conflict_delegate.go │ │ │ ├── delegate.go │ │ │ ├── event_delegate.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── keyring.go │ │ │ ├── logging.go │ │ │ ├── memberlist.go │ │ │ ├── merge_delegate.go │ │ │ ├── mock_transport.go │ │ │ ├── net.go │ │ │ ├── net_transport.go │ │ │ ├── ping_delegate.go │ │ │ ├── queue.go │ │ │ ├── security.go │ │ │ ├── state.go │ │ │ ├── suspicion.go │ │ │ ├── tag.sh │ │ │ ├── todo.md │ │ │ ├── transport.go │ │ │ └── util.go │ │ └── serf │ │ │ ├── LICENSE │ │ │ └── coordinate │ │ │ ├── client.go │ │ │ ├── config.go │ │ │ ├── coordinate.go │ │ │ └── phantom.go │ ├── json-iterator │ │ └── go │ │ │ ├── Gopkg.lock │ │ │ ├── Gopkg.toml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── adapter.go │ │ │ ├── any.go │ │ │ ├── any_array.go │ │ │ ├── any_bool.go │ │ │ ├── any_float.go │ │ │ ├── any_int32.go │ │ │ ├── any_int64.go │ │ │ ├── any_invalid.go │ │ │ ├── any_nil.go │ │ │ ├── any_number.go │ │ │ ├── any_object.go │ │ │ ├── any_str.go │ │ │ ├── any_uint32.go │ │ │ ├── any_uint64.go │ │ │ ├── build.sh │ │ │ ├── config.go │ │ │ ├── fuzzy_mode_convert_table.md │ │ │ ├── iter.go │ │ │ ├── iter_array.go │ │ │ ├── iter_float.go │ │ │ ├── iter_int.go │ │ │ ├── iter_object.go │ │ │ ├── iter_skip.go │ │ │ ├── iter_skip_sloppy.go │ │ │ ├── iter_skip_strict.go │ │ │ ├── iter_str.go │ │ │ ├── jsoniter.go │ │ │ ├── pool.go │ │ │ ├── reflect.go │ │ │ ├── reflect_array.go │ │ │ ├── reflect_dynamic.go │ │ │ ├── reflect_extension.go │ │ │ ├── reflect_json_number.go │ │ │ ├── reflect_json_raw_message.go │ │ │ ├── reflect_map.go │ │ │ ├── reflect_marshaler.go │ │ │ ├── reflect_native.go │ │ │ ├── reflect_optional.go │ │ │ ├── reflect_slice.go │ │ │ ├── reflect_struct_decoder.go │ │ │ ├── reflect_struct_encoder.go │ │ │ ├── stream.go │ │ │ ├── stream_float.go │ │ │ ├── stream_int.go │ │ │ ├── stream_str.go │ │ │ └── test.sh │ ├── juju │ │ └── ratelimit │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── ratelimit.go │ │ │ └── reader.go │ ├── mattn │ │ └── go-isatty │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── isatty_android.go │ │ │ ├── isatty_bsd.go │ │ │ ├── isatty_linux.go │ │ │ ├── isatty_others.go │ │ │ ├── isatty_solaris.go │ │ │ └── isatty_windows.go │ ├── micro │ │ ├── cli │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── app.go │ │ │ ├── category.go │ │ │ ├── cli.go │ │ │ ├── command.go │ │ │ ├── context.go │ │ │ ├── flag.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── help.go │ │ ├── go-log │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── log.go │ │ ├── go-micro │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── README.zh-cn.md │ │ │ ├── broker │ │ │ │ ├── broker.go │ │ │ │ ├── http │ │ │ │ │ ├── http.go │ │ │ │ │ └── options.go │ │ │ │ ├── http_broker.go │ │ │ │ ├── memory │ │ │ │ │ └── memory.go │ │ │ │ └── options.go │ │ │ ├── client │ │ │ │ ├── backoff.go │ │ │ │ ├── buffer.go │ │ │ │ ├── client.go │ │ │ │ ├── context.go │ │ │ │ ├── options.go │ │ │ │ ├── retry.go │ │ │ │ ├── rpc_client.go │ │ │ │ ├── rpc_codec.go │ │ │ │ ├── rpc_message.go │ │ │ │ ├── rpc_pool.go │ │ │ │ ├── rpc_request.go │ │ │ │ ├── rpc_response.go │ │ │ │ ├── rpc_stream.go │ │ │ │ └── wrapper.go │ │ │ ├── cmd │ │ │ │ ├── cmd.go │ │ │ │ └── options.go │ │ │ ├── codec │ │ │ │ ├── bytes │ │ │ │ │ ├── bytes.go │ │ │ │ │ └── marshaler.go │ │ │ │ ├── codec.go │ │ │ │ ├── grpc │ │ │ │ │ ├── grpc.go │ │ │ │ │ └── util.go │ │ │ │ ├── json │ │ │ │ │ ├── json.go │ │ │ │ │ └── marshaler.go │ │ │ │ ├── jsonrpc │ │ │ │ │ ├── client.go │ │ │ │ │ ├── jsonrpc.go │ │ │ │ │ └── server.go │ │ │ │ ├── proto │ │ │ │ │ ├── marshaler.go │ │ │ │ │ └── proto.go │ │ │ │ └── protorpc │ │ │ │ │ ├── envelope.pb.go │ │ │ │ │ ├── envelope.proto │ │ │ │ │ ├── netstring.go │ │ │ │ │ └── protorpc.go │ │ │ ├── errors │ │ │ │ └── errors.go │ │ │ ├── function.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── metadata │ │ │ │ └── metadata.go │ │ │ ├── micro.go │ │ │ ├── micro.png │ │ │ ├── options.go │ │ │ ├── publisher.go │ │ │ ├── registry │ │ │ │ ├── consul │ │ │ │ │ ├── consul.go │ │ │ │ │ ├── encoding.go │ │ │ │ │ ├── options.go │ │ │ │ │ └── watcher.go │ │ │ │ ├── encoding.go │ │ │ │ ├── gossip │ │ │ │ │ ├── README.md │ │ │ │ │ ├── gossip.go │ │ │ │ │ ├── options.go │ │ │ │ │ ├── proto │ │ │ │ │ │ ├── gossip.micro.go │ │ │ │ │ │ ├── gossip.pb.go │ │ │ │ │ │ └── gossip.proto │ │ │ │ │ ├── util.go │ │ │ │ │ └── watcher.go │ │ │ │ ├── mdns │ │ │ │ │ └── mdns.go │ │ │ │ ├── mdns_registry.go │ │ │ │ ├── mdns_watcher.go │ │ │ │ ├── memory │ │ │ │ │ ├── data.go │ │ │ │ │ ├── helper.go │ │ │ │ │ ├── memory.go │ │ │ │ │ ├── memory_watcher.go │ │ │ │ │ ├── options.go │ │ │ │ │ └── watcher.go │ │ │ │ ├── options.go │ │ │ │ ├── registry.go │ │ │ │ ├── service.go │ │ │ │ └── watcher.go │ │ │ ├── selector │ │ │ │ ├── default.go │ │ │ │ ├── dns │ │ │ │ │ └── dns.go │ │ │ │ ├── filter.go │ │ │ │ ├── options.go │ │ │ │ ├── selector.go │ │ │ │ ├── static │ │ │ │ │ └── static.go │ │ │ │ └── strategy.go │ │ │ ├── server │ │ │ │ ├── buffer.go │ │ │ │ ├── context.go │ │ │ │ ├── debug.go │ │ │ │ ├── debug │ │ │ │ │ ├── debug.go │ │ │ │ │ └── proto │ │ │ │ │ │ ├── debug.pb.go │ │ │ │ │ │ └── debug.proto │ │ │ │ ├── extractor.go │ │ │ │ ├── handler.go │ │ │ │ ├── options.go │ │ │ │ ├── rpc_codec.go │ │ │ │ ├── rpc_handler.go │ │ │ │ ├── rpc_request.go │ │ │ │ ├── rpc_response.go │ │ │ │ ├── rpc_router.go │ │ │ │ ├── rpc_server.go │ │ │ │ ├── rpc_stream.go │ │ │ │ ├── server.go │ │ │ │ ├── subscriber.go │ │ │ │ └── wrapper.go │ │ │ ├── service.go │ │ │ ├── transport │ │ │ │ ├── http │ │ │ │ │ ├── http.go │ │ │ │ │ └── options.go │ │ │ │ ├── http_proxy.go │ │ │ │ ├── http_transport.go │ │ │ │ ├── memory │ │ │ │ │ └── memory.go │ │ │ │ ├── options.go │ │ │ │ └── transport.go │ │ │ └── wrapper.go │ │ ├── go-plugins │ │ │ ├── LICENSE │ │ │ ├── registry │ │ │ │ └── kubernetes │ │ │ │ │ ├── README.md │ │ │ │ │ ├── client │ │ │ │ │ ├── api │ │ │ │ │ │ ├── request.go │ │ │ │ │ │ └── response.go │ │ │ │ │ ├── client.go │ │ │ │ │ ├── kubernetes.go │ │ │ │ │ ├── utils.go │ │ │ │ │ └── watch │ │ │ │ │ │ ├── body.go │ │ │ │ │ │ └── watch.go │ │ │ │ │ ├── kubernetes.go │ │ │ │ │ └── watcher.go │ │ │ └── wrapper │ │ │ │ ├── breaker │ │ │ │ └── hystrix │ │ │ │ │ └── hystrix.go │ │ │ │ └── ratelimiter │ │ │ │ └── ratelimit │ │ │ │ └── ratelimit.go │ │ ├── go-rcache │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── options.go │ │ │ └── rcache.go │ │ ├── mdns │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── client.go │ │ │ ├── dns_sd.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── server.go │ │ │ └── zone.go │ │ └── util │ │ │ ├── LICENSE │ │ │ └── go │ │ │ └── lib │ │ │ ├── addr │ │ │ └── addr.go │ │ │ ├── net │ │ │ └── net.go │ │ │ └── tls │ │ │ └── tls.go │ ├── miekg │ │ └── dns │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── COPYRIGHT │ │ │ ├── Gopkg.lock │ │ │ ├── Gopkg.toml │ │ │ ├── LICENSE │ │ │ ├── Makefile.fuzz │ │ │ ├── Makefile.release │ │ │ ├── README.md │ │ │ ├── acceptfunc.go │ │ │ ├── client.go │ │ │ ├── clientconfig.go │ │ │ ├── dane.go │ │ │ ├── defaults.go │ │ │ ├── dns.go │ │ │ ├── dnssec.go │ │ │ ├── dnssec_keygen.go │ │ │ ├── dnssec_keyscan.go │ │ │ ├── dnssec_privkey.go │ │ │ ├── doc.go │ │ │ ├── duplicate.go │ │ │ ├── duplicate_generate.go │ │ │ ├── edns.go │ │ │ ├── format.go │ │ │ ├── fuzz.go │ │ │ ├── generate.go │ │ │ ├── labels.go │ │ │ ├── listen_go111.go │ │ │ ├── listen_go_not111.go │ │ │ ├── msg.go │ │ │ ├── msg_generate.go │ │ │ ├── msg_helpers.go │ │ │ ├── msg_truncate.go │ │ │ ├── nsecx.go │ │ │ ├── privaterr.go │ │ │ ├── reverse.go │ │ │ ├── sanitize.go │ │ │ ├── scan.go │ │ │ ├── scan_rr.go │ │ │ ├── serve_mux.go │ │ │ ├── server.go │ │ │ ├── sig0.go │ │ │ ├── singleinflight.go │ │ │ ├── smimea.go │ │ │ ├── tlsa.go │ │ │ ├── tsig.go │ │ │ ├── types.go │ │ │ ├── types_generate.go │ │ │ ├── udp.go │ │ │ ├── udp_windows.go │ │ │ ├── update.go │ │ │ ├── version.go │ │ │ ├── xfr.go │ │ │ ├── zduplicate.go │ │ │ ├── zmsg.go │ │ │ └── ztypes.go │ ├── mitchellh │ │ ├── go-homedir │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── go.mod │ │ │ └── homedir.go │ │ ├── hashstructure │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── go.mod │ │ │ ├── hashstructure.go │ │ │ └── include.go │ │ └── mapstructure │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── decode_hooks.go │ │ │ ├── error.go │ │ │ ├── go.mod │ │ │ └── mapstructure.go │ ├── modern-go │ │ ├── concurrent │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── executor.go │ │ │ ├── go_above_19.go │ │ │ ├── go_below_19.go │ │ │ ├── log.go │ │ │ ├── test.sh │ │ │ └── unbounded_executor.go │ │ └── reflect2 │ │ │ ├── Gopkg.lock │ │ │ ├── Gopkg.toml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── go_above_17.go │ │ │ ├── go_above_19.go │ │ │ ├── go_below_17.go │ │ │ ├── go_below_19.go │ │ │ ├── reflect2.go │ │ │ ├── reflect2_amd64.s │ │ │ ├── reflect2_kind.go │ │ │ ├── relfect2_386.s │ │ │ ├── relfect2_amd64p32.s │ │ │ ├── relfect2_arm.s │ │ │ ├── relfect2_arm64.s │ │ │ ├── relfect2_mips64x.s │ │ │ ├── relfect2_mipsx.s │ │ │ ├── relfect2_ppc64x.s │ │ │ ├── relfect2_s390x.s │ │ │ ├── safe_field.go │ │ │ ├── safe_map.go │ │ │ ├── safe_slice.go │ │ │ ├── safe_struct.go │ │ │ ├── safe_type.go │ │ │ ├── test.sh │ │ │ ├── type_map.go │ │ │ ├── unsafe_array.go │ │ │ ├── unsafe_eface.go │ │ │ ├── unsafe_field.go │ │ │ ├── unsafe_iface.go │ │ │ ├── unsafe_link.go │ │ │ ├── unsafe_map.go │ │ │ ├── unsafe_ptr.go │ │ │ ├── unsafe_slice.go │ │ │ ├── unsafe_struct.go │ │ │ └── unsafe_type.go │ ├── moxiaomomo │ │ └── go-bindata-assetfs │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── assetfs.go │ │ │ └── doc.go │ ├── pkg │ │ └── errors │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── appveyor.yml │ │ │ ├── errors.go │ │ │ └── stack.go │ ├── sean- │ │ └── seed │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── init.go │ ├── streadway │ │ └── amqp │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── allocator.go │ │ │ ├── auth.go │ │ │ ├── certs.sh │ │ │ ├── channel.go │ │ │ ├── confirms.go │ │ │ ├── connection.go │ │ │ ├── consumers.go │ │ │ ├── delivery.go │ │ │ ├── doc.go │ │ │ ├── fuzz.go │ │ │ ├── gen.sh │ │ │ ├── go.mod │ │ │ ├── pre-commit │ │ │ ├── read.go │ │ │ ├── return.go │ │ │ ├── spec091.go │ │ │ ├── types.go │ │ │ ├── uri.go │ │ │ └── write.go │ └── ugorji │ │ └── go │ │ ├── LICENSE │ │ └── codec │ │ ├── 0doc.go │ │ ├── README.md │ │ ├── binc.go │ │ ├── build.sh │ │ ├── cbor.go │ │ ├── codecgen.go │ │ ├── decode.go │ │ ├── encode.go │ │ ├── fast-path.generated.go │ │ ├── fast-path.go.tmpl │ │ ├── fast-path.not.go │ │ ├── gen-dec-array.go.tmpl │ │ ├── gen-dec-map.go.tmpl │ │ ├── gen-enc-chan.go.tmpl │ │ ├── gen-helper.generated.go │ │ ├── gen-helper.go.tmpl │ │ ├── gen.generated.go │ │ ├── gen.go │ │ ├── go.mod │ │ ├── goversion_arrayof_gte_go15.go │ │ ├── goversion_arrayof_lt_go15.go │ │ ├── goversion_makemap_gte_go19.go │ │ ├── goversion_makemap_lt_go19.go │ │ ├── goversion_unexportedembeddedptr_gte_go110.go │ │ ├── goversion_unexportedembeddedptr_lt_go110.go │ │ ├── goversion_unsupported_lt_go14.go │ │ ├── goversion_vendor_eq_go15.go │ │ ├── goversion_vendor_eq_go16.go │ │ ├── goversion_vendor_gte_go17.go │ │ ├── goversion_vendor_lt_go15.go │ │ ├── helper.go │ │ ├── helper_internal.go │ │ ├── helper_not_unsafe.go │ │ ├── helper_unsafe.go │ │ ├── json.go │ │ ├── mammoth-test.go.tmpl │ │ ├── mammoth2-test.go.tmpl │ │ ├── msgpack.go │ │ ├── rpc.go │ │ ├── simple.go │ │ ├── test-cbor-goldens.json │ │ ├── test.py │ │ └── xml.go │ ├── golang.org │ └── x │ │ ├── crypto │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── ed25519 │ │ │ ├── ed25519.go │ │ │ └── internal │ │ │ └── edwards25519 │ │ │ ├── const.go │ │ │ └── edwards25519.go │ │ ├── net │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── bpf │ │ │ ├── asm.go │ │ │ ├── constants.go │ │ │ ├── doc.go │ │ │ ├── instructions.go │ │ │ ├── setter.go │ │ │ ├── vm.go │ │ │ └── vm_instructions.go │ │ ├── http │ │ │ └── httpguts │ │ │ │ ├── guts.go │ │ │ │ └── httplex.go │ │ ├── http2 │ │ │ ├── Dockerfile │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── ciphers.go │ │ │ ├── client_conn_pool.go │ │ │ ├── databuffer.go │ │ │ ├── errors.go │ │ │ ├── flow.go │ │ │ ├── frame.go │ │ │ ├── go111.go │ │ │ ├── gotrack.go │ │ │ ├── h2c │ │ │ │ └── h2c.go │ │ │ ├── headermap.go │ │ │ ├── hpack │ │ │ │ ├── encode.go │ │ │ │ ├── hpack.go │ │ │ │ ├── huffman.go │ │ │ │ └── tables.go │ │ │ ├── http2.go │ │ │ ├── not_go111.go │ │ │ ├── pipe.go │ │ │ ├── server.go │ │ │ ├── transport.go │ │ │ ├── write.go │ │ │ ├── writesched.go │ │ │ ├── writesched_priority.go │ │ │ └── writesched_random.go │ │ ├── idna │ │ │ ├── idna.go │ │ │ ├── punycode.go │ │ │ ├── tables.go │ │ │ ├── trie.go │ │ │ └── trieval.go │ │ ├── internal │ │ │ ├── iana │ │ │ │ ├── const.go │ │ │ │ └── gen.go │ │ │ └── socket │ │ │ │ ├── cmsghdr.go │ │ │ │ ├── cmsghdr_bsd.go │ │ │ │ ├── cmsghdr_linux_32bit.go │ │ │ │ ├── cmsghdr_linux_64bit.go │ │ │ │ ├── cmsghdr_solaris_64bit.go │ │ │ │ ├── cmsghdr_stub.go │ │ │ │ ├── defs_darwin.go │ │ │ │ ├── defs_dragonfly.go │ │ │ │ ├── defs_freebsd.go │ │ │ │ ├── defs_linux.go │ │ │ │ ├── defs_netbsd.go │ │ │ │ ├── defs_openbsd.go │ │ │ │ ├── defs_solaris.go │ │ │ │ ├── empty.s │ │ │ │ ├── error_unix.go │ │ │ │ ├── error_windows.go │ │ │ │ ├── iovec_32bit.go │ │ │ │ ├── iovec_64bit.go │ │ │ │ ├── iovec_solaris_64bit.go │ │ │ │ ├── iovec_stub.go │ │ │ │ ├── mmsghdr_stub.go │ │ │ │ ├── mmsghdr_unix.go │ │ │ │ ├── msghdr_bsd.go │ │ │ │ ├── msghdr_bsdvar.go │ │ │ │ ├── msghdr_linux.go │ │ │ │ ├── msghdr_linux_32bit.go │ │ │ │ ├── msghdr_linux_64bit.go │ │ │ │ ├── msghdr_openbsd.go │ │ │ │ ├── msghdr_solaris_64bit.go │ │ │ │ ├── msghdr_stub.go │ │ │ │ ├── rawconn.go │ │ │ │ ├── rawconn_mmsg.go │ │ │ │ ├── rawconn_msg.go │ │ │ │ ├── rawconn_nommsg.go │ │ │ │ ├── rawconn_nomsg.go │ │ │ │ ├── socket.go │ │ │ │ ├── sys.go │ │ │ │ ├── sys_bsd.go │ │ │ │ ├── sys_bsdvar.go │ │ │ │ ├── sys_darwin.go │ │ │ │ ├── sys_dragonfly.go │ │ │ │ ├── sys_go1_11_darwin.go │ │ │ │ ├── sys_go1_12_darwin.go │ │ │ │ ├── sys_linux.go │ │ │ │ ├── sys_linux_386.go │ │ │ │ ├── sys_linux_386.s │ │ │ │ ├── sys_linux_amd64.go │ │ │ │ ├── sys_linux_arm.go │ │ │ │ ├── sys_linux_arm64.go │ │ │ │ ├── sys_linux_mips.go │ │ │ │ ├── sys_linux_mips64.go │ │ │ │ ├── sys_linux_mips64le.go │ │ │ │ ├── sys_linux_mipsle.go │ │ │ │ ├── sys_linux_ppc64.go │ │ │ │ ├── sys_linux_ppc64le.go │ │ │ │ ├── sys_linux_s390x.go │ │ │ │ ├── sys_linux_s390x.s │ │ │ │ ├── sys_netbsd.go │ │ │ │ ├── sys_posix.go │ │ │ │ ├── sys_solaris.go │ │ │ │ ├── sys_solaris_amd64.s │ │ │ │ ├── sys_stub.go │ │ │ │ ├── sys_unix.go │ │ │ │ ├── sys_windows.go │ │ │ │ ├── zsys_darwin_386.go │ │ │ │ ├── zsys_darwin_amd64.go │ │ │ │ ├── zsys_darwin_arm.go │ │ │ │ ├── zsys_darwin_arm64.go │ │ │ │ ├── zsys_dragonfly_amd64.go │ │ │ │ ├── zsys_freebsd_386.go │ │ │ │ ├── zsys_freebsd_amd64.go │ │ │ │ ├── zsys_freebsd_arm.go │ │ │ │ ├── zsys_linux_386.go │ │ │ │ ├── zsys_linux_amd64.go │ │ │ │ ├── zsys_linux_arm.go │ │ │ │ ├── zsys_linux_arm64.go │ │ │ │ ├── zsys_linux_mips.go │ │ │ │ ├── zsys_linux_mips64.go │ │ │ │ ├── zsys_linux_mips64le.go │ │ │ │ ├── zsys_linux_mipsle.go │ │ │ │ ├── zsys_linux_ppc64.go │ │ │ │ ├── zsys_linux_ppc64le.go │ │ │ │ ├── zsys_linux_s390x.go │ │ │ │ ├── zsys_netbsd_386.go │ │ │ │ ├── zsys_netbsd_amd64.go │ │ │ │ ├── zsys_netbsd_arm.go │ │ │ │ ├── zsys_openbsd_386.go │ │ │ │ ├── zsys_openbsd_amd64.go │ │ │ │ ├── zsys_openbsd_arm.go │ │ │ │ └── zsys_solaris_amd64.go │ │ ├── ipv4 │ │ │ ├── batch.go │ │ │ ├── control.go │ │ │ ├── control_bsd.go │ │ │ ├── control_pktinfo.go │ │ │ ├── control_stub.go │ │ │ ├── control_unix.go │ │ │ ├── control_windows.go │ │ │ ├── defs_darwin.go │ │ │ ├── defs_dragonfly.go │ │ │ ├── defs_freebsd.go │ │ │ ├── defs_linux.go │ │ │ ├── defs_netbsd.go │ │ │ ├── defs_openbsd.go │ │ │ ├── defs_solaris.go │ │ │ ├── dgramopt.go │ │ │ ├── doc.go │ │ │ ├── endpoint.go │ │ │ ├── gen.go │ │ │ ├── genericopt.go │ │ │ ├── header.go │ │ │ ├── helper.go │ │ │ ├── iana.go │ │ │ ├── icmp.go │ │ │ ├── icmp_linux.go │ │ │ ├── icmp_stub.go │ │ │ ├── packet.go │ │ │ ├── payload.go │ │ │ ├── payload_cmsg.go │ │ │ ├── payload_nocmsg.go │ │ │ ├── sockopt.go │ │ │ ├── sockopt_posix.go │ │ │ ├── sockopt_stub.go │ │ │ ├── sys_asmreq.go │ │ │ ├── sys_asmreq_stub.go │ │ │ ├── sys_asmreqn.go │ │ │ ├── sys_asmreqn_stub.go │ │ │ ├── sys_bpf.go │ │ │ ├── sys_bpf_stub.go │ │ │ ├── sys_bsd.go │ │ │ ├── sys_darwin.go │ │ │ ├── sys_dragonfly.go │ │ │ ├── sys_freebsd.go │ │ │ ├── sys_linux.go │ │ │ ├── sys_solaris.go │ │ │ ├── sys_ssmreq.go │ │ │ ├── sys_ssmreq_stub.go │ │ │ ├── sys_stub.go │ │ │ ├── sys_windows.go │ │ │ ├── zsys_darwin.go │ │ │ ├── zsys_dragonfly.go │ │ │ ├── zsys_freebsd_386.go │ │ │ ├── zsys_freebsd_amd64.go │ │ │ ├── zsys_freebsd_arm.go │ │ │ ├── zsys_linux_386.go │ │ │ ├── zsys_linux_amd64.go │ │ │ ├── zsys_linux_arm.go │ │ │ ├── zsys_linux_arm64.go │ │ │ ├── zsys_linux_mips.go │ │ │ ├── zsys_linux_mips64.go │ │ │ ├── zsys_linux_mips64le.go │ │ │ ├── zsys_linux_mipsle.go │ │ │ ├── zsys_linux_ppc.go │ │ │ ├── zsys_linux_ppc64.go │ │ │ ├── zsys_linux_ppc64le.go │ │ │ ├── zsys_linux_s390x.go │ │ │ ├── zsys_netbsd.go │ │ │ ├── zsys_openbsd.go │ │ │ └── zsys_solaris.go │ │ └── ipv6 │ │ │ ├── batch.go │ │ │ ├── control.go │ │ │ ├── control_rfc2292_unix.go │ │ │ ├── control_rfc3542_unix.go │ │ │ ├── control_stub.go │ │ │ ├── control_unix.go │ │ │ ├── control_windows.go │ │ │ ├── defs_darwin.go │ │ │ ├── defs_dragonfly.go │ │ │ ├── defs_freebsd.go │ │ │ ├── defs_linux.go │ │ │ ├── defs_netbsd.go │ │ │ ├── defs_openbsd.go │ │ │ ├── defs_solaris.go │ │ │ ├── dgramopt.go │ │ │ ├── doc.go │ │ │ ├── endpoint.go │ │ │ ├── gen.go │ │ │ ├── genericopt.go │ │ │ ├── header.go │ │ │ ├── helper.go │ │ │ ├── iana.go │ │ │ ├── icmp.go │ │ │ ├── icmp_bsd.go │ │ │ ├── icmp_linux.go │ │ │ ├── icmp_solaris.go │ │ │ ├── icmp_stub.go │ │ │ ├── icmp_windows.go │ │ │ ├── payload.go │ │ │ ├── payload_cmsg.go │ │ │ ├── payload_nocmsg.go │ │ │ ├── sockopt.go │ │ │ ├── sockopt_posix.go │ │ │ ├── sockopt_stub.go │ │ │ ├── sys_asmreq.go │ │ │ ├── sys_asmreq_stub.go │ │ │ ├── sys_bpf.go │ │ │ ├── sys_bpf_stub.go │ │ │ ├── sys_bsd.go │ │ │ ├── sys_darwin.go │ │ │ ├── sys_freebsd.go │ │ │ ├── sys_linux.go │ │ │ ├── sys_solaris.go │ │ │ ├── sys_ssmreq.go │ │ │ ├── sys_ssmreq_stub.go │ │ │ ├── sys_stub.go │ │ │ ├── sys_windows.go │ │ │ ├── zsys_darwin.go │ │ │ ├── zsys_dragonfly.go │ │ │ ├── zsys_freebsd_386.go │ │ │ ├── zsys_freebsd_amd64.go │ │ │ ├── zsys_freebsd_arm.go │ │ │ ├── zsys_linux_386.go │ │ │ ├── zsys_linux_amd64.go │ │ │ ├── zsys_linux_arm.go │ │ │ ├── zsys_linux_arm64.go │ │ │ ├── zsys_linux_mips.go │ │ │ ├── zsys_linux_mips64.go │ │ │ ├── zsys_linux_mips64le.go │ │ │ ├── zsys_linux_mipsle.go │ │ │ ├── zsys_linux_ppc.go │ │ │ ├── zsys_linux_ppc64.go │ │ │ ├── zsys_linux_ppc64le.go │ │ │ ├── zsys_linux_s390x.go │ │ │ ├── zsys_netbsd.go │ │ │ ├── zsys_openbsd.go │ │ │ └── zsys_solaris.go │ │ ├── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── unix │ │ │ ├── README.md │ │ │ ├── affinity_linux.go │ │ │ ├── aliases.go │ │ │ ├── asm_aix_ppc64.s │ │ │ ├── asm_darwin_386.s │ │ │ ├── asm_darwin_amd64.s │ │ │ ├── asm_darwin_arm.s │ │ │ ├── asm_darwin_arm64.s │ │ │ ├── asm_dragonfly_amd64.s │ │ │ ├── asm_freebsd_386.s │ │ │ ├── asm_freebsd_amd64.s │ │ │ ├── asm_freebsd_arm.s │ │ │ ├── asm_freebsd_arm64.s │ │ │ ├── asm_linux_386.s │ │ │ ├── asm_linux_amd64.s │ │ │ ├── asm_linux_arm.s │ │ │ ├── asm_linux_arm64.s │ │ │ ├── asm_linux_mips64x.s │ │ │ ├── asm_linux_mipsx.s │ │ │ ├── asm_linux_ppc64x.s │ │ │ ├── asm_linux_s390x.s │ │ │ ├── asm_netbsd_386.s │ │ │ ├── asm_netbsd_amd64.s │ │ │ ├── asm_netbsd_arm.s │ │ │ ├── asm_netbsd_arm64.s │ │ │ ├── asm_openbsd_386.s │ │ │ ├── asm_openbsd_amd64.s │ │ │ ├── asm_openbsd_arm.s │ │ │ ├── asm_solaris_amd64.s │ │ │ ├── bluetooth_linux.go │ │ │ ├── cap_freebsd.go │ │ │ ├── constants.go │ │ │ ├── dev_aix_ppc.go │ │ │ ├── dev_aix_ppc64.go │ │ │ ├── dev_darwin.go │ │ │ ├── dev_dragonfly.go │ │ │ ├── dev_freebsd.go │ │ │ ├── dev_linux.go │ │ │ ├── dev_netbsd.go │ │ │ ├── dev_openbsd.go │ │ │ ├── dirent.go │ │ │ ├── endian_big.go │ │ │ ├── endian_little.go │ │ │ ├── env_unix.go │ │ │ ├── errors_freebsd_386.go │ │ │ ├── errors_freebsd_amd64.go │ │ │ ├── errors_freebsd_arm.go │ │ │ ├── fcntl.go │ │ │ ├── fcntl_darwin.go │ │ │ ├── fcntl_linux_32bit.go │ │ │ ├── gccgo.go │ │ │ ├── gccgo_c.c │ │ │ ├── gccgo_linux_amd64.go │ │ │ ├── ioctl.go │ │ │ ├── mkall.sh │ │ │ ├── mkasm_darwin.go │ │ │ ├── mkerrors.sh │ │ │ ├── mkpost.go │ │ │ ├── mksyscall.go │ │ │ ├── mksyscall_aix_ppc.go │ │ │ ├── mksyscall_aix_ppc64.go │ │ │ ├── mksyscall_solaris.go │ │ │ ├── mksysctl_openbsd.pl │ │ │ ├── mksysnum.go │ │ │ ├── openbsd_pledge.go │ │ │ ├── openbsd_unveil.go │ │ │ ├── pagesize_unix.go │ │ │ ├── race.go │ │ │ ├── race0.go │ │ │ ├── sockcmsg_linux.go │ │ │ ├── sockcmsg_unix.go │ │ │ ├── str.go │ │ │ ├── syscall.go │ │ │ ├── syscall_aix.go │ │ │ ├── syscall_aix_ppc.go │ │ │ ├── syscall_aix_ppc64.go │ │ │ ├── syscall_bsd.go │ │ │ ├── syscall_darwin.go │ │ │ ├── syscall_darwin_386.go │ │ │ ├── syscall_darwin_amd64.go │ │ │ ├── syscall_darwin_arm.go │ │ │ ├── syscall_darwin_arm64.go │ │ │ ├── syscall_darwin_libSystem.go │ │ │ ├── syscall_dragonfly.go │ │ │ ├── syscall_dragonfly_amd64.go │ │ │ ├── syscall_freebsd.go │ │ │ ├── syscall_freebsd_386.go │ │ │ ├── syscall_freebsd_amd64.go │ │ │ ├── syscall_freebsd_arm.go │ │ │ ├── syscall_freebsd_arm64.go │ │ │ ├── syscall_linux.go │ │ │ ├── syscall_linux_386.go │ │ │ ├── syscall_linux_amd64.go │ │ │ ├── syscall_linux_amd64_gc.go │ │ │ ├── syscall_linux_arm.go │ │ │ ├── syscall_linux_arm64.go │ │ │ ├── syscall_linux_gc.go │ │ │ ├── syscall_linux_gc_386.go │ │ │ ├── syscall_linux_gccgo_386.go │ │ │ ├── syscall_linux_gccgo_arm.go │ │ │ ├── syscall_linux_mips64x.go │ │ │ ├── syscall_linux_mipsx.go │ │ │ ├── syscall_linux_ppc64x.go │ │ │ ├── syscall_linux_riscv64.go │ │ │ ├── syscall_linux_s390x.go │ │ │ ├── syscall_linux_sparc64.go │ │ │ ├── syscall_netbsd.go │ │ │ ├── syscall_netbsd_386.go │ │ │ ├── syscall_netbsd_amd64.go │ │ │ ├── syscall_netbsd_arm.go │ │ │ ├── syscall_netbsd_arm64.go │ │ │ ├── syscall_openbsd.go │ │ │ ├── syscall_openbsd_386.go │ │ │ ├── syscall_openbsd_amd64.go │ │ │ ├── syscall_openbsd_arm.go │ │ │ ├── syscall_solaris.go │ │ │ ├── syscall_solaris_amd64.go │ │ │ ├── syscall_unix.go │ │ │ ├── syscall_unix_gc.go │ │ │ ├── syscall_unix_gc_ppc64x.go │ │ │ ├── timestruct.go │ │ │ ├── types_aix.go │ │ │ ├── types_darwin.go │ │ │ ├── types_dragonfly.go │ │ │ ├── types_freebsd.go │ │ │ ├── types_netbsd.go │ │ │ ├── types_openbsd.go │ │ │ ├── types_solaris.go │ │ │ ├── xattr_bsd.go │ │ │ ├── zerrors_aix_ppc.go │ │ │ ├── zerrors_aix_ppc64.go │ │ │ ├── zerrors_darwin_386.go │ │ │ ├── zerrors_darwin_amd64.go │ │ │ ├── zerrors_darwin_arm.go │ │ │ ├── zerrors_darwin_arm64.go │ │ │ ├── zerrors_dragonfly_amd64.go │ │ │ ├── zerrors_freebsd_386.go │ │ │ ├── zerrors_freebsd_amd64.go │ │ │ ├── zerrors_freebsd_arm.go │ │ │ ├── zerrors_freebsd_arm64.go │ │ │ ├── zerrors_linux_386.go │ │ │ ├── zerrors_linux_amd64.go │ │ │ ├── zerrors_linux_arm.go │ │ │ ├── zerrors_linux_arm64.go │ │ │ ├── zerrors_linux_mips.go │ │ │ ├── zerrors_linux_mips64.go │ │ │ ├── zerrors_linux_mips64le.go │ │ │ ├── zerrors_linux_mipsle.go │ │ │ ├── zerrors_linux_ppc64.go │ │ │ ├── zerrors_linux_ppc64le.go │ │ │ ├── zerrors_linux_riscv64.go │ │ │ ├── zerrors_linux_s390x.go │ │ │ ├── zerrors_linux_sparc64.go │ │ │ ├── zerrors_netbsd_386.go │ │ │ ├── zerrors_netbsd_amd64.go │ │ │ ├── zerrors_netbsd_arm.go │ │ │ ├── zerrors_netbsd_arm64.go │ │ │ ├── zerrors_openbsd_386.go │ │ │ ├── zerrors_openbsd_amd64.go │ │ │ ├── zerrors_openbsd_arm.go │ │ │ ├── zerrors_solaris_amd64.go │ │ │ ├── zptrace386_linux.go │ │ │ ├── zptracearm_linux.go │ │ │ ├── zptracemips_linux.go │ │ │ ├── zptracemipsle_linux.go │ │ │ ├── zsyscall_aix_ppc.go │ │ │ ├── zsyscall_aix_ppc64.go │ │ │ ├── zsyscall_aix_ppc64_gc.go │ │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ │ ├── zsyscall_darwin_386.1_11.go │ │ │ ├── zsyscall_darwin_386.go │ │ │ ├── zsyscall_darwin_386.s │ │ │ ├── zsyscall_darwin_amd64.1_11.go │ │ │ ├── zsyscall_darwin_amd64.go │ │ │ ├── zsyscall_darwin_amd64.s │ │ │ ├── zsyscall_darwin_arm.1_11.go │ │ │ ├── zsyscall_darwin_arm.go │ │ │ ├── zsyscall_darwin_arm.s │ │ │ ├── zsyscall_darwin_arm64.1_11.go │ │ │ ├── zsyscall_darwin_arm64.go │ │ │ ├── zsyscall_darwin_arm64.s │ │ │ ├── zsyscall_dragonfly_amd64.go │ │ │ ├── zsyscall_freebsd_386.go │ │ │ ├── zsyscall_freebsd_amd64.go │ │ │ ├── zsyscall_freebsd_arm.go │ │ │ ├── zsyscall_freebsd_arm64.go │ │ │ ├── zsyscall_linux_386.go │ │ │ ├── zsyscall_linux_amd64.go │ │ │ ├── zsyscall_linux_arm.go │ │ │ ├── zsyscall_linux_arm64.go │ │ │ ├── zsyscall_linux_mips.go │ │ │ ├── zsyscall_linux_mips64.go │ │ │ ├── zsyscall_linux_mips64le.go │ │ │ ├── zsyscall_linux_mipsle.go │ │ │ ├── zsyscall_linux_ppc64.go │ │ │ ├── zsyscall_linux_ppc64le.go │ │ │ ├── zsyscall_linux_riscv64.go │ │ │ ├── zsyscall_linux_s390x.go │ │ │ ├── zsyscall_linux_sparc64.go │ │ │ ├── zsyscall_netbsd_386.go │ │ │ ├── zsyscall_netbsd_amd64.go │ │ │ ├── zsyscall_netbsd_arm.go │ │ │ ├── zsyscall_netbsd_arm64.go │ │ │ ├── zsyscall_openbsd_386.go │ │ │ ├── zsyscall_openbsd_amd64.go │ │ │ ├── zsyscall_openbsd_arm.go │ │ │ ├── zsyscall_solaris_amd64.go │ │ │ ├── zsysctl_openbsd_386.go │ │ │ ├── zsysctl_openbsd_amd64.go │ │ │ ├── zsysctl_openbsd_arm.go │ │ │ ├── zsysnum_darwin_386.go │ │ │ ├── zsysnum_darwin_amd64.go │ │ │ ├── zsysnum_darwin_arm.go │ │ │ ├── zsysnum_darwin_arm64.go │ │ │ ├── zsysnum_dragonfly_amd64.go │ │ │ ├── zsysnum_freebsd_386.go │ │ │ ├── zsysnum_freebsd_amd64.go │ │ │ ├── zsysnum_freebsd_arm.go │ │ │ ├── zsysnum_freebsd_arm64.go │ │ │ ├── zsysnum_linux_386.go │ │ │ ├── zsysnum_linux_amd64.go │ │ │ ├── zsysnum_linux_arm.go │ │ │ ├── zsysnum_linux_arm64.go │ │ │ ├── zsysnum_linux_mips.go │ │ │ ├── zsysnum_linux_mips64.go │ │ │ ├── zsysnum_linux_mips64le.go │ │ │ ├── zsysnum_linux_mipsle.go │ │ │ ├── zsysnum_linux_ppc64.go │ │ │ ├── zsysnum_linux_ppc64le.go │ │ │ ├── zsysnum_linux_riscv64.go │ │ │ ├── zsysnum_linux_s390x.go │ │ │ ├── zsysnum_linux_sparc64.go │ │ │ ├── zsysnum_netbsd_386.go │ │ │ ├── zsysnum_netbsd_amd64.go │ │ │ ├── zsysnum_netbsd_arm.go │ │ │ ├── zsysnum_netbsd_arm64.go │ │ │ ├── zsysnum_openbsd_386.go │ │ │ ├── zsysnum_openbsd_amd64.go │ │ │ ├── zsysnum_openbsd_arm.go │ │ │ ├── ztypes_aix_ppc.go │ │ │ ├── ztypes_aix_ppc64.go │ │ │ ├── ztypes_darwin_386.go │ │ │ ├── ztypes_darwin_amd64.go │ │ │ ├── ztypes_darwin_arm.go │ │ │ ├── ztypes_darwin_arm64.go │ │ │ ├── ztypes_dragonfly_amd64.go │ │ │ ├── ztypes_freebsd_386.go │ │ │ ├── ztypes_freebsd_amd64.go │ │ │ ├── ztypes_freebsd_arm.go │ │ │ ├── ztypes_freebsd_arm64.go │ │ │ ├── ztypes_linux_386.go │ │ │ ├── ztypes_linux_amd64.go │ │ │ ├── ztypes_linux_arm.go │ │ │ ├── ztypes_linux_arm64.go │ │ │ ├── ztypes_linux_mips.go │ │ │ ├── ztypes_linux_mips64.go │ │ │ ├── ztypes_linux_mips64le.go │ │ │ ├── ztypes_linux_mipsle.go │ │ │ ├── ztypes_linux_ppc64.go │ │ │ ├── ztypes_linux_ppc64le.go │ │ │ ├── ztypes_linux_riscv64.go │ │ │ ├── ztypes_linux_s390x.go │ │ │ ├── ztypes_linux_sparc64.go │ │ │ ├── ztypes_netbsd_386.go │ │ │ ├── ztypes_netbsd_amd64.go │ │ │ ├── ztypes_netbsd_arm.go │ │ │ ├── ztypes_netbsd_arm64.go │ │ │ ├── ztypes_openbsd_386.go │ │ │ ├── ztypes_openbsd_amd64.go │ │ │ ├── ztypes_openbsd_arm.go │ │ │ └── ztypes_solaris_amd64.go │ │ ├── text │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── secure │ │ │ └── bidirule │ │ │ │ ├── bidirule.go │ │ │ │ ├── bidirule10.0.0.go │ │ │ │ └── bidirule9.0.0.go │ │ ├── transform │ │ │ └── transform.go │ │ └── unicode │ │ │ ├── bidi │ │ │ ├── bidi.go │ │ │ ├── bracket.go │ │ │ ├── core.go │ │ │ ├── gen.go │ │ │ ├── gen_ranges.go │ │ │ ├── gen_trieval.go │ │ │ ├── prop.go │ │ │ ├── tables10.0.0.go │ │ │ ├── tables9.0.0.go │ │ │ └── trieval.go │ │ │ └── norm │ │ │ ├── composition.go │ │ │ ├── forminfo.go │ │ │ ├── input.go │ │ │ ├── iter.go │ │ │ ├── maketables.go │ │ │ ├── normalize.go │ │ │ ├── readwriter.go │ │ │ ├── tables10.0.0.go │ │ │ ├── tables9.0.0.go │ │ │ ├── transform.go │ │ │ ├── trie.go │ │ │ └── triegen.go │ │ └── time │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── rate │ │ └── rate.go │ ├── gopkg.in │ ├── amz.v1 │ │ ├── LICENSE │ │ ├── aws │ │ │ ├── attempt.go │ │ │ ├── aws.go │ │ │ └── sign.go │ │ └── s3 │ │ │ ├── multi.go │ │ │ ├── s3.go │ │ │ └── sign.go │ ├── go-playground │ │ └── validator.v8 │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── baked_in.go │ │ │ ├── cache.go │ │ │ ├── doc.go │ │ │ ├── logo.png │ │ │ ├── regexes.go │ │ │ ├── util.go │ │ │ └── validator.go │ └── yaml.v2 │ │ ├── LICENSE │ │ ├── LICENSE.libyaml │ │ ├── NOTICE │ │ ├── README.md │ │ ├── apic.go │ │ ├── decode.go │ │ ├── emitterc.go │ │ ├── encode.go │ │ ├── go.mod │ │ ├── parserc.go │ │ ├── readerc.go │ │ ├── resolve.go │ │ ├── scannerc.go │ │ ├── sorter.go │ │ ├── writerc.go │ │ ├── yaml.go │ │ ├── yamlh.go │ │ └── yamlprivateh.go │ └── vendor.json ├── filestore-server-pkg ├── README.md ├── assets │ └── asset.go ├── cache │ └── redis │ │ └── conn.go ├── common │ └── store.go ├── config │ ├── ceph.go │ ├── db.go │ ├── oss.go │ ├── rabbitmq.go │ ├── service.go │ └── store.go ├── db │ ├── file.go │ ├── mysql │ │ └── conn.go │ ├── user.go │ └── userfile.go ├── doc │ ├── ci-cd.png │ ├── structure.png │ └── table.sql ├── handler │ ├── auth.go │ ├── mpupload.go │ ├── upload.go │ └── user.go ├── meta │ ├── filemeta.go │ └── sort.go ├── mq │ ├── consumer.go │ ├── define.go │ └── producer.go ├── service │ ├── transfer │ │ └── main.go │ └── upload │ │ └── main.go ├── static │ ├── img │ │ └── avatar.jpeg │ ├── js │ │ └── auth.js │ └── view │ │ ├── home.html │ │ ├── index.html │ │ ├── signin.html │ │ └── signup.html ├── store │ ├── ceph │ │ └── ceph_conn.go │ └── oss │ │ └── oss_conn.go ├── test │ ├── test_ceph.go │ └── test_mpupload.go └── util │ ├── resp.go │ └── util.go ├── filestore-server-v0.2 ├── README.md ├── cache │ └── redis │ │ └── conn.go ├── common │ └── store.go ├── config │ ├── ceph.go │ ├── db.go │ ├── oss.go │ ├── service.go │ └── store.go ├── db │ ├── file.go │ ├── mysql │ │ └── conn.go │ ├── user.go │ └── userfile.go ├── doc │ ├── ci-cd.png │ ├── structure.png │ └── table.sql ├── handler │ ├── auth.go │ ├── mpupload.go │ ├── upload.go │ └── user.go ├── main.go ├── meta │ ├── filemeta.go │ └── sort.go ├── static │ ├── img │ │ └── avatar.jpeg │ ├── js │ │ └── auth.js │ └── view │ │ ├── home.html │ │ ├── index.html │ │ ├── signin.html │ │ └── signup.html ├── store │ ├── ceph │ │ └── ceph_conn.go │ └── oss │ │ └── oss_conn.go ├── test │ ├── test_ceph.go │ └── test_mpupload.go └── util │ ├── resp.go │ └── util.go └── filestore-server-v0.3 ├── README.md ├── cache └── redis │ └── conn.go ├── common └── store.go ├── config ├── ceph.go ├── db.go ├── oss.go ├── rabbitmq.go ├── service.go └── store.go ├── db ├── file.go ├── mysql │ └── conn.go ├── user.go └── userfile.go ├── doc ├── ci-cd.png ├── structure.png └── table.sql ├── handler ├── auth.go ├── mpupload.go ├── upload.go └── user.go ├── meta ├── filemeta.go └── sort.go ├── mq ├── consumer.go ├── define.go └── producer.go ├── service ├── transfer │ └── main.go └── upload │ └── main.go ├── static ├── img │ └── avatar.jpeg ├── js │ └── auth.js └── view │ ├── home.html │ ├── index.html │ ├── signin.html │ └── signup.html ├── store ├── ceph │ └── ceph_conn.go └── oss │ └── oss_conn.go ├── test ├── test_ceph.go └── test_mpupload.go └── util ├── resp.go └── util.go /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/.DS_Store -------------------------------------------------------------------------------- /filestore-server-charter10/.gitignore: -------------------------------------------------------------------------------- 1 | service/bin 2 | -------------------------------------------------------------------------------- /filestore-server-charter10/common/code.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // ErrorCode : 错误码 4 | type ErrorCode int32 5 | 6 | const ( 7 | _ int32 = iota + 9999 8 | // StatusOK : 正常 9 | StatusOK 10 | // StatusParamInvalid : 请求参数无效 11 | StatusParamInvalid 12 | // StatusServerError : 服务出错 13 | StatusServerError 14 | // StatusRegisterFailed : 注册失败 15 | StatusRegisterFailed 16 | // StatusLoginFailed : 登录失败 17 | StatusLoginFailed 18 | // StatusTokenInvalid : 10005 token无效 19 | StatusTokenInvalid 20 | // StatusUserNotExists: 10006 用户不存在 21 | StatusUserNotExists 22 | ) 23 | -------------------------------------------------------------------------------- /filestore-server-charter10/common/store.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // 存储类型(表示文件存到哪里) 4 | type StoreType int 5 | 6 | const ( 7 | _ StoreType = iota 8 | // StoreLocal : 节点本地 9 | StoreLocal 10 | // StoreCeph : Ceph集群 11 | StoreCeph 12 | // StoreOSS : 阿里OSS 13 | StoreOSS 14 | // StoreMix : 混合(Ceph及OSS) 15 | StoreMix 16 | // StoreAll : 所有类型的存储都存一份数据 17 | StoreAll 18 | ) -------------------------------------------------------------------------------- /filestore-server-charter10/config/ceph.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // CephAccessKey : 访问Key 5 | CephAccessKey = "PFEA7NXWXSOWVTFA16C9" 6 | // CephSecretKey : 访问密钥 7 | CephSecretKey = "cf3dwPMeadGbtEgwFUEA6emRVrVfDHpv0pLXFYby" 8 | // CephGWEndpoint : gateway地址 9 | CephGWEndpoint = "http://<你的rgw_host>:<<你的rgw_port>>" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-charter10/config/db.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // MySQLSource : 要连接的数据库源; 5 | // 其中test:test 是用户名密码; 6 | // 127.0.0.1:3306 是ip及端口; 7 | // fileserver 是数据库名; 8 | // charset=utf8 指定了数据以utf8字符编码进行传输 9 | MySQLSource = "test:test@tcp(127.0.0.1:3306)/fileserver?charset=utf8" 10 | ) -------------------------------------------------------------------------------- /filestore-server-charter10/config/oss.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // OSSBucket : oss bucket名 5 | OSSBucket = "buckettest-filestore2" 6 | // OSSEndpoint : oss endpoint 7 | OSSEndpoint = "oss-cn-shenzhen.aliyuncs.com" 8 | // OSSAccesskeyID : oss访问key 9 | OSSAccesskeyID = "<你的AccesskeyId>" 10 | // OSSAccessKeySecret : oss访问key secret 11 | OSSAccessKeySecret = "<你的AccessKeySecret>" 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-charter10/config/rabbitmq.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // AsyncTransferEnable : 是否开启文件异步转移(默认同步) 5 | AsyncTransferEnable = false 6 | // RabbitURL : rabbitmq服务的入口url 7 | RabbitURL = "amqp://guest:guest@127.0.0.1:5672/" 8 | // TransExchangeName : 用于文件transfer的交换机 9 | TransExchangeName = "uploadserver.trans" 10 | // TransOSSQueueName : oss转移队列名 11 | TransOSSQueueName = "uploadserver.trans.oss" 12 | // TransOSSErrQueueName : oss转移失败后写入另一个队列的队列名 13 | TransOSSErrQueueName = "uploadserver.trans.oss.err" 14 | // TransOSSRoutingKey : routingkey 15 | TransOSSRoutingKey = "oss" 16 | ) 17 | -------------------------------------------------------------------------------- /filestore-server-charter10/config/service.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // UploadServiceHost : 上传服务监听的地址 5 | UploadServiceHost = "0.0.0.0:8080" 6 | ) -------------------------------------------------------------------------------- /filestore-server-charter10/config/store.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | const ( 8 | // TempLocalRootDir : 本地临时存储地址的路径 9 | TempLocalRootDir = "/data/fileserver/" 10 | // TempPartRootDir : 分块文件在本地临时存储地址的路径 11 | TempPartRootDir = "/data/fileserver_part/" 12 | // CephRootDir : Ceph的存储路径prefix 13 | CephRootDir = "/ceph" 14 | // OSSRootDir : OSS的存储路径prefix 15 | OSSRootDir = "oss/" 16 | // CurrentStoreType : 设置当前文件的存储类型 17 | CurrentStoreType = cmn.StoreLocal 18 | ) 19 | -------------------------------------------------------------------------------- /filestore-server-charter10/config/user.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // PasswordSalt : 加密盐 5 | // 更严格来说, 加密盐可以存放在数据库中,每个用户加密盐不一样 6 | PasswordSalt = "*#890" 7 | ) 8 | -------------------------------------------------------------------------------- /filestore-server-charter10/doc/about_gin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-charter10/doc/about_gin.png -------------------------------------------------------------------------------- /filestore-server-charter10/doc/ci-cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-charter10/doc/ci-cd.png -------------------------------------------------------------------------------- /filestore-server-charter10/doc/consul-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-charter10/doc/consul-ui.png -------------------------------------------------------------------------------- /filestore-server-charter10/doc/microservice_interact_archi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-charter10/doc/microservice_interact_archi.png -------------------------------------------------------------------------------- /filestore-server-charter10/doc/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-charter10/doc/structure.png -------------------------------------------------------------------------------- /filestore-server-charter10/mq/define.go: -------------------------------------------------------------------------------- 1 | package mq 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | // TransferData : 将要写到rabbitmq的数据的结构体 8 | type TransferData struct { 9 | FileHash string 10 | CurLocation string 11 | DestLocation string 12 | DestStoreType cmn.StoreType 13 | } 14 | -------------------------------------------------------------------------------- /filestore-server-charter10/service/account/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "time" 6 | 7 | micro "github.com/micro/go-micro" 8 | 9 | "filestore-server/service/account/handler" 10 | proto "filestore-server/service/account/proto" 11 | ) 12 | 13 | func main() { 14 | // 创建一个service 15 | service := micro.NewService( 16 | micro.Name("go.micro.service.user"), 17 | micro.RegisterTTL(time.Second*10), 18 | micro.RegisterInterval(time.Second*5), 19 | ) 20 | service.Init() 21 | 22 | proto.RegisterUserServiceHandler(service.Server(), new(handler.User)) 23 | if err := service.Run(); err != nil { 24 | log.Println(err) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /filestore-server-charter10/service/apigw/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "filestore-server/service/apigw/route" 5 | ) 6 | 7 | func main() { 8 | r := route.Router() 9 | r.Run(":8080") 10 | } 11 | -------------------------------------------------------------------------------- /filestore-server-charter10/service/dbproxy/client/sort.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import "time" 4 | 5 | const baseFormat = "2006-01-02 15:04:05" 6 | 7 | type ByUploadTime []FileMeta 8 | 9 | func (a ByUploadTime) Len() int { 10 | return len(a) 11 | } 12 | 13 | func (a ByUploadTime) Swap(i, j int) { 14 | a[i], a[j] = a[j], a[i] 15 | } 16 | 17 | func (a ByUploadTime) Less(i, j int) bool { 18 | iTime, _ := time.Parse(baseFormat, a[i].UploadAt) 19 | jTime, _ := time.Parse(baseFormat, a[j].UploadAt) 20 | return iTime.UnixNano() > jTime.UnixNano() 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-charter10/service/dbproxy/config/db.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // MySQLSource : 要连接的数据库源; 5 | // 其中test:test 是用户名密码; 6 | // 127.0.0.1:3306 是ip及端口; 7 | // fileserver 是数据库名; 8 | // charset=utf8 指定了数据以utf8字符编码进行传输 9 | MySQLSource = "root:123456@tcp(127.0.0.1:3306)/fileserver?charset=utf8" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-charter10/service/dbproxy/proto/proxy.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package go.micro.service.dbproxy; 4 | 5 | service DBProxyService { 6 | // 请求执行sql动作 7 | rpc ExecuteAction(ReqExec) returns (RespExec) {} 8 | } 9 | 10 | message SingleAction { 11 | string name = 1; 12 | bytes params = 2; // 请求参数列表, json-encoded 13 | } 14 | 15 | message ReqExec { 16 | bool sequence = 1; // 是否严格按照给定顺序串行执行 17 | bool transaction = 2; // 所有action是否在一个事务里执行 18 | int32 resultType = 3; // 0表示每个sql函数的结果都返回; 1表示只返回最后一个执行sql的结果(要求sequence执行) 19 | repeated SingleAction action = 4; // 一个或多个sql函数 20 | } 21 | 22 | message RespExec { 23 | int32 code = 1; 24 | string msg = 2; 25 | bytes data = 3; // 执行的结果 26 | } -------------------------------------------------------------------------------- /filestore-server-charter10/service/download/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | // UploadEntry : 配置上传入口地址 4 | var DownloadEntry = "localhost:38080" 5 | 6 | // DownloadServiceHost : 上传服务监听的地址 7 | var DownloadServiceHost = "0.0.0.0:38080" 8 | -------------------------------------------------------------------------------- /filestore-server-charter10/service/download/proto/download.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package go.micro.service.download; 4 | 5 | service DownloadService { 6 | // 获取下载入口地址 7 | rpc DownloadEntry(ReqEntry) returns (RespEntry) {} 8 | } 9 | 10 | message ReqEntry { 11 | } 12 | 13 | message RespEntry { 14 | int32 code = 1; 15 | string message = 2; 16 | string entry = 3; 17 | } -------------------------------------------------------------------------------- /filestore-server-charter10/service/download/rpc/entry.go: -------------------------------------------------------------------------------- 1 | package rpc 2 | 3 | import ( 4 | "context" 5 | cfg "filestore-server/service/download/config" 6 | dlProto "filestore-server/service/download/proto" 7 | ) 8 | 9 | // Dwonload :download结构体 10 | type Download struct{} 11 | 12 | // DownloadEntry : 获取下载入口 13 | func (u *Download) DownloadEntry( 14 | ctx context.Context, 15 | req *dlProto.ReqEntry, 16 | res *dlProto.RespEntry) error { 17 | 18 | res.Entry = cfg.DownloadEntry 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /filestore-server-charter10/service/stop-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | stop_process() { 4 | sleep 1 5 | pid=`ps aux | grep -v grep | grep "service/bin" | grep $1 | awk '{print $2}'` 6 | if [[ $pid != '' ]]; then 7 | ps aux | grep -v grep | grep "service/bin" | grep $1 | awk '{print $2}' | xargs kill 8 | echo -e "\033[32m已关闭: \033[0m" "$1" 9 | return 1 10 | else 11 | echo -e "\033[31m并未启动: \033[0m" "$1" 12 | return 0 13 | fi 14 | } 15 | 16 | 17 | services=" 18 | apigw 19 | account 20 | transfer 21 | download 22 | upload 23 | dbproxy 24 | " 25 | 26 | # 关闭service 27 | for sname in $services 28 | do 29 | stop_process $sname 30 | done 31 | 32 | echo "执行完毕." 33 | -------------------------------------------------------------------------------- /filestore-server-charter10/service/upload/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | // UploadEntry : 配置上传入口地址 4 | var UploadEntry = "localhost:28080" 5 | 6 | // UploadServiceHost : 上传服务监听的地址 7 | var UploadServiceHost = "0.0.0.0:28080" 8 | -------------------------------------------------------------------------------- /filestore-server-charter10/service/upload/proto/upload.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package go.micro.service.upload; 4 | 5 | service UploadService { 6 | // 获取上传入口地址 7 | rpc UploadEntry(ReqEntry) returns (RespEntry) {} 8 | } 9 | 10 | message ReqEntry { 11 | } 12 | 13 | message RespEntry { 14 | int32 code = 1; 15 | string message = 2; 16 | string entry = 3; 17 | } -------------------------------------------------------------------------------- /filestore-server-charter10/service/upload/rpc/entry.go: -------------------------------------------------------------------------------- 1 | package rpc 2 | 3 | import ( 4 | "context" 5 | cfg "filestore-server/service/upload/config" 6 | upProto "filestore-server/service/upload/proto" 7 | ) 8 | 9 | // Upload : upload结构体 10 | type Upload struct{} 11 | 12 | // UploadEntry : 获取上传入口 13 | func (u *Upload) UploadEntry( 14 | ctx context.Context, 15 | req *upProto.ReqEntry, 16 | res *upProto.RespEntry) error { 17 | 18 | res.Entry = cfg.UploadEntry 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /filestore-server-charter10/static/img/avatar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-charter10/static/img/avatar.jpeg -------------------------------------------------------------------------------- /filestore-server-charter10/static/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-charter10/static/img/loading.gif -------------------------------------------------------------------------------- /filestore-server-charter10/util/shell.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "bytes" 5 | "os/exec" 6 | ) 7 | 8 | // 执行 linux shell command 9 | func ExecLinuxShell(s string) (string, error) { 10 | //函数返回一个io.Writer类型的*Cmd 11 | cmd := exec.Command("/bin/bash", "-c", s) 12 | 13 | //通过bytes.Buffer将byte类型转化为string类型 14 | var result bytes.Buffer 15 | cmd.Stdout = &result 16 | 17 | //Run执行cmd包含的命令,并阻塞直至完成 18 | err := cmd.Run() 19 | if err != nil { 20 | return "", err 21 | } 22 | 23 | return result.String(), err 24 | } 25 | -------------------------------------------------------------------------------- /filestore-server-charter8/common/code.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // ErrorCode : 错误码 4 | type ErrorCode int32 5 | 6 | const ( 7 | _ int32 = iota + 9999 8 | // StatusOK : 10000 正常 9 | StatusOK 10 | // StatusParamInvalid : 10001 请求参数无效 11 | StatusParamInvalid 12 | // StatusServerError : 10002 服务出错 13 | StatusServerError 14 | // StatusRegisterFailed : 10003 注册失败 15 | StatusRegisterFailed 16 | // StatusLoginFailed : 10004 登录失败 17 | StatusLoginFailed 18 | // StatusInvalidToken : 10005 token无效 19 | StatusInvalidToken 20 | ) 21 | -------------------------------------------------------------------------------- /filestore-server-charter8/common/store.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // 存储类型(表示文件存到哪里) 4 | type StoreType int 5 | 6 | const ( 7 | _ StoreType = iota 8 | // StoreLocal : 节点本地 9 | StoreLocal 10 | // StoreCeph : Ceph集群 11 | StoreCeph 12 | // StoreOSS : 阿里OSS 13 | StoreOSS 14 | // StoreMix : 混合(Ceph及OSS) 15 | StoreMix 16 | // StoreAll : 所有类型的存储都存一份数据 17 | StoreAll 18 | ) 19 | -------------------------------------------------------------------------------- /filestore-server-charter8/config/ceph.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // CephAccessKey : 访问Key 5 | CephAccessKey = "8WOOFAOAZ3SKQK3Y5I2L" 6 | // CephSecretKey : 访问密钥 7 | CephSecretKey = "syYWcEmF0Dx7BXrpyDvuAZ3yRe4EmNC9oDrucx3M" 8 | // CephGWEndpoint : gateway地址 9 | CephGWEndpoint = "http://127.0.0.1:9080" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-charter8/config/oss.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // OSSBucket : oss bucket名 5 | OSSBucket = "buckettest-filestore2" 6 | // OSSEndpoint : oss endpoint 7 | OSSEndpoint = "oss-cn-shenzhen.aliyuncs.com" 8 | // OSSAccesskeyID : oss访问key 9 | OSSAccesskeyID = "<你的AccesskeyId>" 10 | // OSSAccessKeySecret : oss访问key secret 11 | OSSAccessKeySecret = "<你的AccessKeySecret>" 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-charter8/config/store.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | const ( 8 | // TempLocalRootDir : 本地临时存储地址的路径 9 | TempLocalRootDir = "/Users/samtake/Documents/GitHub/www/data/fileserver" 10 | // CurrentStoreType : 设置当前文件的存储类型 11 | CurrentStoreType = cmn.StoreOSS 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-charter8/go.mod: -------------------------------------------------------------------------------- 1 | module filestore-server 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/aliyun/aliyun-oss-go-sdk v2.0.6+incompatible 7 | github.com/garyburd/redigo v1.6.0 8 | github.com/go-sql-driver/mysql v1.5.0 9 | github.com/json-iterator/go v1.1.9 10 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect 11 | gopkg.in/amz.v1 v1.0.0-20150111123259-ad23e96a31d2 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-charter8/handler/auth.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "filestore-server/common" 5 | "filestore-server/util" 6 | "net/http" 7 | ) 8 | 9 | // HTTPInterceptor : http请求拦截器 10 | func HTTPInterceptor(h http.HandlerFunc) http.HandlerFunc { 11 | return http.HandlerFunc( 12 | func(w http.ResponseWriter, r *http.Request) { 13 | r.ParseForm() 14 | username := r.Form.Get("username") 15 | token := r.Form.Get("token") 16 | 17 | //验证登录token是否有效 18 | if len(username) < 3 || !IsTokenValid(token) { 19 | // token校验失败则跳转到直接返回失败提示 20 | resp := util.NewRespMsg( 21 | int(common.StatusInvalidToken), 22 | "token无效", 23 | nil, 24 | ) 25 | w.Write(resp.JSONBytes()) 26 | return 27 | } 28 | h(w, r) 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /filestore-server-charter8/meta/sort.go: -------------------------------------------------------------------------------- 1 | package meta 2 | 3 | import "time" 4 | 5 | const baseFormat = "2006-01-02 15:04:05" 6 | 7 | type ByUploadTime []FileMeta 8 | 9 | func (a ByUploadTime) Len() int { 10 | return len(a) 11 | } 12 | 13 | func (a ByUploadTime) Swap(i, j int) { 14 | a[i], a[j] = a[j], a[i] 15 | } 16 | 17 | func (a ByUploadTime) Less(i, j int) bool { 18 | iTime, _ := time.Parse(baseFormat, a[i].UploadAt) 19 | jTime, _ := time.Parse(baseFormat, a[j].UploadAt) 20 | return iTime.UnixNano() > jTime.UnixNano() 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-charter8/static/img/avatar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-charter8/static/img/avatar.jpeg -------------------------------------------------------------------------------- /filestore-server-charter9/common/code.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // ErrorCode : 错误码 4 | type ErrorCode int32 5 | 6 | const ( 7 | _ int32 = iota + 9999 8 | // StatusOK : 10000 正常 9 | StatusOK 10 | // StatusParamInvalid : 10001 请求参数无效 11 | StatusParamInvalid 12 | // StatusServerError : 10002 服务出错 13 | StatusServerError 14 | // StatusRegisterFailed : 10003 注册失败 15 | StatusRegisterFailed 16 | // StatusLoginFailed : 10004 登录失败 17 | StatusLoginFailed 18 | // StatusInvalidToken : 10005 token无效 19 | StatusInvalidToken 20 | ) 21 | -------------------------------------------------------------------------------- /filestore-server-charter9/common/store.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // 存储类型(表示文件存到哪里) 4 | type StoreType int 5 | 6 | const ( 7 | _ StoreType = iota 8 | // StoreLocal : 节点本地 9 | StoreLocal 10 | // StoreCeph : Ceph集群 11 | StoreCeph 12 | // StoreOSS : 阿里OSS 13 | StoreOSS 14 | // StoreMix : 混合(Ceph及OSS) 15 | StoreMix 16 | // StoreAll : 所有类型的存储都存一份数据 17 | StoreAll 18 | ) -------------------------------------------------------------------------------- /filestore-server-charter9/config/ceph.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // CephAccessKey : 访问Key 5 | CephAccessKey = "8WOOFAOAZ3SKQK3Y5I2L" 6 | // CephSecretKey : 访问密钥 7 | CephSecretKey = "syYWcEmF0Dx7BXrpyDvuAZ3yRe4EmNC9oDrucx3M" 8 | // CephGWEndpoint : gateway地址 9 | CephGWEndpoint = "http://127.0.0.1:9080" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-charter9/config/db.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // MySQLSource : 要连接的数据库源; 5 | // 其中test:test 是用户名密码; 6 | // 127.0.0.1:3306 是ip及端口; 7 | // fileserver 是数据库名; 8 | // charset=utf8 指定了数据以utf8字符编码进行传输 9 | MySQLSource = "root:123456@tcp(192.168.43.116:3306)/fileserver?charset=utf8" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-charter9/config/oss.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // OSSBucket : oss bucket名 5 | OSSBucket = "buckettest-filestore2" 6 | // OSSEndpoint : oss endpoint 7 | OSSEndpoint = "oss-cn-shenzhen.aliyuncs.com" 8 | // OSSAccesskeyID : oss访问key 9 | OSSAccesskeyID = "<你的AccesskeyId>" 10 | // OSSAccessKeySecret : oss访问key secret 11 | OSSAccessKeySecret = "<你的AccessKeySecret>" 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-charter9/config/rabbitmq.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // AsyncTransferEnable : 是否开启文件异步转移(默认同步) 5 | AsyncTransferEnable = false 6 | // RabbitURL : rabbitmq服务的入口url 7 | RabbitURL = "amqp://guest:guest@127.0.0.1:5672/" 8 | // TransExchangeName : 用于文件transfer的交换机 9 | TransExchangeName = "uploadserver.trans" 10 | // TransOSSQueueName : oss转移队列名 11 | TransOSSQueueName = "uploadserver.trans.oss" 12 | // TransOSSErrQueueName : oss转移失败后写入另一个队列的队列名 13 | TransOSSErrQueueName = "uploadserver.trans.oss.err" 14 | // TransOSSRoutingKey : routingkey 15 | TransOSSRoutingKey = "oss" 16 | ) 17 | -------------------------------------------------------------------------------- /filestore-server-charter9/config/service.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // UploadServiceHost : 上传服务监听的地址 5 | UploadServiceHost = "0.0.0.0:8010" 6 | ) 7 | -------------------------------------------------------------------------------- /filestore-server-charter9/config/store.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | const ( 8 | // TempLocalRootDir : 本地临时存储地址的路径 9 | // TempLocalRootDir = "/data/fileserver/" 10 | TempLocalRootDir = "/Users/samtake/Documents/GitHub/www/data/fileserver" 11 | // CurrentStoreType : 设置当前文件的存储类型 12 | CurrentStoreType = cmn.StoreLocal 13 | ) 14 | -------------------------------------------------------------------------------- /filestore-server-charter9/doc/ci-cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-charter9/doc/ci-cd.png -------------------------------------------------------------------------------- /filestore-server-charter9/doc/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-charter9/doc/structure.png -------------------------------------------------------------------------------- /filestore-server-charter9/go.mod: -------------------------------------------------------------------------------- 1 | module filestore-server 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/aliyun/aliyun-oss-go-sdk v2.0.6+incompatible 7 | github.com/garyburd/redigo v1.6.0 8 | github.com/go-sql-driver/mysql v1.5.0 9 | github.com/streadway/amqp v0.0.0-20200108173154-1c71cc93ed71 10 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect 11 | gopkg.in/amz.v1 v1.0.0-20150111123259-ad23e96a31d2 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-charter9/handler/auth.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "filestore-server/common" 5 | "filestore-server/util" 6 | "net/http" 7 | ) 8 | 9 | // HTTPInterceptor : http请求拦截器 10 | func HTTPInterceptor(h http.HandlerFunc) http.HandlerFunc { 11 | return http.HandlerFunc( 12 | func(w http.ResponseWriter, r *http.Request) { 13 | r.ParseForm() 14 | username := r.Form.Get("username") 15 | token := r.Form.Get("token") 16 | 17 | //验证登录token是否有效 18 | if len(username) < 3 || !IsTokenValid(token) { 19 | // token校验失败则跳转到直接返回失败提示 20 | resp := util.NewRespMsg( 21 | int(common.StatusInvalidToken), 22 | "token无效", 23 | nil, 24 | ) 25 | w.Write(resp.JSONBytes()) 26 | return 27 | } 28 | h(w, r) 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /filestore-server-charter9/meta/sort.go: -------------------------------------------------------------------------------- 1 | package meta 2 | 3 | import "time" 4 | 5 | const baseFormat = "2006-01-02 15:04:05" 6 | 7 | type ByUploadTime []FileMeta 8 | 9 | func (a ByUploadTime) Len() int { 10 | return len(a) 11 | } 12 | 13 | func (a ByUploadTime) Swap(i, j int) { 14 | a[i], a[j] = a[j], a[i] 15 | } 16 | 17 | func (a ByUploadTime) Less(i, j int) bool { 18 | iTime, _ := time.Parse(baseFormat, a[i].UploadAt) 19 | jTime, _ := time.Parse(baseFormat, a[j].UploadAt) 20 | return iTime.UnixNano() > jTime.UnixNano() 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-charter9/mq/define.go: -------------------------------------------------------------------------------- 1 | package mq 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | // TransferData : 将要写到rabbitmq的数据的结构体 8 | type TransferData struct { 9 | FileHash string 10 | CurLocation string 11 | DestLocation string 12 | DestStoreType cmn.StoreType 13 | } 14 | -------------------------------------------------------------------------------- /filestore-server-charter9/static/img/avatar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-charter9/static/img/avatar.jpeg -------------------------------------------------------------------------------- /filestore-server-gin/common/store.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // StoreType : 存储类型(表示文件存到哪里) 4 | type StoreType int 5 | 6 | const ( 7 | _ StoreType = iota 8 | // StoreLocal : 节点本地 9 | StoreLocal 10 | // StoreCeph : Ceph集群 11 | StoreCeph 12 | // StoreOSS : 阿里OSS 13 | StoreOSS 14 | // StoreMix : 混合(Ceph及OSS) 15 | StoreMix 16 | // StoreAll : 所有类型的存储都存一份数据 17 | StoreAll 18 | ) 19 | -------------------------------------------------------------------------------- /filestore-server-gin/config/ceph.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // CephAccessKey : 访问Key 5 | CephAccessKey = "8WOOFAOAZ3SKQK3Y5I2L" 6 | // CephSecretKey : 访问密钥 7 | CephSecretKey = "syYWcEmF0Dx7BXrpyDvuAZ3yRe4EmNC9oDrucx3M" 8 | // CephGWEndpoint : gateway地址 9 | CephGWEndpoint = "http://127.0.0.1:9080" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-gin/config/db.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // MySQLSource : 要连接的数据库源; 5 | // 其中test:test 是用户名密码; 6 | // 127.0.0.1:3306 是ip及端口; 7 | // fileserver 是数据库名; 8 | // charset=utf8 指定了数据以utf8字符编码进行传输 9 | MySQLSource = "root:123456@tcp(192.168.43.116:3306)/fileserver?charset=utf8" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-gin/config/oss.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // OSSBucket : oss bucket名 5 | OSSBucket = "buckettest-filestore2" 6 | // OSSEndpoint : oss endpoint 7 | OSSEndpoint = "oss-cn-shenzhen.aliyuncs.com" 8 | // OSSAccesskeyID : oss访问key 9 | OSSAccesskeyID = "<你的AccesskeyId>" 10 | // OSSAccessKeySecret : oss访问key secret 11 | OSSAccessKeySecret = "<你的AccessKeySecret>" 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-gin/config/service.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // UploadServiceHost : 上传服务监听的地址 5 | UploadServiceHost = "0.0.0.0:8080" 6 | ) -------------------------------------------------------------------------------- /filestore-server-gin/config/store.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | const ( 8 | // 设置当前文件的存储类型 9 | CurrentStoreType = cmn.StoreLocal 10 | ) -------------------------------------------------------------------------------- /filestore-server-gin/doc/ci-cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-gin/doc/ci-cd.png -------------------------------------------------------------------------------- /filestore-server-gin/doc/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-gin/doc/structure.png -------------------------------------------------------------------------------- /filestore-server-gin/go.mod: -------------------------------------------------------------------------------- 1 | module filestore-server 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/aliyun/aliyun-oss-go-sdk v2.0.6+incompatible 7 | github.com/garyburd/redigo v1.6.0 8 | github.com/gin-gonic/gin v1.5.0 9 | github.com/go-sql-driver/mysql v1.5.0 10 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect 11 | gopkg.in/amz.v1 v1.0.0-20150111123259-ad23e96a31d2 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-gin/handler/auth.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | 7 | "github.com/gin-gonic/gin" 8 | ) 9 | 10 | // Authorize : http请求拦截器 11 | func Authorize() gin.HandlerFunc { 12 | return func(c *gin.Context) { 13 | username := c.Request.FormValue("username") // 用户名 14 | token := c.Request.FormValue("token") // 访问令牌 15 | fmt.Println(username) 16 | fmt.Println(len(token)) 17 | 18 | if len(username) < 3 || !IsTokenValid(token) { 19 | // 验证不通过,不再调用后续的函数处理 20 | c.Abort() 21 | c.JSON(http.StatusUnauthorized, gin.H{"message": "访问未授权"}) 22 | // return可省略, 只要前面执行Abort()就可以让后面的handler函数不再执行 23 | return 24 | } 25 | c.Next() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /filestore-server-gin/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "filestore-server/config" 5 | "filestore-server/route" 6 | "fmt" 7 | ) 8 | 9 | func main() { 10 | // gin framework 11 | router := route.Router() 12 | 13 | // 启动服务并监听端口 14 | err := router.Run(config.UploadServiceHost) 15 | if err != nil { 16 | fmt.Printf("Failed to start server, err:%s\n", err.Error()) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /filestore-server-gin/meta/sort.go: -------------------------------------------------------------------------------- 1 | package meta 2 | 3 | import "time" 4 | 5 | const baseFormat = "2006-01-02 15:04:05" 6 | 7 | type ByUploadTime []FileMeta 8 | 9 | func (a ByUploadTime) Len() int { 10 | return len(a) 11 | } 12 | 13 | func (a ByUploadTime) Swap(i, j int) { 14 | a[i], a[j] = a[j], a[i] 15 | } 16 | 17 | func (a ByUploadTime) Less(i, j int) bool { 18 | iTime, _ := time.Parse(baseFormat, a[i].UploadAt) 19 | jTime, _ := time.Parse(baseFormat, a[j].UploadAt) 20 | return iTime.UnixNano() > jTime.UnixNano() 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-gin/static/img/avatar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-gin/static/img/avatar.jpeg -------------------------------------------------------------------------------- /filestore-server-master/.gitignore: -------------------------------------------------------------------------------- 1 | service/bin 2 | deploy/*/* 3 | !deploy/ci-cd/* 4 | !deploy/traefik*/* 5 | !deploy/service*/* 6 | !deploy/*.sh 7 | !deploy/*/Dockerfile -------------------------------------------------------------------------------- /filestore-server-master/common/code.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // ErrorCode : 错误码 4 | type ErrorCode int32 5 | 6 | const ( 7 | _ int32 = iota + 9999 8 | // StatusOK : 正常 9 | StatusOK 10 | // StatusParamInvalid : 请求参数无效 11 | StatusParamInvalid 12 | // StatusServerError : 服务出错 13 | StatusServerError 14 | // StatusRegisterFailed : 注册失败 15 | StatusRegisterFailed 16 | // StatusLoginFailed : 登录失败 17 | StatusLoginFailed 18 | // StatusTokenInvalid : 10005 token无效 19 | StatusTokenInvalid 20 | // StatusUserNotExists: 10006 用户不存在 21 | StatusUserNotExists 22 | ) 23 | -------------------------------------------------------------------------------- /filestore-server-master/common/flags.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "github.com/micro/cli" 4 | 5 | // CustomFlags : 自定义命令行参数 6 | var CustomFlags = []cli.Flag{ 7 | cli.StringFlag{ 8 | Name: "dbhost", 9 | Value: "127.0.0.1", 10 | Usage: "database address", 11 | }, 12 | cli.StringFlag{ 13 | Name: "mqhost", 14 | Value: "127.0.0.1", 15 | Usage: "mq(rabbitmq) address", 16 | }, 17 | cli.StringFlag{ 18 | Name: "cachehost", 19 | Value: "127.0.0.1", 20 | Usage: "cache(redis) address", 21 | }, 22 | cli.StringFlag{ 23 | Name: "cephhost", 24 | Value: "127.0.0.1", 25 | Usage: "ceph address", 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /filestore-server-master/common/store.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // 存储类型(表示文件存到哪里) 4 | type StoreType int 5 | 6 | const ( 7 | _ StoreType = iota 8 | // StoreLocal : 节点本地 9 | StoreLocal 10 | // StoreCeph : Ceph集群 11 | StoreCeph 12 | // StoreOSS : 阿里OSS 13 | StoreOSS 14 | // StoreMix : 混合(Ceph及OSS) 15 | StoreMix 16 | // StoreAll : 所有类型的存储都存一份数据 17 | StoreAll 18 | ) -------------------------------------------------------------------------------- /filestore-server-master/config/ceph.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // CephAccessKey : 访问Key 5 | CephAccessKey = "PFEA7NXWXSOWVTFA16C9" 6 | // CephSecretKey : 访问密钥 7 | CephSecretKey = "cf3dwPMeadGbtEgwFUEA6emRVrVfDHpv0pLXFYby" 8 | // CephGWEndpoint : gateway地址 9 | CephGWEndpoint = "http://<你的rgw_host>:<<你的rgw_port>>" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-master/config/db.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // MySQLSource : 要连接的数据库源; 5 | // 其中test:test 是用户名密码; 6 | // 127.0.0.1:3306 是ip及端口; 7 | // fileserver 是数据库名; 8 | // charset=utf8 指定了数据以utf8字符编码进行传输 9 | MySQLSource = "test:test@tcp(127.0.0.1:3306)/fileserver?charset=utf8" 10 | ) -------------------------------------------------------------------------------- /filestore-server-master/config/oss.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // OSSBucket : oss bucket名 5 | OSSBucket = "buckettest-filestore2" 6 | // OSSEndpoint : oss endpoint 7 | OSSEndpoint = "oss-cn-shenzhen.aliyuncs.com" 8 | // OSSAccesskeyID : oss访问key 9 | OSSAccesskeyID = "<你的AccesskeyId>" 10 | // OSSAccessKeySecret : oss访问key secret 11 | OSSAccessKeySecret = "<你的AccessKeySecret>" 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-master/config/rabbitmq.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // AsyncTransferEnable : 是否开启文件异步转移(默认同步) 5 | AsyncTransferEnable = false 6 | // TransExchangeName : 用于文件transfer的交换机 7 | TransExchangeName = "uploadserver.trans" 8 | // TransOSSQueueName : oss转移队列名 9 | TransOSSQueueName = "uploadserver.trans.oss" 10 | // TransOSSErrQueueName : oss转移失败后写入另一个队列的队列名 11 | TransOSSErrQueueName = "uploadserver.trans.oss.err" 12 | // TransOSSRoutingKey : routingkey 13 | TransOSSRoutingKey = "oss" 14 | ) 15 | 16 | var ( 17 | // RabbitURL : rabbitmq服务的入口url 18 | RabbitURL = "amqp://guest:guest@127.0.0.1:5672/" 19 | ) 20 | -------------------------------------------------------------------------------- /filestore-server-master/config/service.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // UploadServiceHost : 上传服务监听的地址 5 | UploadServiceHost = "0.0.0.0:8080" 6 | // UploadLBHost: 上传服务LB地址 7 | UploadLBHost = "http://upload.fileserver.com" 8 | // DownloadLBHost: 下载服务LB地址 9 | DownloadLBHost = "http://download.fileserver.com" 10 | // TracerAgentHost: tracing agent地址 11 | TracerAgentHost = "127.0.0.1:6831" 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-master/config/store.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | const ( 8 | // TempLocalRootDir : 本地临时存储地址的路径 9 | TempLocalRootDir = "/data/fileserver/" 10 | // TempPartRootDir : 分块文件在本地临时存储地址的路径 11 | TempPartRootDir = "/data/fileserver_part/" 12 | // CephRootDir : Ceph的存储路径prefix 13 | CephRootDir = "/ceph" 14 | // OSSRootDir : OSS的存储路径prefix 15 | OSSRootDir = "oss/" 16 | // CurrentStoreType : 设置当前文件的存储类型 17 | CurrentStoreType = cmn.StoreLocal 18 | ) 19 | -------------------------------------------------------------------------------- /filestore-server-master/config/user.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // PasswordSalt : 加密盐 5 | // 更严格来说, 加密盐可以存放在数据库中,每个用户加密盐不一样 6 | PasswordSalt = "*#890" 7 | ) 8 | -------------------------------------------------------------------------------- /filestore-server-master/deploy/ci-cd/gitlab/README.md: -------------------------------------------------------------------------------- 1 | 可通过`docker-compose up -d`启动,gitlab中一般要配置邮件发送的账号,用于创建新用户时的邮件通知及找回密码等. -------------------------------------------------------------------------------- /filestore-server-master/deploy/ci-cd/harbor/README.md: -------------------------------------------------------------------------------- 1 | 具体可参考12-1离线安装方式 -------------------------------------------------------------------------------- /filestore-server-master/deploy/ci-cd/jenkins/README.md: -------------------------------------------------------------------------------- 1 | 可通过docker一键创建jenkins: 2 | ``` 3 | docker run -d --name jenkins -p 8080:8080 -p 50000:50000 -v /var/jenkins_home:/var/jenkins_home --restart always --privileged jenkins/jenkins:lts 4 | ``` -------------------------------------------------------------------------------- /filestore-server-master/deploy/service/account/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | 3 | ADD bin/account / 4 | 5 | RUN chmod 777 /account 6 | 7 | ENV PARAMS="" 8 | 9 | ENTRYPOINT ["sh","-c","/account $PARAMS"] -------------------------------------------------------------------------------- /filestore-server-master/deploy/service/apigw/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | 3 | ADD bin/apigw / 4 | 5 | RUN chmod 777 /apigw 6 | 7 | ENV PARAMS="" 8 | 9 | ENTRYPOINT ["sh","-c","/apigw $PARAMS"] -------------------------------------------------------------------------------- /filestore-server-master/deploy/service/dbproxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | 3 | ADD bin/dbproxy / 4 | 5 | RUN chmod 777 /dbproxy 6 | 7 | ENV PARAMS="" 8 | 9 | ENTRYPOINT ["sh","-c","/dbproxy $PARAMS"] -------------------------------------------------------------------------------- /filestore-server-master/deploy/service/download/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | 3 | ADD bin/download / 4 | 5 | RUN chmod 777 /download 6 | 7 | ENV PARAMS="" 8 | 9 | ENTRYPOINT ["sh","-c","/download $PARAMS"] -------------------------------------------------------------------------------- /filestore-server-master/deploy/service/transfer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | 3 | ADD bin/transfer / 4 | 5 | RUN chmod 777 /transfer 6 | 7 | ENV PARAMS="" 8 | 9 | ENTRYPOINT ["sh","-c","/transfer $PARAMS"] -------------------------------------------------------------------------------- /filestore-server-master/deploy/service/upload/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | 3 | ADD bin/upload / 4 | 5 | RUN chmod 777 /upload 6 | 7 | ENV PARAMS="" 8 | 9 | ENTRYPOINT ["sh","-c","/upload $PARAMS"] -------------------------------------------------------------------------------- /filestore-server-master/deploy/service_dc/.env: -------------------------------------------------------------------------------- 1 | # 替换为实际的hostIP 2 | registryAddr=--registry=consul --registry_address=192.168.2.244:8500 3 | redisAddr=--cachehost=192.168.2.244:6379 4 | mysqlAddr=--dbhost=192.168.2.244:3306 5 | mqAddr=--mqhost=amqp://guest:guest@192.168.200.212:5672/ -------------------------------------------------------------------------------- /filestore-server-master/deploy/service_k8s/batch_deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | kubectl apply -f svc_account.yaml 4 | kubectl apply -f svc_apigw.yaml 5 | kubectl apply -f svc_dbproxy.yaml 6 | kubectl apply -f svc_upload.yaml 7 | kubectl apply -f svc_download.yaml 8 | kubectl apply -f svc_transfer.yaml 9 | # 通知更新配置 10 | kubectl apply -f service-ingress.yaml 11 | -------------------------------------------------------------------------------- /filestore-server-master/deploy/service_k8s/batch_undeploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | kubectl delete -f svc_account.yaml 4 | kubectl delete -f svc_apigw.yaml 5 | kubectl delete -f svc_dbproxy.yaml 6 | kubectl delete -f svc_upload.yaml 7 | kubectl delete -f svc_download.yaml 8 | kubectl delete -f svc_transfer.yaml 9 | # 通知去除配置 10 | kubectl delete -f service-ingress.yaml 11 | -------------------------------------------------------------------------------- /filestore-server-master/deploy/stop_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ROOT_DIR=/data/go/work/src/filestore-server 4 | #ROOT_DIR=/data/imooc/src/filestore-server 5 | services=" 6 | dbproxy 7 | upload 8 | download 9 | transfer 10 | account 11 | apigw 12 | " 13 | 14 | echo -e "\033[32m停止运行微服务容器... \033[0m" 15 | for service in $services 16 | do 17 | app=`sudo docker ps -a | grep "hub.fileserver.com/filestore/${service}" | awk '{print $1}'` 18 | if [[ $app != "" ]];then 19 | echo $app | xargs sudo docker stop 20 | fi 21 | done -------------------------------------------------------------------------------- /filestore-server-master/deploy/traefik_dc/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | proxy: 5 | image: traefik 6 | command: --api --docker --docker.domain=docker.localhost --logLevel=DEBUG 7 | networks: 8 | - apinetwork 9 | ports: 10 | - "80:80" 11 | - "8080:8080" 12 | volumes: 13 | - /var/run/docker.sock:/var/run/docker.sock 14 | - ./traefik.toml:/etc/traefik/traefik.toml 15 | 16 | networks: 17 | apinetwork: 18 | external: 19 | name: fileserver -------------------------------------------------------------------------------- /filestore-server-master/deploy/traefik_dc/traefik.toml: -------------------------------------------------------------------------------- 1 | defaultEntryPoints = ["http"] 2 | insecureSkipVerify = true 3 | [entryPoints] 4 | [entryPoints.http] 5 | address = ":80" -------------------------------------------------------------------------------- /filestore-server-master/deploy/traefik_k8s/README: -------------------------------------------------------------------------------- 1 | # 启动trafik服务 2 | 3 | cd deploy/traefik_k8s 4 | 5 | ## 创建configmap 6 | kubectl create configmap traefik-conf --from-file=traefik.toml -n kube-system 7 | 8 | ## 创建rbac, 权限控制相关 9 | kubectl apply -f traefik-rbac.yaml 10 | 11 | ## 创建traefik代理服务 12 | kubectl apply -f traefik-ds.yaml 13 | 14 | ## 创建traefik ui服务 15 | kubectl apply -f traefik-ui.yaml 16 | 17 | # 之后再启动相关service, 详细可参考 18 | 19 | ``` 20 | deploy/service_k8s/batch_deploy.sh 21 | ``` -------------------------------------------------------------------------------- /filestore-server-master/deploy/traefik_k8s/traefik-ui.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: traefik-web-ui 6 | namespace: kube-system 7 | spec: 8 | selector: 9 | k8s-app: traefik-ingress-lb 10 | ports: 11 | - name: web 12 | port: 80 13 | targetPort: 8080 14 | 15 | --- 16 | apiVersion: extensions/v1beta1 17 | kind: Ingress 18 | metadata: 19 | name: traefik-web-ui 20 | namespace: kube-system 21 | annotations: 22 | kubernetes.io/ingress.class: traefik 23 | spec: 24 | rules: 25 | - host: traefik.fileserver.com 26 | http: 27 | paths: 28 | - path: / 29 | backend: 30 | serviceName: traefik-web-ui 31 | servicePort: web -------------------------------------------------------------------------------- /filestore-server-master/deploy/traefik_k8s/traefik.toml: -------------------------------------------------------------------------------- 1 | defaultEntryPoints = ["http"] 2 | insecureSkipVerify = true 3 | [entryPoints] 4 | [entryPoints.http] 5 | address = ":80" -------------------------------------------------------------------------------- /filestore-server-master/doc/about_gin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/doc/about_gin.png -------------------------------------------------------------------------------- /filestore-server-master/doc/ci-cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/doc/ci-cd.png -------------------------------------------------------------------------------- /filestore-server-master/doc/consul-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/doc/consul-ui.png -------------------------------------------------------------------------------- /filestore-server-master/doc/k8s_v1.14.1_dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/doc/k8s_v1.14.1_dashboard.png -------------------------------------------------------------------------------- /filestore-server-master/doc/microservice_interact_archi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/doc/microservice_interact_archi.png -------------------------------------------------------------------------------- /filestore-server-master/doc/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/doc/structure.png -------------------------------------------------------------------------------- /filestore-server-master/doc/云存储系统.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/doc/云存储系统.png -------------------------------------------------------------------------------- /filestore-server-master/doc/课程技能树.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/doc/课程技能树.png -------------------------------------------------------------------------------- /filestore-server-master/mq/define.go: -------------------------------------------------------------------------------- 1 | package mq 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | // TransferData : 将要写到rabbitmq的数据的结构体 8 | type TransferData struct { 9 | FileHash string 10 | CurLocation string 11 | DestLocation string 12 | DestStoreType cmn.StoreType 13 | } 14 | -------------------------------------------------------------------------------- /filestore-server-master/mq/producer.go: -------------------------------------------------------------------------------- 1 | package mq 2 | 3 | import ( 4 | "filestore-server/config" 5 | 6 | "github.com/streadway/amqp" 7 | ) 8 | 9 | // Publish : 发布消息 10 | func Publish(exchange, routingKey string, msg []byte) bool { 11 | if !initChannel(config.RabbitURL) { 12 | return false 13 | } 14 | 15 | if nil == channel.Publish( 16 | exchange, 17 | routingKey, 18 | false, // 如果没有对应的queue, 就会丢弃这条消息 19 | false, // 20 | amqp.Publishing{ 21 | ContentType: "text/plain", 22 | Body: msg}) { 23 | return true 24 | } 25 | return false 26 | } 27 | -------------------------------------------------------------------------------- /filestore-server-master/service/apigw/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "filestore-server/service/apigw/route" 5 | ) 6 | 7 | func main() { 8 | r := route.Router() 9 | r.Run(":8080") 10 | } 11 | -------------------------------------------------------------------------------- /filestore-server-master/service/dbproxy/client/sort.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import "time" 4 | 5 | const baseFormat = "2006-01-02 15:04:05" 6 | 7 | type ByUploadTime []FileMeta 8 | 9 | func (a ByUploadTime) Len() int { 10 | return len(a) 11 | } 12 | 13 | func (a ByUploadTime) Swap(i, j int) { 14 | a[i], a[j] = a[j], a[i] 15 | } 16 | 17 | func (a ByUploadTime) Less(i, j int) bool { 18 | iTime, _ := time.Parse(baseFormat, a[i].UploadAt) 19 | jTime, _ := time.Parse(baseFormat, a[j].UploadAt) 20 | return iTime.UnixNano() > jTime.UnixNano() 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-master/service/dbproxy/config/db.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import "fmt" 4 | 5 | var ( 6 | // MySQLSource : 要连接的数据库源; 7 | // 其中test:test 是用户名密码; 8 | // 127.0.0.1:3306 是ip及端口; 9 | // fileserver 是数据库名; 10 | // charset=utf8 指定了数据以utf8字符编码进行传输 11 | MySQLSource = "root:123456@tcp(127.0.0.1:3306)/fileserver?charset=utf8" 12 | ) 13 | 14 | func UpdateDBHost(host string) { 15 | MySQLSource = fmt.Sprintf("root:123456@tcp(%s)/fileserver?charset=utf8", host) 16 | } 17 | -------------------------------------------------------------------------------- /filestore-server-master/service/dbproxy/proto/proxy.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package go.micro.service.dbproxy; 4 | 5 | service DBProxyService { 6 | // 请求执行sql动作 7 | rpc ExecuteAction(ReqExec) returns (RespExec) {} 8 | } 9 | 10 | message SingleAction { 11 | string name = 1; 12 | bytes params = 2; // 请求参数列表, json-encoded 13 | } 14 | 15 | message ReqExec { 16 | bool sequence = 1; // 是否严格按照给定顺序串行执行 17 | bool transaction = 2; // 所有action是否在一个事务里执行 18 | int32 resultType = 3; // 0表示每个sql函数的结果都返回; 1表示只返回最后一个执行sql的结果(要求sequence执行) 19 | repeated SingleAction action = 4; // 一个或多个sql函数 20 | } 21 | 22 | message RespExec { 23 | int32 code = 1; 24 | string msg = 2; 25 | bytes data = 3; // 执行的结果 26 | } -------------------------------------------------------------------------------- /filestore-server-master/service/download/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | // UploadEntry : 配置上传入口地址 4 | var DownloadEntry = "localhost:38080" 5 | 6 | // DownloadServiceHost : 上传服务监听的地址 7 | var DownloadServiceHost = "0.0.0.0:38080" 8 | -------------------------------------------------------------------------------- /filestore-server-master/service/download/proto/download.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package go.micro.service.download; 4 | 5 | service DownloadService { 6 | // 获取下载入口地址 7 | rpc DownloadEntry(ReqEntry) returns (RespEntry) {} 8 | } 9 | 10 | message ReqEntry { 11 | } 12 | 13 | message RespEntry { 14 | int32 code = 1; 15 | string message = 2; 16 | string entry = 3; 17 | } -------------------------------------------------------------------------------- /filestore-server-master/service/download/rpc/entry.go: -------------------------------------------------------------------------------- 1 | package rpc 2 | 3 | import ( 4 | "context" 5 | cfg "filestore-server/service/download/config" 6 | dlProto "filestore-server/service/download/proto" 7 | ) 8 | 9 | // Dwonload :download结构体 10 | type Download struct{} 11 | 12 | // DownloadEntry : 获取下载入口 13 | func (u *Download) DownloadEntry( 14 | ctx context.Context, 15 | req *dlProto.ReqEntry, 16 | res *dlProto.RespEntry) error { 17 | 18 | res.Entry = cfg.DownloadEntry 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /filestore-server-master/service/stop-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | stop_process() { 4 | sleep 1 5 | pid=`ps aux | grep -v grep | grep "service/bin" | grep $1 | awk '{print $2}'` 6 | if [[ $pid != '' ]]; then 7 | ps aux | grep -v grep | grep "service/bin" | grep $1 | awk '{print $2}' | xargs kill 8 | echo -e "\033[32m已关闭: \033[0m" "$1" 9 | return 1 10 | else 11 | echo -e "\033[31m并未启动: \033[0m" "$1" 12 | return 0 13 | fi 14 | } 15 | 16 | 17 | services=" 18 | apigw 19 | account 20 | transfer 21 | download 22 | upload 23 | dbproxy 24 | " 25 | 26 | # 关闭service 27 | for sname in $services 28 | do 29 | stop_process $sname 30 | done 31 | 32 | echo "执行完毕." 33 | -------------------------------------------------------------------------------- /filestore-server-master/service/upload/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | // UploadEntry : 配置上传入口地址 4 | var UploadEntry = "localhost:28080" 5 | 6 | // UploadServiceHost : 上传服务监听的地址 7 | var UploadServiceHost = "0.0.0.0:28080" 8 | -------------------------------------------------------------------------------- /filestore-server-master/service/upload/proto/upload.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package go.micro.service.upload; 4 | 5 | service UploadService { 6 | // 获取上传入口地址 7 | rpc UploadEntry(ReqEntry) returns (RespEntry) {} 8 | } 9 | 10 | message ReqEntry { 11 | } 12 | 13 | message RespEntry { 14 | int32 code = 1; 15 | string message = 2; 16 | string entry = 3; 17 | } -------------------------------------------------------------------------------- /filestore-server-master/service/upload/rpc/entry.go: -------------------------------------------------------------------------------- 1 | package rpc 2 | 3 | import ( 4 | "context" 5 | cfg "filestore-server/service/upload/config" 6 | upProto "filestore-server/service/upload/proto" 7 | ) 8 | 9 | // Upload : upload结构体 10 | type Upload struct{} 11 | 12 | // UploadEntry : 获取上传入口 13 | func (u *Upload) UploadEntry( 14 | ctx context.Context, 15 | req *upProto.ReqEntry, 16 | res *upProto.RespEntry) error { 17 | 18 | res.Entry = cfg.UploadEntry 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /filestore-server-master/static/img/avatar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/static/img/avatar.jpeg -------------------------------------------------------------------------------- /filestore-server-master/static/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/static/img/loading.gif -------------------------------------------------------------------------------- /filestore-server-master/util/shell.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "bytes" 5 | "os/exec" 6 | ) 7 | 8 | // 执行 linux shell command 9 | func ExecLinuxShell(s string) (string, error) { 10 | //函数返回一个io.Writer类型的*Cmd 11 | cmd := exec.Command("/bin/bash", "-c", s) 12 | 13 | //通过bytes.Buffer将byte类型转化为string类型 14 | var result bytes.Buffer 15 | cmd.Stdout = &result 16 | 17 | //Run执行cmd包含的命令,并阻塞直至完成 18 | err := cmd.Run() 19 | if err != nil { 20 | return "", err 21 | } 22 | 23 | return result.String(), err 24 | } 25 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/common/code.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // ErrorCode : 错误码 4 | type ErrorCode int32 5 | 6 | const ( 7 | _ int32 = iota + 9999 8 | // StatusOK : 正常 9 | StatusOK 10 | // StatusParamInvalid : 请求参数无效 11 | StatusParamInvalid 12 | // StatusServerError : 服务出错 13 | StatusServerError 14 | // StatusRegisterFailed : 注册失败 15 | StatusRegisterFailed 16 | // StatusLoginFailed : 登录失败 17 | StatusLoginFailed 18 | // StatusTokenInvalid : 10005 token无效 19 | StatusTokenInvalid 20 | // StatusUserNotExists: 10006 用户不存在 21 | StatusUserNotExists 22 | ) 23 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/common/flags.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "github.com/micro/cli" 4 | 5 | // CustomFlags : 自定义命令行参数 6 | var CustomFlags = []cli.Flag{ 7 | cli.StringFlag{ 8 | Name: "dbhost", 9 | Value: "127.0.0.1", 10 | Usage: "database address", 11 | }, 12 | cli.StringFlag{ 13 | Name: "mqhost", 14 | Value: "127.0.0.1", 15 | Usage: "mq(rabbitmq) address", 16 | }, 17 | cli.StringFlag{ 18 | Name: "cachehost", 19 | Value: "127.0.0.1", 20 | Usage: "cache(redis) address", 21 | }, 22 | cli.StringFlag{ 23 | Name: "cephhost", 24 | Value: "127.0.0.1", 25 | Usage: "ceph address", 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/common/store.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // 存储类型(表示文件存到哪里) 4 | type StoreType int 5 | 6 | const ( 7 | _ StoreType = iota 8 | // StoreLocal : 节点本地 9 | StoreLocal 10 | // StoreCeph : Ceph集群 11 | StoreCeph 12 | // StoreOSS : 阿里OSS 13 | StoreOSS 14 | // StoreMix : 混合(Ceph及OSS) 15 | StoreMix 16 | // StoreAll : 所有类型的存储都存一份数据 17 | StoreAll 18 | ) -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/config/ceph.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // CephAccessKey : 访问Key 5 | CephAccessKey = "PFEA7NXWXSOWVTFA16C9" 6 | // CephSecretKey : 访问密钥 7 | CephSecretKey = "cf3dwPMeadGbtEgwFUEA6emRVrVfDHpv0pLXFYby" 8 | // CephGWEndpoint : gateway地址 9 | CephGWEndpoint = "http://<你的rgw_host>:<<你的rgw_port>>" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/config/db.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // MySQLSource : 要连接的数据库源; 5 | // 其中test:test 是用户名密码; 6 | // 127.0.0.1:3306 是ip及端口; 7 | // fileserver 是数据库名; 8 | // charset=utf8 指定了数据以utf8字符编码进行传输 9 | MySQLSource = "test:test@tcp(127.0.0.1:3306)/fileserver?charset=utf8" 10 | ) -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/config/oss.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // OSSBucket : oss bucket名 5 | OSSBucket = "buckettest-filestore2" 6 | // OSSEndpoint : oss endpoint 7 | OSSEndpoint = "oss-cn-shenzhen.aliyuncs.com" 8 | // OSSAccesskeyID : oss访问key 9 | OSSAccesskeyID = "<你的AccesskeyId>" 10 | // OSSAccessKeySecret : oss访问key secret 11 | OSSAccessKeySecret = "<你的AccessKeySecret>" 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/config/rabbitmq.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // AsyncTransferEnable : 是否开启文件异步转移(默认同步) 5 | AsyncTransferEnable = false 6 | // TransExchangeName : 用于文件transfer的交换机 7 | TransExchangeName = "uploadserver.trans" 8 | // TransOSSQueueName : oss转移队列名 9 | TransOSSQueueName = "uploadserver.trans.oss" 10 | // TransOSSErrQueueName : oss转移失败后写入另一个队列的队列名 11 | TransOSSErrQueueName = "uploadserver.trans.oss.err" 12 | // TransOSSRoutingKey : routingkey 13 | TransOSSRoutingKey = "oss" 14 | ) 15 | 16 | var ( 17 | // RabbitURL : rabbitmq服务的入口url 18 | RabbitURL = "amqp://guest:guest@127.0.0.1:5672/" 19 | ) 20 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/config/service.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // UploadServiceHost : 上传服务监听的地址 5 | UploadServiceHost = "0.0.0.0:8080" 6 | // UploadLBHost: 上传服务LB地址 7 | UploadLBHost = "http://upload.fileserver.com" 8 | // DownloadLBHost: 下载服务LB地址 9 | DownloadLBHost = "http://download.fileserver.com" 10 | // TracerAgentHost: tracing agent地址 11 | TracerAgentHost = "127.0.0.1:6831" 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/config/store.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | const ( 8 | // TempLocalRootDir : 本地临时存储地址的路径 9 | TempLocalRootDir = "/data/fileserver/" 10 | // TempPartRootDir : 分块文件在本地临时存储地址的路径 11 | TempPartRootDir = "/data/fileserver_part/" 12 | // CephRootDir : Ceph的存储路径prefix 13 | CephRootDir = "/ceph" 14 | // OSSRootDir : OSS的存储路径prefix 15 | OSSRootDir = "oss/" 16 | // CurrentStoreType : 设置当前文件的存储类型 17 | CurrentStoreType = cmn.StoreLocal 18 | ) 19 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/config/user.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // PasswordSalt : 加密盐 5 | // 更严格来说, 加密盐可以存放在数据库中,每个用户加密盐不一样 6 | PasswordSalt = "*#890" 7 | ) 8 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/mq/define.go: -------------------------------------------------------------------------------- 1 | package mq 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | // TransferData : 将要写到rabbitmq的数据的结构体 8 | type TransferData struct { 9 | FileHash string 10 | CurLocation string 11 | DestLocation string 12 | DestStoreType cmn.StoreType 13 | } 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/mq/producer.go: -------------------------------------------------------------------------------- 1 | package mq 2 | 3 | import ( 4 | "filestore-server/config" 5 | 6 | "github.com/streadway/amqp" 7 | ) 8 | 9 | // Publish : 发布消息 10 | func Publish(exchange, routingKey string, msg []byte) bool { 11 | if !initChannel(config.RabbitURL) { 12 | return false 13 | } 14 | 15 | if nil == channel.Publish( 16 | exchange, 17 | routingKey, 18 | false, // 如果没有对应的queue, 就会丢弃这条消息 19 | false, // 20 | amqp.Publishing{ 21 | ContentType: "text/plain", 22 | Body: msg}) { 23 | return true 24 | } 25 | return false 26 | } 27 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/filestore-server/util/shell.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "bytes" 5 | "os/exec" 6 | ) 7 | 8 | // 执行 linux shell command 9 | func ExecLinuxShell(s string) (string, error) { 10 | //函数返回一个io.Writer类型的*Cmd 11 | cmd := exec.Command("/bin/bash", "-c", s) 12 | 13 | //通过bytes.Buffer将byte类型转化为string类型 14 | var result bytes.Buffer 15 | cmd.Stdout = &result 16 | 17 | //Run执行cmd包含的命令,并阻塞直至完成 18 | err := cmd.Run() 19 | if err != nil { 20 | return "", err 21 | } 22 | 23 | return result.String(), err 24 | } 25 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/afex/hystrix-go/hystrix/logger.go: -------------------------------------------------------------------------------- 1 | package hystrix 2 | 3 | type logger interface { 4 | Printf(format string, items ...interface{}) 5 | } 6 | 7 | // NoopLogger does not log anything. 8 | type NoopLogger struct{} 9 | 10 | // Printf does nothing. 11 | func (l NoopLogger) Printf(format string, items ...interface{}) {} 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/aliyun/aliyun-oss-go-sdk/oss/limit_reader_1_6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | // "golang.org/x/time/rate" is depended on golang context package go1.7 onward 4 | // this file is only for build,not supports limit upload speed 5 | package oss 6 | 7 | import ( 8 | "fmt" 9 | "io" 10 | ) 11 | 12 | const ( 13 | perTokenBandwidthSize int = 1024 14 | ) 15 | 16 | type OssLimiter struct { 17 | } 18 | 19 | type LimitSpeedReader struct { 20 | io.ReadCloser 21 | reader io.Reader 22 | ossLimiter *OssLimiter 23 | } 24 | 25 | func GetOssLimiter(uploadSpeed int) (ossLimiter *OssLimiter, err error) { 26 | err = fmt.Errorf("rate.Limiter is not supported below version go1.7") 27 | return nil, err 28 | } 29 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/armon/go-metrics/const_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package metrics 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | const ( 10 | // DefaultSignal is used with DefaultInmemSignal 11 | DefaultSignal = syscall.SIGUSR1 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/armon/go-metrics/const_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package metrics 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | const ( 10 | // DefaultSignal is used with DefaultInmemSignal 11 | // Windows has no SIGUSR1, use SIGBREAK 12 | DefaultSignal = syscall.Signal(21) 13 | ) 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/garyburd/redigo/redis/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return cfg.Clone() 9 | } 10 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-contrib/sse/writer.go: -------------------------------------------------------------------------------- 1 | package sse 2 | 3 | import "io" 4 | 5 | type stringWriter interface { 6 | io.Writer 7 | WriteString(string) (int, error) 8 | } 9 | 10 | type stringWrapper struct { 11 | io.Writer 12 | } 13 | 14 | func (w stringWrapper) WriteString(str string) (int, error) { 15 | return w.Writer.Write([]byte(str)) 16 | } 17 | 18 | func checkWriter(writer io.Writer) stringWriter { 19 | if w, ok := writer.(stringWriter); ok { 20 | return w 21 | } else { 22 | return stringWrapper{writer} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/contrib/static/README.md: -------------------------------------------------------------------------------- 1 | # static 2 | 3 | ## EOL-warning 4 | 5 | **This package has been abandoned on 2016-12-13. Please use [gin-contrib/static](https://github.com/gin-contrib/static) instead.** 6 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | - With issues: 4 | - Use the search tool before opening a new issue. 5 | - Please provide source code and commit sha if you found a bug. 6 | - Review existing issues and provide feedback or react to them. 7 | 8 | - With pull requests: 9 | - Open your pull request against `master` 10 | - Your pull request should have no more than two commits, if not you should squash them. 11 | - It should pass all tests in the available continuous integrations systems such as TravisCI. 12 | - You should add/modify tests to cover your proposed code changes. 13 | - If your pull request contains a new feature, please document it on the README. 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/binding/query.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import "net/http" 8 | 9 | type queryBinding struct{} 10 | 11 | func (queryBinding) Name() string { 12 | return "query" 13 | } 14 | 15 | func (queryBinding) Bind(req *http.Request, obj interface{}) error { 16 | values := req.URL.Query() 17 | if err := mapForm(obj, values); err != nil { 18 | return err 19 | } 20 | return validate(obj) 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/binding/uri.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | type uriBinding struct{} 8 | 9 | func (uriBinding) Name() string { 10 | return "uri" 11 | } 12 | 13 | func (uriBinding) BindUri(m map[string][]string, obj interface{}) error { 14 | if err := mapUri(obj, m); err != nil { 15 | return err 16 | } 17 | return validate(obj) 18 | } 19 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | notify: 3 | gitter: 4 | default: 5 | url: https://webhooks.gitter.im/e/d90dcdeeab2f1e357165 6 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/context_17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7 6 | 7 | package gin 8 | 9 | import ( 10 | "github.com/gin-gonic/gin/render" 11 | ) 12 | 13 | // PureJSON serializes the given struct as JSON into the response body. 14 | // PureJSON, unlike JSON, does not replace special html characters with their unicode entities. 15 | func (c *Context) PureJSON(code int, obj interface{}) { 16 | c.Render(code, render.PureJSON{Data: obj}) 17 | } 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/context_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 4 | // Use of this source code is governed by a MIT style 5 | // license that can be found in the LICENSE file. 6 | 7 | package gin 8 | 9 | func init() { 10 | defaultAppEngine = true 11 | } 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package gin implements a HTTP web framework called gin. 3 | 4 | See https://gin-gonic.github.io/gin/ for more information about gin. 5 | */ 6 | package gin // import "github.com/gin-gonic/gin" 7 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/gin-gonic/gin 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 7 | github.com/golang/protobuf v1.3.0 8 | github.com/json-iterator/go v1.1.5 9 | github.com/mattn/go-isatty v0.0.6 10 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 11 | github.com/modern-go/reflect2 v1.0.1 // indirect 12 | github.com/stretchr/testify v1.3.0 13 | github.com/ugorji/go/codec v0.0.0-20190204201341-e444a5086c43 14 | golang.org/x/net v0.0.0-20190301231341-16b79f2e4e95 15 | gopkg.in/go-playground/assert.v1 v1.2.1 // indirect 16 | gopkg.in/go-playground/validator.v8 v8.18.2 17 | gopkg.in/yaml.v2 v2.2.2 18 | ) 19 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/internal/json/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Bo-Yi Wu. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !jsoniter 6 | 7 | package json 8 | 9 | import "encoding/json" 10 | 11 | var ( 12 | // Marshal is exported by gin/json package. 13 | Marshal = json.Marshal 14 | // Unmarshal is exported by gin/json package. 15 | Unmarshal = json.Unmarshal 16 | // MarshalIndent is exported by gin/json package. 17 | MarshalIndent = json.MarshalIndent 18 | // NewDecoder is exported by gin/json package. 19 | NewDecoder = json.NewDecoder 20 | // NewEncoder is exported by gin/json package. 21 | NewEncoder = json.NewEncoder 22 | ) 23 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/response_writer_1.7.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | // Copyright 2018 Gin Core Team. All rights reserved. 4 | // Use of this source code is governed by a MIT style 5 | // license that can be found in the LICENSE file. 6 | 7 | package gin 8 | 9 | // ResponseWriter ... 10 | type ResponseWriter interface { 11 | responseWriterBase 12 | } 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/response_writer_1.8.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | // Copyright 2018 Gin Core Team. All rights reserved. 4 | // Use of this source code is governed by a MIT style 5 | // license that can be found in the LICENSE file. 6 | 7 | package gin 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | // ResponseWriter ... 14 | type ResponseWriter interface { 15 | responseWriterBase 16 | // get the http.Pusher for server push 17 | Pusher() http.Pusher 18 | } 19 | 20 | func (w *responseWriter) Pusher() (pusher http.Pusher) { 21 | if pusher, ok := w.ResponseWriter.(http.Pusher); ok { 22 | return pusher 23 | } 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/test_helpers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import "net/http" 8 | 9 | // CreateTestContext returns a fresh engine and context for testing purposes 10 | func CreateTestContext(w http.ResponseWriter) (c *Context, r *Engine) { 11 | r = New() 12 | c = r.allocateContext() 13 | c.reset() 14 | c.writermem.reset(w) 15 | return 16 | } 17 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gin-gonic/gin/version.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | // Version is the current gin framework's version. 8 | const Version = "v1.4.0-dev" 9 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/go-log/log/log/log.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | golog "log" 5 | ) 6 | 7 | type logLogger struct{} 8 | 9 | func (t *logLogger) Log(v ...interface{}) { 10 | golog.Print(v...) 11 | } 12 | 13 | func (t *logLogger) Logf(format string, v ...interface{}) { 14 | golog.Printf(format, v...) 15 | } 16 | 17 | func New() *logLogger { 18 | return &logLogger{} 19 | } 20 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/go-sql-driver/mysql/appengine.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build appengine 10 | 11 | package mysql 12 | 13 | import ( 14 | "google.golang.org/appengine/cloudsql" 15 | ) 16 | 17 | func init() { 18 | RegisterDial("cloudsql", cloudsql.Dial) 19 | } 20 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/go-sql-driver/mysql/result.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlResult struct { 12 | affectedRows int64 13 | insertId int64 14 | } 15 | 16 | func (res *mysqlResult) LastInsertId() (int64, error) { 17 | return res.insertId, nil 18 | } 19 | 20 | func (res *mysqlResult) RowsAffected() (int64, error) { 21 | return res.affectedRows, nil 22 | } 23 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/gomodule/redigo/redis/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return cfg.Clone() 9 | } 10 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/google/btree/README.md: -------------------------------------------------------------------------------- 1 | # BTree implementation for Go 2 | 3 | ![Travis CI Build Status](https://api.travis-ci.org/google/btree.svg?branch=master) 4 | 5 | This package provides an in-memory B-Tree implementation for Go, useful as 6 | an ordered, mutable data structure. 7 | 8 | The API is based off of the wonderful 9 | http://godoc.org/github.com/petar/GoLLRB/llrb, and is meant to allow btree to 10 | act as a drop-in replacement for gollrb trees. 11 | 12 | See http://godoc.org/github.com/google/btree for documentation. 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/google/btree/go.mod: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | module github.com/google/btree 16 | 17 | go 1.12 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/google/uuid/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We definitely welcome patches and contribution to this project! 4 | 5 | ### Legal requirements 6 | 7 | In order to protect both you and ourselves, you will need to sign the 8 | [Contributor License Agreement](https://cla.developers.google.com/clas). 9 | 10 | You may have already signed it for other Google projects. 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/google/uuid/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Paul Borman 2 | bmatsuo 3 | shawnps 4 | theory 5 | jboverfelt 6 | dsymonds 7 | cd1 8 | wallclockbuilder 9 | dansouza 10 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/google/uuid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package uuid generates and inspects UUIDs. 6 | // 7 | // UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security 8 | // Services. 9 | // 10 | // A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to 11 | // maps or compared directly. 12 | package uuid 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/google/uuid/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/google/uuid 2 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/google/uuid/node_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build js 6 | 7 | package uuid 8 | 9 | // getHardwareInterface returns nil values for the JS version of the code. 10 | // This remvoves the "net" dependency, because it is not used in the browser. 11 | // Using the "net" library inflates the size of the transpiled JS code by 673k bytes. 12 | func getHardwareInterface(name string) (string, []byte) { return "", nil } 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/consul/NOTICE.md: -------------------------------------------------------------------------------- 1 | Copyright © 2014-2018 HashiCorp, Inc. 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this project, you can obtain one at http://mozilla.org/MPL/2.0/. 4 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/consul/api/connect.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // Connect can be used to work with endpoints related to Connect, the 4 | // feature for securely connecting services within Consul. 5 | type Connect struct { 6 | c *Client 7 | } 8 | 9 | // Connect returns a handle to the connect-related endpoints 10 | func (c *Client) Connect() *Connect { 11 | return &Connect{c} 12 | } 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/consul/api/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/consul/api 2 | 3 | go 1.12 4 | 5 | replace github.com/hashicorp/consul/sdk => ../sdk 6 | 7 | require ( 8 | github.com/hashicorp/consul/sdk v0.1.0 9 | github.com/hashicorp/go-cleanhttp v0.5.1 10 | github.com/hashicorp/go-rootcerts v1.0.0 11 | github.com/hashicorp/go-uuid v1.0.1 12 | github.com/hashicorp/serf v0.8.2 13 | github.com/mitchellh/mapstructure v1.1.2 14 | github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c 15 | github.com/stretchr/testify v1.3.0 16 | ) 17 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/consul/api/operator.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // Operator can be used to perform low-level operator tasks for Consul. 4 | type Operator struct { 5 | c *Client 6 | } 7 | 8 | // Operator returns a handle to the operator endpoints. 9 | func (c *Client) Operator() *Operator { 10 | return &Operator{c} 11 | } 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/consul/api/operator_segment.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // SegmentList returns all the available LAN segments. 4 | func (op *Operator) SegmentList(q *QueryOptions) ([]string, *QueryMeta, error) { 5 | var out []string 6 | qm, err := op.c.query("/v1/operator/segment", &out, q) 7 | if err != nil { 8 | return nil, nil, err 9 | } 10 | return out, qm, nil 11 | } 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/errwrap/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/errwrap 2 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-cleanhttp/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/go-cleanhttp 2 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-immutable-radix/edges.go: -------------------------------------------------------------------------------- 1 | package iradix 2 | 3 | import "sort" 4 | 5 | type edges []edge 6 | 7 | func (e edges) Len() int { 8 | return len(e) 9 | } 10 | 11 | func (e edges) Less(i, j int) bool { 12 | return e[i].label < e[j].label 13 | } 14 | 15 | func (e edges) Swap(i, j int) { 16 | e[i], e[j] = e[j], e[i] 17 | } 18 | 19 | func (e edges) Sort() { 20 | sort.Sort(e) 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-immutable-radix/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/go-immutable-radix 2 | 3 | require ( 4 | github.com/hashicorp/go-uuid v1.0.0 5 | github.com/hashicorp/golang-lru v0.5.0 6 | ) 7 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-immutable-radix/go.sum: -------------------------------------------------------------------------------- 1 | github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= 2 | github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 3 | github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= 4 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 5 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-multierror/flatten.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | // Flatten flattens the given error, merging any *Errors together into 4 | // a single *Error. 5 | func Flatten(err error) error { 6 | // If it isn't an *Error, just return the error as-is 7 | if _, ok := err.(*Error); !ok { 8 | return err 9 | } 10 | 11 | // Otherwise, make the result and flatten away! 12 | flatErr := new(Error) 13 | flatten(err, flatErr) 14 | return flatErr 15 | } 16 | 17 | func flatten(err error, flatErr *Error) { 18 | switch err := err.(type) { 19 | case *Error: 20 | for _, e := range err.Errors { 21 | flatten(e, flatErr) 22 | } 23 | default: 24 | flatErr.Errors = append(flatErr.Errors, err) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-multierror/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/go-multierror 2 | 3 | require github.com/hashicorp/errwrap v1.0.0 4 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-multierror/go.sum: -------------------------------------------------------------------------------- 1 | github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce h1:prjrVgOk2Yg6w+PflHoszQNLTUh4kaByUcEWM/9uin4= 2 | github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 3 | github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= 4 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 5 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-multierror/sort.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | // Len implements sort.Interface function for length 4 | func (err Error) Len() int { 5 | return len(err.Errors) 6 | } 7 | 8 | // Swap implements sort.Interface function for swapping elements 9 | func (err Error) Swap(i, j int) { 10 | err.Errors[i], err.Errors[j] = err.Errors[j], err.Errors[i] 11 | } 12 | 13 | // Less implements sort.Interface function for determining order 14 | func (err Error) Less(i, j int) bool { 15 | return err.Errors[i].Error() < err.Errors[j].Error() 16 | } 17 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-rootcerts/Makefile: -------------------------------------------------------------------------------- 1 | TEST?=./... 2 | 3 | test: 4 | go test $(TEST) $(TESTARGS) -timeout=3s -parallel=4 5 | go vet $(TEST) 6 | go test $(TEST) -race 7 | 8 | .PHONY: test 9 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-rootcerts/doc.go: -------------------------------------------------------------------------------- 1 | // Package rootcerts contains functions to aid in loading CA certificates for 2 | // TLS connections. 3 | // 4 | // In addition, its default behavior on Darwin works around an open issue [1] 5 | // in Go's crypto/x509 that prevents certicates from being loaded from the 6 | // System or Login keychains. 7 | // 8 | // [1] https://github.com/golang/go/issues/14514 9 | package rootcerts 10 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-rootcerts/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/go-rootcerts 2 | 3 | require github.com/mitchellh/go-homedir v1.0.0 4 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-rootcerts/go.sum: -------------------------------------------------------------------------------- 1 | github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= 2 | github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 3 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-rootcerts/rootcerts_base.go: -------------------------------------------------------------------------------- 1 | // +build !darwin 2 | 3 | package rootcerts 4 | 5 | import "crypto/x509" 6 | 7 | // LoadSystemCAs does nothing on non-Darwin systems. We return nil so that 8 | // default behavior of standard TLS config libraries is triggered, which is to 9 | // load system certs. 10 | func LoadSystemCAs() (*x509.CertPool, error) { 11 | return nil, nil 12 | } 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-sockaddr/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package sockaddr is a Go implementation of the UNIX socket family data types and 3 | related helper functions. 4 | */ 5 | package sockaddr 6 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-sockaddr/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/go-sockaddr 2 | 3 | require ( 4 | github.com/hashicorp/errwrap v1.0.0 5 | github.com/mitchellh/cli v1.0.0 6 | github.com/mitchellh/go-wordwrap v1.0.0 7 | github.com/ryanuber/columnize v2.1.0+incompatible 8 | ) 9 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-sockaddr/route_info.go: -------------------------------------------------------------------------------- 1 | package sockaddr 2 | 3 | // RouteInterface specifies an interface for obtaining memoized route table and 4 | // network information from a given OS. 5 | type RouteInterface interface { 6 | // GetDefaultInterfaceName returns the name of the interface that has a 7 | // default route or an error and an empty string if a problem was 8 | // encountered. 9 | GetDefaultInterfaceName() (string, error) 10 | } 11 | 12 | // VisitCommands visits each command used by the platform-specific RouteInfo 13 | // implementation. 14 | func (ri routeInfo) VisitCommands(fn func(name string, cmd []string)) { 15 | for k, v := range ri.cmds { 16 | cmds := append([]string(nil), v...) 17 | fn(k, cmds) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/go-sockaddr/route_info_default.go: -------------------------------------------------------------------------------- 1 | // +build android nacl plan9 2 | 3 | package sockaddr 4 | 5 | import "errors" 6 | 7 | // getDefaultIfName is the default interface function for unsupported platforms. 8 | func getDefaultIfName() (string, error) { 9 | return "", errors.New("No default interface found (unsupported platform)") 10 | } 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/memberlist/Makefile: -------------------------------------------------------------------------------- 1 | DEPS := $(shell go list -f '{{range .Imports}}{{.}} {{end}}' ./...) 2 | 3 | test: subnet 4 | go test ./... 5 | 6 | integ: subnet 7 | INTEG_TESTS=yes go test ./... 8 | 9 | subnet: 10 | ./test/setup_subnet.sh 11 | 12 | cov: 13 | gocov test github.com/hashicorp/memberlist | gocov-html > /tmp/coverage.html 14 | open /tmp/coverage.html 15 | 16 | deps: 17 | go get -t -d -v ./... 18 | echo $(DEPS) | xargs -n1 go get -d 19 | 20 | .PHONY: test cov integ 21 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/memberlist/alive_delegate.go: -------------------------------------------------------------------------------- 1 | package memberlist 2 | 3 | // AliveDelegate is used to involve a client in processing 4 | // a node "alive" message. When a node joins, either through 5 | // a UDP gossip or TCP push/pull, we update the state of 6 | // that node via an alive message. This can be used to filter 7 | // a node out and prevent it from being considered a peer 8 | // using application specific logic. 9 | type AliveDelegate interface { 10 | // NotifyAlive is invoked when a message about a live 11 | // node is received from the network. Returning a non-nil 12 | // error prevents the node from being considered a peer. 13 | NotifyAlive(peer *Node) error 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/memberlist/conflict_delegate.go: -------------------------------------------------------------------------------- 1 | package memberlist 2 | 3 | // ConflictDelegate is a used to inform a client that 4 | // a node has attempted to join which would result in a 5 | // name conflict. This happens if two clients are configured 6 | // with the same name but different addresses. 7 | type ConflictDelegate interface { 8 | // NotifyConflict is invoked when a name conflict is detected 9 | NotifyConflict(existing, other *Node) 10 | } 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/memberlist/logging.go: -------------------------------------------------------------------------------- 1 | package memberlist 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | func LogAddress(addr net.Addr) string { 9 | if addr == nil { 10 | return "from=" 11 | } 12 | 13 | return fmt.Sprintf("from=%s", addr.String()) 14 | } 15 | 16 | func LogConn(conn net.Conn) string { 17 | if conn == nil { 18 | return LogAddress(nil) 19 | } 20 | 21 | return LogAddress(conn.RemoteAddr()) 22 | } 23 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/memberlist/merge_delegate.go: -------------------------------------------------------------------------------- 1 | package memberlist 2 | 3 | // MergeDelegate is used to involve a client in 4 | // a potential cluster merge operation. Namely, when 5 | // a node does a TCP push/pull (as part of a join), 6 | // the delegate is involved and allowed to cancel the join 7 | // based on custom logic. The merge delegate is NOT invoked 8 | // as part of the push-pull anti-entropy. 9 | type MergeDelegate interface { 10 | // NotifyMerge is invoked when a merge could take place. 11 | // Provides a list of the nodes known by the peer. If 12 | // the return value is non-nil, the merge is canceled. 13 | NotifyMerge(peers []*Node) error 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/memberlist/ping_delegate.go: -------------------------------------------------------------------------------- 1 | package memberlist 2 | 3 | import "time" 4 | 5 | // PingDelegate is used to notify an observer how long it took for a ping message to 6 | // complete a round trip. It can also be used for writing arbitrary byte slices 7 | // into ack messages. Note that in order to be meaningful for RTT estimates, this 8 | // delegate does not apply to indirect pings, nor fallback pings sent over TCP. 9 | type PingDelegate interface { 10 | // AckPayload is invoked when an ack is being sent; the returned bytes will be appended to the ack 11 | AckPayload() []byte 12 | // NotifyPing is invoked when an ack for a ping is received 13 | NotifyPingComplete(other *Node, rtt time.Duration, payload []byte) 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/memberlist/tag.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # The version must be supplied from the environment. Do not include the 5 | # leading "v". 6 | if [ -z $VERSION ]; then 7 | echo "Please specify a version." 8 | exit 1 9 | fi 10 | 11 | # Generate the tag. 12 | echo "==> Tagging version $VERSION..." 13 | git commit --allow-empty -a --gpg-sign=348FFC4C -m "Release v$VERSION" 14 | git tag -a -m "Version $VERSION" -s -u 348FFC4C "v${VERSION}" master 15 | 16 | exit 0 17 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/hashicorp/memberlist/todo.md: -------------------------------------------------------------------------------- 1 | # TODO 2 | * Dynamic RTT discovery 3 | * Compute 99th percentile for ping/ack 4 | * Better lower bound for ping/ack, faster failure detection 5 | * Dynamic MTU discovery 6 | * Prevent lost updates, increases efficiency 7 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/json-iterator/go/Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | name = "github.com/modern-go/concurrent" 6 | packages = ["."] 7 | revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a" 8 | version = "1.0.0" 9 | 10 | [[projects]] 11 | name = "github.com/modern-go/reflect2" 12 | packages = ["."] 13 | revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" 14 | version = "1.0.1" 15 | 16 | [solve-meta] 17 | analyzer-name = "dep" 18 | analyzer-version = 1 19 | inputs-digest = "ea54a775e5a354cb015502d2e7aa4b74230fc77e894f34a838b268c25ec8eeb8" 20 | solver-name = "gps-cdcl" 21 | solver-version = 1 22 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/json-iterator/go/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -x 4 | 5 | if [ ! -d /tmp/build-golang/src/github.com/json-iterator ]; then 6 | mkdir -p /tmp/build-golang/src/github.com/json-iterator 7 | ln -s $PWD /tmp/build-golang/src/github.com/json-iterator/go 8 | fi 9 | export GOPATH=/tmp/build-golang 10 | go get -u github.com/golang/dep/cmd/dep 11 | cd /tmp/build-golang/src/github.com/json-iterator/go 12 | exec $GOPATH/bin/dep ensure -update 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/json-iterator/go/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -coverprofile=profile.out -coverpkg=github.com/json-iterator/go $d 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mattn/go-isatty/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mattn/go-isatty 2 | 3 | require golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 4 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mattn/go-isatty/go.sum: -------------------------------------------------------------------------------- 1 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= 2 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 3 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mattn/go-isatty/isatty_android.go: -------------------------------------------------------------------------------- 1 | // +build android 2 | 3 | package isatty 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | const ioctlReadTermios = syscall.TCGETS 11 | 12 | // IsTerminal return true if the file descriptor is terminal. 13 | func IsTerminal(fd uintptr) bool { 14 | var termios syscall.Termios 15 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 16 | return err == 0 17 | } 18 | 19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 20 | // terminal. This is also always false on this environment. 21 | func IsCygwinTerminal(fd uintptr) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine 3 | // +build !android 4 | 5 | package isatty 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | // IsTerminal return true if the file descriptor is terminal. 10 | func IsTerminal(fd uintptr) bool { 11 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 12 | return err == nil 13 | } 14 | 15 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 16 | // terminal. This is also always false on this environment. 17 | func IsCygwinTerminal(fd uintptr) bool { 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | // +build appengine js 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on js and appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | 11 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 12 | // terminal. This is also always false on this environment. 13 | func IsCygwinTerminal(fd uintptr) bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | 18 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 19 | // terminal. This is also always false on this environment. 20 | func IsCygwinTerminal(fd uintptr) bool { 21 | return false 22 | } 23 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/cli/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/micro/cli 2 | 3 | require gopkg.in/yaml.v2 v2.2.2 4 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/cli/go.sum: -------------------------------------------------------------------------------- 1 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 2 | gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= 3 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 4 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-log/README.md: -------------------------------------------------------------------------------- 1 | # Log [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![GoDoc](https://godoc.org/github.com/micro/go-log?status.svg)](https://godoc.org/github.com/micro/go-log) 2 | 3 | This is the global logger for all micro based libraries which makes use of [github.com/go-log/log](https://github.com/go-log/log). 4 | 5 | It defaults the logger to the stdlib log implementation. 6 | 7 | ## Set Logger 8 | 9 | Set the logger for micro libraries 10 | 11 | ```go 12 | // import micro/go-log 13 | import "github.com/micro/go-log" 14 | 15 | // SetLogger expects github.com/go-log/log.Logger interface 16 | log.SetLogger(mylogger) 17 | ``` 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-log/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/micro/go-log 2 | 3 | require github.com/go-log/log v0.1.0 4 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-log/go.sum: -------------------------------------------------------------------------------- 1 | github.com/go-log/log v0.1.0 h1:wudGTNsiGzrD5ZjgIkVZ517ugi2XRe9Q/xRCzwEO4/U= 2 | github.com/go-log/log v0.1.0/go.mod h1:4mBwpdRMFLiuXZDCwU2lKQFsoSCo72j3HqBK9d81N2M= 3 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/broker/http/http.go: -------------------------------------------------------------------------------- 1 | // Package http provides a http based message broker 2 | package http 3 | 4 | import ( 5 | "github.com/micro/go-micro/broker" 6 | ) 7 | 8 | // NewBroker returns a new http broker 9 | func NewBroker(opts ...broker.Option) broker.Broker { 10 | return broker.NewBroker(opts...) 11 | } 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/broker/http/options.go: -------------------------------------------------------------------------------- 1 | package http 2 | 3 | import ( 4 | "context" 5 | "net/http" 6 | 7 | "github.com/micro/go-micro/broker" 8 | ) 9 | 10 | // Handle registers the handler for the given pattern. 11 | func Handle(pattern string, handler http.Handler) broker.Option { 12 | return func(o *broker.Options) { 13 | if o.Context == nil { 14 | o.Context = context.Background() 15 | } 16 | handlers, ok := o.Context.Value("http_handlers").(map[string]http.Handler) 17 | if !ok { 18 | handlers = make(map[string]http.Handler) 19 | } 20 | handlers[pattern] = handler 21 | o.Context = context.WithValue(o.Context, "http_handlers", handlers) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/client/backoff.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "context" 5 | "math" 6 | "time" 7 | ) 8 | 9 | type BackoffFunc func(ctx context.Context, req Request, attempts int) (time.Duration, error) 10 | 11 | // exponential backoff 12 | func exponentialBackoff(ctx context.Context, req Request, attempts int) (time.Duration, error) { 13 | if attempts == 0 { 14 | return time.Duration(0), nil 15 | } 16 | return time.Duration(math.Pow(10, float64(attempts))) * time.Millisecond, nil 17 | } 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/client/buffer.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "bytes" 5 | ) 6 | 7 | type buffer struct { 8 | *bytes.Buffer 9 | } 10 | 11 | func (b *buffer) Close() error { 12 | b.Buffer.Reset() 13 | return nil 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/client/context.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "context" 5 | ) 6 | 7 | type clientKey struct{} 8 | 9 | func FromContext(ctx context.Context) (Client, bool) { 10 | c, ok := ctx.Value(clientKey{}).(Client) 11 | return c, ok 12 | } 13 | 14 | func NewContext(ctx context.Context, c Client) context.Context { 15 | return context.WithValue(ctx, clientKey{}, c) 16 | } 17 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/client/wrapper.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/micro/go-micro/registry" 7 | ) 8 | 9 | // CallFunc represents the individual call func 10 | type CallFunc func(ctx context.Context, node *registry.Node, req Request, rsp interface{}, opts CallOptions) error 11 | 12 | // CallWrapper is a low level wrapper for the CallFunc 13 | type CallWrapper func(CallFunc) CallFunc 14 | 15 | // Wrapper wraps a client and returns a client 16 | type Wrapper func(Client) Client 17 | 18 | // StreamWrapper wraps a Stream and returns the equivalent 19 | type StreamWrapper func(Stream) Stream 20 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/codec/json/marshaler.go: -------------------------------------------------------------------------------- 1 | package json 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type Marshaler struct{} 8 | 9 | func (j Marshaler) Marshal(v interface{}) ([]byte, error) { 10 | return json.Marshal(v) 11 | } 12 | 13 | func (j Marshaler) Unmarshal(d []byte, v interface{}) error { 14 | return json.Unmarshal(d, v) 15 | } 16 | 17 | func (j Marshaler) String() string { 18 | return "json" 19 | } 20 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/codec/proto/marshaler.go: -------------------------------------------------------------------------------- 1 | package proto 2 | 3 | import ( 4 | "github.com/golang/protobuf/proto" 5 | ) 6 | 7 | type Marshaler struct{} 8 | 9 | func (Marshaler) Marshal(v interface{}) ([]byte, error) { 10 | return proto.Marshal(v.(proto.Message)) 11 | } 12 | 13 | func (Marshaler) Unmarshal(data []byte, v interface{}) error { 14 | return proto.Unmarshal(data, v.(proto.Message)) 15 | } 16 | 17 | func (Marshaler) Name() string { 18 | return "proto" 19 | } 20 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/codec/protorpc/envelope.proto: -------------------------------------------------------------------------------- 1 | package protorpc; 2 | 3 | message Request { 4 | optional string service_method = 1; 5 | optional fixed64 seq = 2; 6 | } 7 | 8 | message Response { 9 | optional string service_method = 1; 10 | optional fixed64 seq = 2; 11 | optional string error = 3; 12 | } 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/micro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/vendor/github.com/micro/go-micro/micro.png -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/publisher.go: -------------------------------------------------------------------------------- 1 | package micro 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/micro/go-micro/client" 7 | ) 8 | 9 | type publisher struct { 10 | c client.Client 11 | topic string 12 | } 13 | 14 | func (p *publisher) Publish(ctx context.Context, msg interface{}, opts ...client.PublishOption) error { 15 | return p.c.Publish(ctx, p.c.NewMessage(p.topic, msg)) 16 | } 17 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/registry/gossip/README.md: -------------------------------------------------------------------------------- 1 | # Gossip Registry 2 | 3 | Gossip is a zero dependency registry which uses github.com/hashicorp/memberlist to broadcast registry information 4 | via the SWIM protocol. 5 | 6 | ## Usage 7 | 8 | Start with the registry flag or env var 9 | 10 | ```bash 11 | MICRO_REGISTRY=gossip go run service.go 12 | ``` 13 | 14 | On startup you'll see something like 15 | 16 | ```bash 17 | 2018/12/06 18:17:48 Registry Listening on 192.168.1.65:56390 18 | ``` 19 | 20 | To join this gossip ring set the registry address using flag or env var 21 | 22 | ```bash 23 | MICRO_REGISTRY_ADDRESS=192.168.1.65:56390 24 | ``` 25 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/registry/gossip/proto/gossip.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package gossip; 4 | 5 | // Update is the message broadcast 6 | message Update { 7 | // time to live for entry 8 | uint64 expires = 1; 9 | // type of update 10 | int32 type = 2; 11 | // what action is taken 12 | int32 action = 3; 13 | // any other associated metadata about the data 14 | map metadata = 6; 15 | // the payload data; 16 | bytes data = 7; 17 | } 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/registry/mdns/mdns.go: -------------------------------------------------------------------------------- 1 | // Package mdns provides a multicast dns registry 2 | package mdns 3 | 4 | import ( 5 | "github.com/micro/go-micro/registry" 6 | ) 7 | 8 | // NewRegistry returns a new mdns registry 9 | func NewRegistry(opts ...registry.Option) registry.Registry { 10 | return registry.NewRegistry(opts...) 11 | } 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/registry/memory/memory_watcher.go: -------------------------------------------------------------------------------- 1 | package memory 2 | 3 | import ( 4 | "errors" 5 | 6 | "github.com/micro/go-micro/registry" 7 | ) 8 | 9 | type memoryWatcher struct { 10 | exit chan bool 11 | opts registry.WatchOptions 12 | } 13 | 14 | func (m *memoryWatcher) Next() (*registry.Result, error) { 15 | // not implement so we just block until exit 16 | select { 17 | case <-m.exit: 18 | return nil, errors.New("watcher stopped") 19 | } 20 | } 21 | 22 | func (m *memoryWatcher) Stop() { 23 | select { 24 | case <-m.exit: 25 | return 26 | default: 27 | close(m.exit) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/registry/memory/options.go: -------------------------------------------------------------------------------- 1 | package memory 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/micro/go-micro/registry" 7 | ) 8 | 9 | type servicesKey struct{} 10 | 11 | func getServices(ctx context.Context) map[string][]*registry.Service { 12 | s, ok := ctx.Value(servicesKey{}).(map[string][]*registry.Service) 13 | if !ok { 14 | return nil 15 | } 16 | return s 17 | } 18 | 19 | // Services is an option that preloads service data 20 | func Services(s map[string][]*registry.Service) registry.Option { 21 | return func(o *registry.Options) { 22 | if o.Context == nil { 23 | o.Context = context.Background() 24 | } 25 | o.Context = context.WithValue(o.Context, servicesKey{}, s) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/registry/watcher.go: -------------------------------------------------------------------------------- 1 | package registry 2 | 3 | // Watcher is an interface that returns updates 4 | // about services within the registry. 5 | type Watcher interface { 6 | // Next is a blocking call 7 | Next() (*Result, error) 8 | Stop() 9 | } 10 | 11 | // Result is returned by a call to Next on 12 | // the watcher. Actions can be create, update, delete 13 | type Result struct { 14 | Action string 15 | Service *Service 16 | } 17 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/server/buffer.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "bytes" 5 | ) 6 | 7 | type buffer struct { 8 | *bytes.Buffer 9 | } 10 | 11 | func (b *buffer) Close() error { 12 | b.Buffer.Reset() 13 | return nil 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/server/context.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "context" 5 | ) 6 | 7 | type serverKey struct{} 8 | 9 | func wait(ctx context.Context) bool { 10 | if ctx == nil { 11 | return false 12 | } 13 | wait, ok := ctx.Value("wait").(bool) 14 | if !ok { 15 | return false 16 | } 17 | return wait 18 | } 19 | 20 | func FromContext(ctx context.Context) (Server, bool) { 21 | c, ok := ctx.Value(serverKey{}).(Server) 22 | return c, ok 23 | } 24 | 25 | func NewContext(ctx context.Context, s Server) context.Context { 26 | return context.WithValue(ctx, serverKey{}, s) 27 | } 28 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/server/debug.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "github.com/micro/go-micro/server/debug" 5 | ) 6 | 7 | // We use this to wrap any debug handlers so we preserve the signature Debug.{Method} 8 | type Debug struct { 9 | debug.DebugHandler 10 | } 11 | 12 | func registerDebugHandler(s Server) { 13 | s.Handle(s.NewHandler(&Debug{s.Options().DebugHandler}, InternalHandler(true))) 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/transport/http/http.go: -------------------------------------------------------------------------------- 1 | // Package http returns a http2 transport using net/http 2 | package http 3 | 4 | import ( 5 | "github.com/micro/go-micro/transport" 6 | ) 7 | 8 | // NewTransport returns a new http transport using net/http and supporting http2 9 | func NewTransport(opts ...transport.Option) transport.Transport { 10 | return transport.NewTransport(opts...) 11 | } 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-micro/transport/http/options.go: -------------------------------------------------------------------------------- 1 | package http 2 | 3 | import ( 4 | "context" 5 | "net/http" 6 | 7 | "github.com/micro/go-micro/transport" 8 | ) 9 | 10 | // Handle registers the handler for the given pattern. 11 | func Handle(pattern string, handler http.Handler) transport.Option { 12 | return func(o *transport.Options) { 13 | if o.Context == nil { 14 | o.Context = context.Background() 15 | } 16 | handlers, ok := o.Context.Value("http_handlers").(map[string]http.Handler) 17 | if !ok { 18 | handlers = make(map[string]http.Handler) 19 | } 20 | handlers[pattern] = handler 21 | o.Context = context.WithValue(o.Context, "http_handlers", handlers) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-plugins/registry/kubernetes/client/watch/watch.go: -------------------------------------------------------------------------------- 1 | package watch 2 | 3 | import "encoding/json" 4 | 5 | // Watch ... 6 | type Watch interface { 7 | Stop() 8 | ResultChan() <-chan Event 9 | } 10 | 11 | // EventType defines the possible types of events. 12 | type EventType string 13 | 14 | // EventTypes used 15 | const ( 16 | Added EventType = "ADDED" 17 | Modified EventType = "MODIFIED" 18 | Deleted EventType = "DELETED" 19 | Error EventType = "ERROR" 20 | ) 21 | 22 | // Event represents a single event to a watched resource. 23 | type Event struct { 24 | Type EventType `json:"type"` 25 | Object json.RawMessage `json:"object"` 26 | } 27 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-plugins/wrapper/breaker/hystrix/hystrix.go: -------------------------------------------------------------------------------- 1 | package hystrix 2 | 3 | import ( 4 | "github.com/afex/hystrix-go/hystrix" 5 | "github.com/micro/go-micro/client" 6 | 7 | "context" 8 | ) 9 | 10 | type clientWrapper struct { 11 | client.Client 12 | } 13 | 14 | func (c *clientWrapper) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error { 15 | return hystrix.Do(req.Service()+"."+req.Endpoint(), func() error { 16 | return c.Client.Call(ctx, req, rsp, opts...) 17 | }, nil) 18 | } 19 | 20 | // NewClientWrapper returns a hystrix client Wrapper. 21 | func NewClientWrapper() client.Wrapper { 22 | return func(c client.Client) client.Client { 23 | return &clientWrapper{c} 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/go-rcache/options.go: -------------------------------------------------------------------------------- 1 | package rcache 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | // WithTTL sets the cache TTL 8 | func WithTTL(t time.Duration) Option { 9 | return func(o *Options) { 10 | o.TTL = t 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/micro/mdns/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/micro/mdns 2 | 3 | require ( 4 | github.com/miekg/dns v1.1.3 5 | golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664 // indirect 6 | golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 7 | golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc // indirect 8 | ) 9 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/miekg/dns/AUTHORS: -------------------------------------------------------------------------------- 1 | Miek Gieben 2 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/miekg/dns/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Alex A. Skinner 2 | Andrew Tunnell-Jones 3 | Ask Bjørn Hansen 4 | Dave Cheney 5 | Dusty Wilson 6 | Marek Majkowski 7 | Peter van Dijk 8 | Omri Bahumi 9 | Alex Sergeyev 10 | James Hartig 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/miekg/dns/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. All rights reserved. Use of this source code 2 | is governed by a BSD-style license that can be found in the LICENSE file. 3 | Extensions of the original work are copyright (c) 2011 Miek Gieben 4 | 5 | Copyright 2011 Miek Gieben. All rights reserved. Use of this source code is 6 | governed by a BSD-style license that can be found in the LICENSE file. 7 | 8 | Copyright 2014 CloudFlare. All rights reserved. Use of this source code is 9 | governed by a BSD-style license that can be found in the LICENSE file. 10 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/miekg/dns/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build fuzz 2 | 3 | package dns 4 | 5 | func Fuzz(data []byte) int { 6 | msg := new(Msg) 7 | 8 | if err := msg.Unpack(data); err != nil { 9 | return 0 10 | } 11 | if _, err := msg.Pack(); err != nil { 12 | return 0 13 | } 14 | 15 | return 1 16 | } 17 | 18 | func FuzzNewRR(data []byte) int { 19 | if _, err := NewRR(string(data)); err != nil { 20 | return 0 21 | } 22 | return 1 23 | } 24 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/miekg/dns/listen_go_not111.go: -------------------------------------------------------------------------------- 1 | // +build !go1.11 !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd 2 | 3 | package dns 4 | 5 | import "net" 6 | 7 | const supportsReusePort = false 8 | 9 | func listenTCP(network, addr string, reuseport bool) (net.Listener, error) { 10 | if reuseport { 11 | // TODO(tmthrgd): return an error? 12 | } 13 | 14 | return net.Listen(network, addr) 15 | } 16 | 17 | func listenUDP(network, addr string, reuseport bool) (net.PacketConn, error) { 18 | if reuseport { 19 | // TODO(tmthrgd): return an error? 20 | } 21 | 22 | return net.ListenPacket(network, addr) 23 | } 24 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/miekg/dns/version.go: -------------------------------------------------------------------------------- 1 | package dns 2 | 3 | import "fmt" 4 | 5 | // Version is current version of this library. 6 | var Version = V{1, 1, 6} 7 | 8 | // V holds the version of this library. 9 | type V struct { 10 | Major, Minor, Patch int 11 | } 12 | 13 | func (v V) String() string { 14 | return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch) 15 | } 16 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mitchellh/go-homedir/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mitchellh/go-homedir 2 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mitchellh/hashstructure/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mitchellh/hashstructure 2 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mitchellh/hashstructure/include.go: -------------------------------------------------------------------------------- 1 | package hashstructure 2 | 3 | // Includable is an interface that can optionally be implemented by 4 | // a struct. It will be called for each field in the struct to check whether 5 | // it should be included in the hash. 6 | type Includable interface { 7 | HashInclude(field string, v interface{}) (bool, error) 8 | } 9 | 10 | // IncludableMap is an interface that can optionally be implemented by 11 | // a struct. It will be called when a map-type field is found to ask the 12 | // struct if the map item should be included in the hash. 13 | type IncludableMap interface { 14 | HashIncludeMap(field string, k, v interface{}) (bool, error) 15 | } 16 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.1.2 2 | 3 | * Fix error when decode hook decodes interface implementation into interface 4 | type. [GH-140] 5 | 6 | ## 1.1.1 7 | 8 | * Fix panic that can happen in `decodePtr` 9 | 10 | ## 1.1.0 11 | 12 | * Added `StringToIPHookFunc` to convert `string` to `net.IP` and `net.IPNet` [GH-133] 13 | * Support struct to struct decoding [GH-137] 14 | * If source map value is nil, then destination map value is nil (instead of empty) 15 | * If source slice value is nil, then destination slice value is nil (instead of empty) 16 | * If source pointer is nil, then destination pointer is set to nil (instead of 17 | allocated zero value of type) 18 | 19 | ## 1.0.0 20 | 21 | * Initial tagged stable release. 22 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/mitchellh/mapstructure/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mitchellh/mapstructure 2 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/concurrent/executor.go: -------------------------------------------------------------------------------- 1 | package concurrent 2 | 3 | import "context" 4 | 5 | // Executor replace go keyword to start a new goroutine 6 | // the goroutine should cancel itself if the context passed in has been cancelled 7 | // the goroutine started by the executor, is owned by the executor 8 | // we can cancel all executors owned by the executor just by stop the executor itself 9 | // however Executor interface does not Stop method, the one starting and owning executor 10 | // should use the concrete type of executor, instead of this interface. 11 | type Executor interface { 12 | // Go starts a new goroutine controlled by the context 13 | Go(handler func(ctx context.Context)) 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/concurrent/go_above_19.go: -------------------------------------------------------------------------------- 1 | //+build go1.9 2 | 3 | package concurrent 4 | 5 | import "sync" 6 | 7 | // Map is a wrapper for sync.Map introduced in go1.9 8 | type Map struct { 9 | sync.Map 10 | } 11 | 12 | // NewMap creates a thread safe Map 13 | func NewMap() *Map { 14 | return &Map{} 15 | } 16 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/concurrent/log.go: -------------------------------------------------------------------------------- 1 | package concurrent 2 | 3 | import ( 4 | "os" 5 | "log" 6 | "io/ioutil" 7 | ) 8 | 9 | // ErrorLogger is used to print out error, can be set to writer other than stderr 10 | var ErrorLogger = log.New(os.Stderr, "", 0) 11 | 12 | // InfoLogger is used to print informational message, default to off 13 | var InfoLogger = log.New(ioutil.Discard, "", 0) -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/concurrent/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -coverprofile=profile.out -coverpkg=github.com/modern-go/concurrent $d 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | name = "github.com/modern-go/concurrent" 6 | packages = ["."] 7 | revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a" 8 | version = "1.0.0" 9 | 10 | [solve-meta] 11 | analyzer-name = "dep" 12 | analyzer-version = 1 13 | inputs-digest = "daee8a88b3498b61c5640056665b8b9eea062006f5e596bbb6a3ed9119a11ec7" 14 | solver-name = "gps-cdcl" 15 | solver-version = 1 16 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/go_above_17.go: -------------------------------------------------------------------------------- 1 | //+build go1.7 2 | 3 | package reflect2 4 | 5 | import "unsafe" 6 | 7 | //go:linkname resolveTypeOff reflect.resolveTypeOff 8 | func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer 9 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/go_above_19.go: -------------------------------------------------------------------------------- 1 | //+build go1.9 2 | 3 | package reflect2 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | //go:linkname makemap reflect.makemap 10 | func makemap(rtype unsafe.Pointer, cap int) (m unsafe.Pointer) 11 | 12 | func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer { 13 | return makemap(rtype, cap) 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/go_below_17.go: -------------------------------------------------------------------------------- 1 | //+build !go1.7 2 | 3 | package reflect2 4 | 5 | import "unsafe" 6 | 7 | func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer { 8 | return nil 9 | } 10 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/go_below_19.go: -------------------------------------------------------------------------------- 1 | //+build !go1.9 2 | 3 | package reflect2 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | //go:linkname makemap reflect.makemap 10 | func makemap(rtype unsafe.Pointer) (m unsafe.Pointer) 11 | 12 | func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer { 13 | return makemap(rtype) 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/reflect2_amd64.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/vendor/github.com/modern-go/reflect2/reflect2_amd64.s -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_386.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_386.s -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_arm.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_arm.s -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_arm64.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_arm64.s -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_s390x.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/vendor/github.com/modern-go/reflect2/relfect2_s390x.s -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/modern-go/reflect2/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list github.com/modern-go/reflect2-tests/... | grep -v vendor); do 7 | go test -coverprofile=profile.out -coverpkg=github.com/modern-go/reflect2 $d 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/moxiaomomo/go-bindata-assetfs/doc.go: -------------------------------------------------------------------------------- 1 | // assetfs allows packages to serve static content embedded 2 | // with the go-bindata tool with the standard net/http package. 3 | // 4 | // See https://github.com/jteeuwen/go-bindata for more information 5 | // about embedding binary data with go-bindata. 6 | // 7 | // Usage example, after running 8 | // $ go-bindata data/... 9 | // use: 10 | // http.Handle("/", 11 | // http.FileServer( 12 | // &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: "data"})) 13 | package assetfs 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/streadway/amqp/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package amqp 4 | 5 | import "bytes" 6 | 7 | func Fuzz(data []byte) int { 8 | r := reader{bytes.NewReader(data)} 9 | frame, err := r.ReadFrame() 10 | if err != nil { 11 | if frame != nil { 12 | panic("frame is not nil") 13 | } 14 | return 0 15 | } 16 | return 1 17 | } 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/streadway/amqp/gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | go run spec/gen.go < spec/amqp0-9-1.stripped.extended.xml | gofmt > spec091.go 3 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/streadway/amqp/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/streadway/amqp 2 | 3 | go 1.10 4 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/codecgen.go: -------------------------------------------------------------------------------- 1 | // +build codecgen generated 2 | 3 | package codec 4 | 5 | // this file is here, to set the codecgen variable to true 6 | // when the build tag codecgen is set. 7 | // 8 | // this allows us do specific things e.g. skip missing fields tests, 9 | // when running in codecgen mode. 10 | 11 | func init() { 12 | codecgen = true 13 | } 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/ugorji/go/codec 2 | 3 | require github.com/ugorji/go v1.1.2 4 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = true 11 | 12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type { 13 | return reflect.ArrayOf(count, elem) 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = false 11 | 12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type { 13 | panic("codec: reflect.ArrayOf unsupported in this go version") 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.9 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | func makeMapReflect(t reflect.Type, size int) reflect.Value { 11 | if size < 0 { 12 | return reflect.MakeMapWithSize(t, 4) 13 | } 14 | return reflect.MakeMapWithSize(t, size) 15 | } 16 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.9 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | func makeMapReflect(t reflect.Type, size int) reflect.Value { 11 | return reflect.MakeMap(t) 12 | } 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.10 5 | 6 | package codec 7 | 8 | const allowSetUnexportedEmbeddedPtr = false 9 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.10 5 | 6 | package codec 7 | 8 | const allowSetUnexportedEmbeddedPtr = true 9 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.4 5 | 6 | package codec 7 | 8 | // This codec package will only work for go1.4 and above. 9 | // This is for the following reasons: 10 | // - go 1.4 was released in 2014 11 | // - go runtime is written fully in go 12 | // - interface only holds pointers 13 | // - reflect.Value is stabilized as 3 words 14 | 15 | func init() { 16 | panic("codec: go 1.3 and below are not supported") 17 | } 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5,!go1.6 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.6,!go1.7 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") != "0" 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.7 5 | 6 | package codec 7 | 8 | const genCheckVendor = true 9 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | var genCheckVendor = false 9 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/bpf/setter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bpf 6 | 7 | // A Setter is a type which can attach a compiled BPF filter to itself. 8 | type Setter interface { 9 | SetBPF(filter []RawInstruction) error 10 | } 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/http2/Makefile: -------------------------------------------------------------------------------- 1 | curlimage: 2 | docker build -t gohttp2/curl . 3 | 4 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/http2/README: -------------------------------------------------------------------------------- 1 | This is a work-in-progress HTTP/2 implementation for Go. 2 | 3 | It will eventually live in the Go standard library and won't require 4 | any changes to your code to use. It will just be automatic. 5 | 6 | Status: 7 | 8 | * The server support is pretty good. A few things are missing 9 | but are being worked on. 10 | * The client work has just started but shares a lot of code 11 | is coming along much quicker. 12 | 13 | Docs are at https://godoc.org/golang.org/x/net/http2 14 | 15 | Demo test server at https://http2.golang.org/ 16 | 17 | Help & bug reports welcome! 18 | 19 | Contributing: https://golang.org/doc/contribute.html 20 | Bugs: https://golang.org/issue/new?title=x/net/http2:+ 21 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/http2/not_go111.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.11 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http/httptrace" 11 | "net/textproto" 12 | ) 13 | 14 | func traceHasWroteHeaderField(trace *httptrace.ClientTrace) bool { return false } 15 | 16 | func traceWroteHeaderField(trace *httptrace.ClientTrace, k, v string) {} 17 | 18 | func traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error { 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/cmsghdr.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package socket 8 | 9 | func (h *cmsghdr) len() int { return int(h.Len) } 10 | func (h *cmsghdr) lvl() int { return int(h.Level) } 11 | func (h *cmsghdr) typ() int { return int(h.Type) } 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package socket 8 | 9 | func (h *cmsghdr) set(l, lvl, typ int) { 10 | h.Len = uint32(l) 11 | h.Level = int32(lvl) 12 | h.Type = int32(typ) 13 | } 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm mips mipsle 386 6 | // +build linux 7 | 8 | package socket 9 | 10 | func (h *cmsghdr) set(l, lvl, typ int) { 11 | h.Len = uint32(l) 12 | h.Level = int32(lvl) 13 | h.Type = int32(typ) 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64 amd64 ppc64 ppc64le mips64 mips64le s390x 6 | // +build linux 7 | 8 | package socket 9 | 10 | func (h *cmsghdr) set(l, lvl, typ int) { 11 | h.Len = uint64(l) 12 | h.Level = int32(lvl) 13 | h.Type = int32(typ) 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64 6 | // +build solaris 7 | 8 | package socket 9 | 10 | func (h *cmsghdr) set(l, lvl, typ int) { 11 | h.Len = uint32(l) 12 | h.Level = int32(lvl) 13 | h.Type = int32(typ) 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 6 | 7 | package socket 8 | 9 | type cmsghdr struct{} 10 | 11 | const sizeofCmsghdr = 0 12 | 13 | func (h *cmsghdr) len() int { return 0 } 14 | func (h *cmsghdr) lvl() int { return 0 } 15 | func (h *cmsghdr) typ() int { return 0 } 16 | 17 | func (h *cmsghdr) set(l, lvl, typ int) {} 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/empty.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,go1.12 6 | 7 | // This exists solely so we can linkname in symbols from syscall. 8 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/error_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | import "syscall" 8 | 9 | var ( 10 | errERROR_IO_PENDING error = syscall.ERROR_IO_PENDING 11 | errEINVAL error = syscall.EINVAL 12 | ) 13 | 14 | // errnoErr returns common boxed Errno values, to prevent allocations 15 | // at runtime. 16 | func errnoErr(errno syscall.Errno) error { 17 | switch errno { 18 | case 0: 19 | return nil 20 | case syscall.ERROR_IO_PENDING: 21 | return errERROR_IO_PENDING 22 | case syscall.EINVAL: 23 | return errEINVAL 24 | } 25 | return errno 26 | } 27 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/iovec_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm mips mipsle 386 6 | // +build darwin dragonfly freebsd linux netbsd openbsd 7 | 8 | package socket 9 | 10 | import "unsafe" 11 | 12 | func (v *iovec) set(b []byte) { 13 | l := len(b) 14 | if l == 0 { 15 | return 16 | } 17 | v.Base = (*byte)(unsafe.Pointer(&b[0])) 18 | v.Len = uint32(l) 19 | } 20 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/iovec_64bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64 amd64 ppc64 ppc64le mips64 mips64le s390x 6 | // +build darwin dragonfly freebsd linux netbsd openbsd 7 | 8 | package socket 9 | 10 | import "unsafe" 11 | 12 | func (v *iovec) set(b []byte) { 13 | l := len(b) 14 | if l == 0 { 15 | return 16 | } 17 | v.Base = (*byte)(unsafe.Pointer(&b[0])) 18 | v.Len = uint64(l) 19 | } 20 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64 6 | // +build solaris 7 | 8 | package socket 9 | 10 | import "unsafe" 11 | 12 | func (v *iovec) set(b []byte) { 13 | l := len(b) 14 | if l == 0 { 15 | return 16 | } 17 | v.Base = (*int8)(unsafe.Pointer(&b[0])) 18 | v.Len = uint64(l) 19 | } 20 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/iovec_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 6 | 7 | package socket 8 | 9 | type iovec struct{} 10 | 11 | func (v *iovec) set(b []byte) {} 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux,!netbsd 6 | 7 | package socket 8 | 9 | import "net" 10 | 11 | type mmsghdr struct{} 12 | 13 | type mmsghdrs []mmsghdr 14 | 15 | func (hs mmsghdrs) pack(ms []Message, parseFn func([]byte, string) (net.Addr, error), marshalFn func(net.Addr) []byte) error { 16 | return nil 17 | } 18 | 19 | func (hs mmsghdrs) unpack(ms []Message, parseFn func([]byte, string) (net.Addr, error), hint string) error { 20 | return nil 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd 6 | 7 | package socket 8 | 9 | func (h *msghdr) setIov(vs []iovec) { 10 | l := len(vs) 11 | if l == 0 { 12 | return 13 | } 14 | h.Iov = &vs[0] 15 | h.Iovlen = int32(l) 16 | } 17 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm mips mipsle 386 6 | // +build linux 7 | 8 | package socket 9 | 10 | import "unsafe" 11 | 12 | func (h *msghdr) setIov(vs []iovec) { 13 | l := len(vs) 14 | if l == 0 { 15 | return 16 | } 17 | h.Iov = &vs[0] 18 | h.Iovlen = uint32(l) 19 | } 20 | 21 | func (h *msghdr) setControl(b []byte) { 22 | h.Control = (*byte)(unsafe.Pointer(&b[0])) 23 | h.Controllen = uint32(len(b)) 24 | } 25 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64 amd64 ppc64 ppc64le mips64 mips64le s390x 6 | // +build linux 7 | 8 | package socket 9 | 10 | import "unsafe" 11 | 12 | func (h *msghdr) setIov(vs []iovec) { 13 | l := len(vs) 14 | if l == 0 { 15 | return 16 | } 17 | h.Iov = &vs[0] 18 | h.Iovlen = uint64(l) 19 | } 20 | 21 | func (h *msghdr) setControl(b []byte) { 22 | h.Control = (*byte)(unsafe.Pointer(&b[0])) 23 | h.Controllen = uint64(len(b)) 24 | } 25 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/msghdr_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | func (h *msghdr) setIov(vs []iovec) { 8 | l := len(vs) 9 | if l == 0 { 10 | return 11 | } 12 | h.Iov = &vs[0] 13 | h.Iovlen = uint32(l) 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/msghdr_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 6 | 7 | package socket 8 | 9 | type msghdr struct{} 10 | 11 | func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) {} 12 | func (h *msghdr) name() []byte { return nil } 13 | func (h *msghdr) controllen() int { return 0 } 14 | func (h *msghdr) flags() int { return 0 } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux 6 | 7 | package socket 8 | 9 | func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) { 10 | return 0, errNotImplemented 11 | } 12 | 13 | func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) { 14 | return 0, errNotImplemented 15 | } 16 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package socket 8 | 9 | func (c *Conn) recvMsg(m *Message, flags int) error { 10 | return errNotImplemented 11 | } 12 | 13 | func (c *Conn) sendMsg(m *Message, flags int) error { 14 | return errNotImplemented 15 | } 16 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd openbsd 6 | 7 | package socket 8 | 9 | func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 10 | return 0, errNotImplemented 11 | } 12 | 13 | func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 14 | return 0, errNotImplemented 15 | } 16 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_bsdvar.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build freebsd netbsd openbsd 6 | 7 | package socket 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | func probeProtocolStack() int { 15 | if (runtime.GOOS == "netbsd" || runtime.GOOS == "openbsd") && runtime.GOARCH == "arm" { 16 | return 8 17 | } 18 | var p uintptr 19 | return int(unsafe.Sizeof(p)) 20 | } 21 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | func probeProtocolStack() int { return 4 } 8 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | func probeProtocolStack() int { return 4 } 8 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·socketcall(SB),NOSPLIT,$0-36 8 | JMP syscall·socketcall(SB) 9 | 10 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 11 | JMP syscall·rawsocketcall(SB) 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x12b 9 | sysSENDMMSG = 0x133 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_linux_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x16d 9 | sysSENDMMSG = 0x176 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0xf3 9 | sysSENDMMSG = 0x10d 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_linux_mips.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x10ef 9 | sysSENDMMSG = 0x10f7 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_linux_mips64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x14ae 9 | sysSENDMMSG = 0x14b6 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_linux_mips64le.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x14ae 9 | sysSENDMMSG = 0x14b6 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_linux_mipsle.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x10ef 9 | sysSENDMMSG = 0x10f7 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x157 9 | sysSENDMMSG = 0x15d 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64le.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x157 9 | sysSENDMMSG = 0x15d 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·socketcall(SB),NOSPLIT,$0-72 8 | JMP syscall·socketcall(SB) 9 | 10 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-72 11 | JMP syscall·rawsocketcall(SB) 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/internal/socket/sys_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 8 | JMP syscall·sysvicall6(SB) 9 | 10 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 11 | JMP syscall·rawSysvicall6(SB) 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv4/control_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv4 8 | 9 | import "golang.org/x/net/internal/socket" 10 | 11 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 12 | return errNotImplemented 13 | } 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv4/control_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import "golang.org/x/net/internal/socket" 8 | 9 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 10 | // TODO(mikio): implement this 11 | return errNotImplemented 12 | } 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv4/icmp_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | func (f *icmpFilter) accept(typ ICMPType) { 8 | f.Data &^= 1 << (uint32(typ) & 31) 9 | } 10 | 11 | func (f *icmpFilter) block(typ ICMPType) { 12 | f.Data |= 1 << (uint32(typ) & 31) 13 | } 14 | 15 | func (f *icmpFilter) setAll(block bool) { 16 | if block { 17 | f.Data = 1<<32 - 1 18 | } else { 19 | f.Data = 0 20 | } 21 | } 22 | 23 | func (f *icmpFilter) willBlock(typ ICMPType) bool { 24 | return f.Data&(1<<(uint32(typ)&31)) != 0 25 | } 26 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv4/icmp_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux 6 | 7 | package ipv4 8 | 9 | const sizeofICMPFilter = 0x0 10 | 11 | type icmpFilter struct { 12 | } 13 | 14 | func (f *icmpFilter) accept(typ ICMPType) { 15 | } 16 | 17 | func (f *icmpFilter) block(typ ICMPType) { 18 | } 19 | 20 | func (f *icmpFilter) setAll(block bool) { 21 | } 22 | 23 | func (f *icmpFilter) willBlock(typ ICMPType) bool { 24 | return false 25 | } 26 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv4/payload.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import ( 8 | "net" 9 | 10 | "golang.org/x/net/internal/socket" 11 | ) 12 | 13 | // BUG(mikio): On Windows, the ControlMessage for ReadFrom and WriteTo 14 | // methods of PacketConn is not implemented. 15 | 16 | // A payloadHandler represents the IPv4 datagram payload handler. 17 | type payloadHandler struct { 18 | net.PacketConn 19 | *socket.Conn 20 | rawOpt 21 | } 22 | 23 | func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil && c.Conn != nil } 24 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!freebsd,!linux 6 | 7 | package ipv4 8 | 9 | import ( 10 | "net" 11 | 12 | "golang.org/x/net/internal/socket" 13 | ) 14 | 15 | func (so *sockOpt) getIPMreqn(c *socket.Conn) (*net.Interface, error) { 16 | return nil, errNotImplemented 17 | } 18 | 19 | func (so *sockOpt) setIPMreqn(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 20 | return errNotImplemented 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv4/sys_bpf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | 7 | package ipv4 8 | 9 | import ( 10 | "unsafe" 11 | 12 | "golang.org/x/net/bpf" 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { 17 | prog := sockFProg{ 18 | Len: uint16(len(f)), 19 | Filter: (*sockFilter)(unsafe.Pointer(&f[0])), 20 | } 21 | b := (*[sizeofSockFprog]byte)(unsafe.Pointer(&prog))[:sizeofSockFprog] 22 | return so.Set(c, b) 23 | } 24 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux 6 | 7 | package ipv4 8 | 9 | import ( 10 | "golang.org/x/net/bpf" 11 | "golang.org/x/net/internal/socket" 12 | ) 13 | 14 | func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { 15 | return errNotImplemented 16 | } 17 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!freebsd,!linux,!solaris 6 | 7 | package ipv4 8 | 9 | import ( 10 | "net" 11 | 12 | "golang.org/x/net/internal/socket" 13 | ) 14 | 15 | func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 16 | return errNotImplemented 17 | } 18 | 19 | func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error { 20 | return errNotImplemented 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv4/sys_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv4 8 | 9 | var ( 10 | ctlOpts = [ctlMax]ctlOpt{} 11 | 12 | sockOpts = map[int]*sockOpt{} 13 | ) 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv6/control_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv6 8 | 9 | import "golang.org/x/net/internal/socket" 10 | 11 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 12 | return errNotImplemented 13 | } 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv6/control_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import "golang.org/x/net/internal/socket" 8 | 9 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 10 | // TODO(mikio): implement this 11 | return errNotImplemented 12 | } 13 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv6/icmp_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv6 8 | 9 | type icmpv6Filter struct { 10 | } 11 | 12 | func (f *icmpv6Filter) accept(typ ICMPType) { 13 | } 14 | 15 | func (f *icmpv6Filter) block(typ ICMPType) { 16 | } 17 | 18 | func (f *icmpv6Filter) setAll(block bool) { 19 | } 20 | 21 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv6/icmp_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | func (f *icmpv6Filter) accept(typ ICMPType) { 8 | // TODO(mikio): implement this 9 | } 10 | 11 | func (f *icmpv6Filter) block(typ ICMPType) { 12 | // TODO(mikio): implement this 13 | } 14 | 15 | func (f *icmpv6Filter) setAll(block bool) { 16 | // TODO(mikio): implement this 17 | } 18 | 19 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 20 | // TODO(mikio): implement this 21 | return false 22 | } 23 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv6/payload.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import ( 8 | "net" 9 | 10 | "golang.org/x/net/internal/socket" 11 | ) 12 | 13 | // BUG(mikio): On Windows, the ControlMessage for ReadFrom and WriteTo 14 | // methods of PacketConn is not implemented. 15 | 16 | // A payloadHandler represents the IPv6 datagram payload handler. 17 | type payloadHandler struct { 18 | net.PacketConn 19 | *socket.Conn 20 | rawOpt 21 | } 22 | 23 | func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil && c.Conn != nil } 24 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv6/sys_asmreq.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows 6 | 7 | package ipv6 8 | 9 | import ( 10 | "net" 11 | "unsafe" 12 | 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func (so *sockOpt) setIPMreq(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 17 | var mreq ipv6Mreq 18 | copy(mreq.Multiaddr[:], grp) 19 | if ifi != nil { 20 | mreq.setIfindex(ifi.Index) 21 | } 22 | b := (*[sizeofIPv6Mreq]byte)(unsafe.Pointer(&mreq))[:sizeofIPv6Mreq] 23 | return so.Set(c, b) 24 | } 25 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv6 8 | 9 | import ( 10 | "net" 11 | 12 | "golang.org/x/net/internal/socket" 13 | ) 14 | 15 | func (so *sockOpt) setIPMreq(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 16 | return errNotImplemented 17 | } 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv6/sys_bpf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | 7 | package ipv6 8 | 9 | import ( 10 | "unsafe" 11 | 12 | "golang.org/x/net/bpf" 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { 17 | prog := sockFProg{ 18 | Len: uint16(len(f)), 19 | Filter: (*sockFilter)(unsafe.Pointer(&f[0])), 20 | } 21 | b := (*[sizeofSockFprog]byte)(unsafe.Pointer(&prog))[:sizeofSockFprog] 22 | return so.Set(c, b) 23 | } 24 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux 6 | 7 | package ipv6 8 | 9 | import ( 10 | "golang.org/x/net/bpf" 11 | "golang.org/x/net/internal/socket" 12 | ) 13 | 14 | func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { 15 | return errNotImplemented 16 | } 17 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!freebsd,!linux,!solaris 6 | 7 | package ipv6 8 | 9 | import ( 10 | "net" 11 | 12 | "golang.org/x/net/internal/socket" 13 | ) 14 | 15 | func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 16 | return errNotImplemented 17 | } 18 | 19 | func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error { 20 | return errNotImplemented 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/net/ipv6/sys_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv6 8 | 9 | var ( 10 | ctlOpts = [ctlMax]ctlOpt{} 11 | 12 | sockOpts = map[int]*sockOpt{} 13 | ) 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/dirent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo,!ppc64le,!ppc64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 11 | } 12 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | if !t.isRTL() { 11 | return true 12 | } 13 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 14 | } 15 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/gopkg.in/go-playground/validator.v8/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-master/vendor/gopkg.in/go-playground/validator.v8/logo.png -------------------------------------------------------------------------------- /filestore-server-master/vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /filestore-server-master/vendor/gopkg.in/yaml.v2/go.mod: -------------------------------------------------------------------------------- 1 | module "gopkg.in/yaml.v2" 2 | 3 | require ( 4 | "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 5 | ) 6 | -------------------------------------------------------------------------------- /filestore-server-pkg/README.md: -------------------------------------------------------------------------------- 1 | # distributed-fileserver 2 | 3 | 基于golang实现的一种分布式云存储服务 4 | 5 | 6 | ## 静态资源打包 7 | 8 | ```bash 9 | # 下载库 10 | go get -v github.com/jteeuwen/go-bindata/... 11 | go get -v github.com/moxiaomomo/go-bindata-assetfs/... 12 | 13 | # 将$GOPATH/bin关联到$PATH中, 可修改~/.bashrc文件(go-bindata-assetfs命令安装在$GOPATH/bin下) 14 | export PATH=$PATH:$GOPATH/bin 15 | 16 | # cd $GOPATH/<你的工程目录> 17 | cd $GOPATH/filestore-server 18 | 19 | # 将静态文件打包到一个目标文件里 20 | mkdir assets -p && go-bindata-assetfs -pkg assets -o ./assets/asset.go static/... 21 | 22 | # 修改静态文件的处理逻辑,详细可参考./service/upload/main.go 23 | ``` -------------------------------------------------------------------------------- /filestore-server-pkg/common/store.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // 存储类型(表示文件存到哪里) 4 | type StoreType int 5 | 6 | const ( 7 | _ StoreType = iota 8 | // StoreLocal : 节点本地 9 | StoreLocal 10 | // StoreCeph : Ceph集群 11 | StoreCeph 12 | // StoreOSS : 阿里OSS 13 | StoreOSS 14 | // StoreMix : 混合(Ceph及OSS) 15 | StoreMix 16 | // StoreAll : 所有类型的存储都存一份数据 17 | StoreAll 18 | ) -------------------------------------------------------------------------------- /filestore-server-pkg/config/ceph.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // CephAccessKey : 访问Key 5 | CephAccessKey = "8WOOFAOAZ3SKQK3Y5I2L" 6 | // CephSecretKey : 访问密钥 7 | CephSecretKey = "syYWcEmF0Dx7BXrpyDvuAZ3yRe4EmNC9oDrucx3M" 8 | // CephGWEndpoint : gateway地址 9 | CephGWEndpoint = "http://127.0.0.1:9080" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-pkg/config/db.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // MySQLSource : 要连接的数据库源; 5 | // 其中test:test 是用户名密码; 6 | // 127.0.0.1:3306 是ip及端口; 7 | // fileserver 是数据库名; 8 | // charset=utf8 指定了数据以utf8字符编码进行传输 9 | MySQLSource = "test:test@tcp(127.0.0.1:3306)/fileserver?charset=utf8" 10 | ) -------------------------------------------------------------------------------- /filestore-server-pkg/config/oss.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // OSSBucket : oss bucket名 5 | OSSBucket = "buckettest-filestore2" 6 | // OSSEndpoint : oss endpoint 7 | OSSEndpoint = "oss-cn-shenzhen.aliyuncs.com" 8 | // OSSAccesskeyID : oss访问key 9 | OSSAccesskeyID = "<你的AccesskeyId>" 10 | // OSSAccessKeySecret : oss访问key secret 11 | OSSAccessKeySecret = "<你的AccessKeySecret>" 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-pkg/config/rabbitmq.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // AsyncTransferEnable : 是否开启文件异步转移(默认同步) 5 | AsyncTransferEnable = false 6 | // RabbitURL : rabbitmq服务的入口url 7 | RabbitURL = "amqp://guest:guest@127.0.0.1:5672/" 8 | // TransExchangeName : 用于文件transfer的交换机 9 | TransExchangeName = "uploadserver.trans" 10 | // TransOSSQueueName : oss转移队列名 11 | TransOSSQueueName = "uploadserver.trans.oss" 12 | // TransOSSErrQueueName : oss转移失败后写入另一个队列的队列名 13 | TransOSSErrQueueName = "uploadserver.trans.oss.err" 14 | // TransOSSRoutingKey : routingkey 15 | TransOSSRoutingKey = "oss" 16 | ) 17 | -------------------------------------------------------------------------------- /filestore-server-pkg/config/service.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // UploadServiceHost : 上传服务监听的地址 5 | UploadServiceHost = "0.0.0.0:8080" 6 | ) -------------------------------------------------------------------------------- /filestore-server-pkg/config/store.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | const ( 8 | // CurrentStoreType : 设置当前文件的存储类型 9 | CurrentStoreType = cmn.StoreLocal 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-pkg/doc/ci-cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-pkg/doc/ci-cd.png -------------------------------------------------------------------------------- /filestore-server-pkg/doc/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-pkg/doc/structure.png -------------------------------------------------------------------------------- /filestore-server-pkg/handler/auth.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | // HTTPInterceptor : http请求拦截器 8 | func HTTPInterceptor(h http.HandlerFunc) http.HandlerFunc { 9 | return http.HandlerFunc( 10 | func(w http.ResponseWriter, r *http.Request) { 11 | r.ParseForm() 12 | username := r.Form.Get("username") 13 | token := r.Form.Get("token") 14 | 15 | //验证登录token是否有效 16 | if len(username) < 3 || !IsTokenValid(token) { 17 | // w.WriteHeader(http.StatusForbidden) 18 | // token校验失败则跳转到登录页面 19 | http.Redirect(w, r, "/static/view/signin.html", http.StatusFound) 20 | return 21 | } 22 | h(w, r) 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /filestore-server-pkg/meta/sort.go: -------------------------------------------------------------------------------- 1 | package meta 2 | 3 | import "time" 4 | 5 | const baseFormat = "2006-01-02 15:04:05" 6 | 7 | type ByUploadTime []FileMeta 8 | 9 | func (a ByUploadTime) Len() int { 10 | return len(a) 11 | } 12 | 13 | func (a ByUploadTime) Swap(i, j int) { 14 | a[i], a[j] = a[j], a[i] 15 | } 16 | 17 | func (a ByUploadTime) Less(i, j int) bool { 18 | iTime, _ := time.Parse(baseFormat, a[i].UploadAt) 19 | jTime, _ := time.Parse(baseFormat, a[j].UploadAt) 20 | return iTime.UnixNano() > jTime.UnixNano() 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-pkg/mq/define.go: -------------------------------------------------------------------------------- 1 | package mq 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | // TransferData : 将要写到rabbitmq的数据的结构体 8 | type TransferData struct { 9 | FileHash string 10 | CurLocation string 11 | DestLocation string 12 | DestStoreType cmn.StoreType 13 | } 14 | -------------------------------------------------------------------------------- /filestore-server-pkg/static/img/avatar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-pkg/static/img/avatar.jpeg -------------------------------------------------------------------------------- /filestore-server-pkg/static/js/auth.js: -------------------------------------------------------------------------------- 1 | function queryParams() { 2 | var username = localStorage.getItem("username"); 3 | var token = localStorage.getItem("token"); 4 | return 'username=' + username + '&token=' + token; 5 | } -------------------------------------------------------------------------------- /filestore-server-v0.2/common/store.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // 存储类型(表示文件存到哪里) 4 | type StoreType int 5 | 6 | const ( 7 | _ StoreType = iota 8 | // StoreLocal : 节点本地 9 | StoreLocal 10 | // StoreCeph : Ceph集群 11 | StoreCeph 12 | // StoreOSS : 阿里OSS 13 | StoreOSS 14 | // StoreMix : 混合(Ceph及OSS) 15 | StoreMix 16 | // StoreAll : 所有类型的存储都存一份数据 17 | StoreAll 18 | ) -------------------------------------------------------------------------------- /filestore-server-v0.2/config/ceph.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // CephAccessKey : 访问Key 5 | CephAccessKey = "8WOOFAOAZ3SKQK3Y5I2L" 6 | // CephSecretKey : 访问密钥 7 | CephSecretKey = "syYWcEmF0Dx7BXrpyDvuAZ3yRe4EmNC9oDrucx3M" 8 | // CephGWEndpoint : gateway地址 9 | CephGWEndpoint = "http://127.0.0.1:9080" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-v0.2/config/db.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // MySQLSource : 要连接的数据库源; 5 | // 其中test:test 是用户名密码; 6 | // 127.0.0.1:3306 是ip及端口; 7 | // fileserver 是数据库名; 8 | // charset=utf8 指定了数据以utf8字符编码进行传输 9 | MySQLSource = "test:test@tcp(127.0.0.1:3306)/fileserver?charset=utf8" 10 | ) -------------------------------------------------------------------------------- /filestore-server-v0.2/config/oss.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // OSSBucket : oss bucket名 5 | OSSBucket = "buckettest-filestore2" 6 | // OSSEndpoint : oss endpoint 7 | OSSEndpoint = "oss-cn-shenzhen.aliyuncs.com" 8 | // OSSAccesskeyID : oss访问key 9 | OSSAccesskeyID = "<你的AccesskeyId>" 10 | // OSSAccessKeySecret : oss访问key secret 11 | OSSAccessKeySecret = "<你的AccessKeySecret>" 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-v0.2/config/service.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // UploadServiceHost : 上传服务监听的地址 5 | UploadServiceHost = "0.0.0.0:8080" 6 | ) -------------------------------------------------------------------------------- /filestore-server-v0.2/config/store.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | const ( 8 | // 设置当前文件的存储类型 9 | CurrentStoreType = cmn.StoreLocal 10 | ) -------------------------------------------------------------------------------- /filestore-server-v0.2/doc/ci-cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-v0.2/doc/ci-cd.png -------------------------------------------------------------------------------- /filestore-server-v0.2/doc/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-v0.2/doc/structure.png -------------------------------------------------------------------------------- /filestore-server-v0.2/handler/auth.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | // HTTPInterceptor : http请求拦截器 8 | func HTTPInterceptor(h http.HandlerFunc) http.HandlerFunc { 9 | return http.HandlerFunc( 10 | func(w http.ResponseWriter, r *http.Request) { 11 | r.ParseForm() 12 | username := r.Form.Get("username") 13 | token := r.Form.Get("token") 14 | 15 | //验证登录token是否有效 16 | if len(username) < 3 || !IsTokenValid(token) { 17 | // w.WriteHeader(http.StatusForbidden) 18 | // token校验失败则跳转到登录页面 19 | http.Redirect(w, r, "/static/view/signin.html", http.StatusFound) 20 | return 21 | } 22 | h(w, r) 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /filestore-server-v0.2/meta/sort.go: -------------------------------------------------------------------------------- 1 | package meta 2 | 3 | import "time" 4 | 5 | const baseFormat = "2006-01-02 15:04:05" 6 | 7 | type ByUploadTime []FileMeta 8 | 9 | func (a ByUploadTime) Len() int { 10 | return len(a) 11 | } 12 | 13 | func (a ByUploadTime) Swap(i, j int) { 14 | a[i], a[j] = a[j], a[i] 15 | } 16 | 17 | func (a ByUploadTime) Less(i, j int) bool { 18 | iTime, _ := time.Parse(baseFormat, a[i].UploadAt) 19 | jTime, _ := time.Parse(baseFormat, a[j].UploadAt) 20 | return iTime.UnixNano() > jTime.UnixNano() 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-v0.2/static/img/avatar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-v0.2/static/img/avatar.jpeg -------------------------------------------------------------------------------- /filestore-server-v0.2/static/js/auth.js: -------------------------------------------------------------------------------- 1 | function queryParams() { 2 | var username = localStorage.getItem("username"); 3 | var token = localStorage.getItem("token"); 4 | return 'username=' + username + '&token=' + token; 5 | } -------------------------------------------------------------------------------- /filestore-server-v0.3/common/store.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | // 存储类型(表示文件存到哪里) 4 | type StoreType int 5 | 6 | const ( 7 | _ StoreType = iota 8 | // StoreLocal : 节点本地 9 | StoreLocal 10 | // StoreCeph : Ceph集群 11 | StoreCeph 12 | // StoreOSS : 阿里OSS 13 | StoreOSS 14 | // StoreMix : 混合(Ceph及OSS) 15 | StoreMix 16 | // StoreAll : 所有类型的存储都存一份数据 17 | StoreAll 18 | ) -------------------------------------------------------------------------------- /filestore-server-v0.3/config/ceph.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // CephAccessKey : 访问Key 5 | CephAccessKey = "8WOOFAOAZ3SKQK3Y5I2L" 6 | // CephSecretKey : 访问密钥 7 | CephSecretKey = "syYWcEmF0Dx7BXrpyDvuAZ3yRe4EmNC9oDrucx3M" 8 | // CephGWEndpoint : gateway地址 9 | CephGWEndpoint = "http://127.0.0.1:9080" 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-v0.3/config/db.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // MySQLSource : 要连接的数据库源; 5 | // 其中test:test 是用户名密码; 6 | // 127.0.0.1:3306 是ip及端口; 7 | // fileserver 是数据库名; 8 | // charset=utf8 指定了数据以utf8字符编码进行传输 9 | MySQLSource = "test:test@tcp(127.0.0.1:3306)/fileserver?charset=utf8" 10 | ) -------------------------------------------------------------------------------- /filestore-server-v0.3/config/oss.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // OSSBucket : oss bucket名 5 | OSSBucket = "buckettest-filestore2" 6 | // OSSEndpoint : oss endpoint 7 | OSSEndpoint = "oss-cn-shenzhen.aliyuncs.com" 8 | // OSSAccesskeyID : oss访问key 9 | OSSAccesskeyID = "<你的AccesskeyId>" 10 | // OSSAccessKeySecret : oss访问key secret 11 | OSSAccessKeySecret = "<你的AccessKeySecret>" 12 | ) 13 | -------------------------------------------------------------------------------- /filestore-server-v0.3/config/rabbitmq.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // AsyncTransferEnable : 是否开启文件异步转移(默认同步) 5 | AsyncTransferEnable = false 6 | // RabbitURL : rabbitmq服务的入口url 7 | RabbitURL = "amqp://guest:guest@127.0.0.1:5672/" 8 | // TransExchangeName : 用于文件transfer的交换机 9 | TransExchangeName = "uploadserver.trans" 10 | // TransOSSQueueName : oss转移队列名 11 | TransOSSQueueName = "uploadserver.trans.oss" 12 | // TransOSSErrQueueName : oss转移失败后写入另一个队列的队列名 13 | TransOSSErrQueueName = "uploadserver.trans.oss.err" 14 | // TransOSSRoutingKey : routingkey 15 | TransOSSRoutingKey = "oss" 16 | ) 17 | -------------------------------------------------------------------------------- /filestore-server-v0.3/config/service.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | const ( 4 | // UploadServiceHost : 上传服务监听的地址 5 | UploadServiceHost = "0.0.0.0:8080" 6 | ) -------------------------------------------------------------------------------- /filestore-server-v0.3/config/store.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | const ( 8 | // CurrentStoreType : 设置当前文件的存储类型 9 | CurrentStoreType = cmn.StoreLocal 10 | ) 11 | -------------------------------------------------------------------------------- /filestore-server-v0.3/doc/ci-cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-v0.3/doc/ci-cd.png -------------------------------------------------------------------------------- /filestore-server-v0.3/doc/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-v0.3/doc/structure.png -------------------------------------------------------------------------------- /filestore-server-v0.3/handler/auth.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | // HTTPInterceptor : http请求拦截器 8 | func HTTPInterceptor(h http.HandlerFunc) http.HandlerFunc { 9 | return http.HandlerFunc( 10 | func(w http.ResponseWriter, r *http.Request) { 11 | r.ParseForm() 12 | username := r.Form.Get("username") 13 | token := r.Form.Get("token") 14 | 15 | //验证登录token是否有效 16 | if len(username) < 3 || !IsTokenValid(token) { 17 | // w.WriteHeader(http.StatusForbidden) 18 | // token校验失败则跳转到登录页面 19 | http.Redirect(w, r, "/static/view/signin.html", http.StatusFound) 20 | return 21 | } 22 | h(w, r) 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /filestore-server-v0.3/meta/sort.go: -------------------------------------------------------------------------------- 1 | package meta 2 | 3 | import "time" 4 | 5 | const baseFormat = "2006-01-02 15:04:05" 6 | 7 | type ByUploadTime []FileMeta 8 | 9 | func (a ByUploadTime) Len() int { 10 | return len(a) 11 | } 12 | 13 | func (a ByUploadTime) Swap(i, j int) { 14 | a[i], a[j] = a[j], a[i] 15 | } 16 | 17 | func (a ByUploadTime) Less(i, j int) bool { 18 | iTime, _ := time.Parse(baseFormat, a[i].UploadAt) 19 | jTime, _ := time.Parse(baseFormat, a[j].UploadAt) 20 | return iTime.UnixNano() > jTime.UnixNano() 21 | } 22 | -------------------------------------------------------------------------------- /filestore-server-v0.3/mq/define.go: -------------------------------------------------------------------------------- 1 | package mq 2 | 3 | import ( 4 | cmn "filestore-server/common" 5 | ) 6 | 7 | // TransferData : 将要写到rabbitmq的数据的结构体 8 | type TransferData struct { 9 | FileHash string 10 | CurLocation string 11 | DestLocation string 12 | DestStoreType cmn.StoreType 13 | } 14 | -------------------------------------------------------------------------------- /filestore-server-v0.3/static/img/avatar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samtake/filestore-server/59a52a289753239312cb45709ca52a2bb3b62890/filestore-server-v0.3/static/img/avatar.jpeg -------------------------------------------------------------------------------- /filestore-server-v0.3/static/js/auth.js: -------------------------------------------------------------------------------- 1 | function queryParams() { 2 | var username = localStorage.getItem("username"); 3 | var token = localStorage.getItem("token"); 4 | return 'username=' + username + '&token=' + token; 5 | } --------------------------------------------------------------------------------