You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

serve.go 518 B

2 years ago
123456789101112131415161718192021222324252627282930
  1. package cmdline
  2. import (
  3. "fmt"
  4. "gitlink.org.cn/cloudream/storage/client/internal/http"
  5. )
  6. func ServeHTTP(ctx CommandContext, args []string) error {
  7. listenAddr := ":7890"
  8. if len(args) > 0 {
  9. listenAddr = args[0]
  10. }
  11. httpSvr, err := http.NewServer(listenAddr, ctx.Cmdline.Svc)
  12. if err != nil {
  13. return fmt.Errorf("new http server: %w", err)
  14. }
  15. err = httpSvr.Serve()
  16. if err != nil {
  17. return fmt.Errorf("serving http: %w", err)
  18. }
  19. return nil
  20. }
  21. func init() {
  22. commands.MustAdd(ServeHTTP, "serve", "http")
  23. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。