cmd_install.go 759 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
  2. //
  3. // This Source Code Form is subject to the terms of the MIT License.
  4. // If a copy of the MIT was not distributed with this file,
  5. // You can obtain one at https://github.com/gogf/gf.
  6. package cmd
  7. import (
  8. "context"
  9. "github.com/gogf/gf/v2/frame/g"
  10. "github.com/gogf/gf/cmd/gf/v2/internal/service"
  11. )
  12. var (
  13. Install = cInstall{}
  14. )
  15. type cInstall struct {
  16. g.Meta `name:"install" brief:"install gf binary to system (might need root/admin permission)"`
  17. }
  18. type cInstallInput struct {
  19. g.Meta `name:"install"`
  20. }
  21. type cInstallOutput struct{}
  22. func (c cInstall) Index(ctx context.Context, in cInstallInput) (out *cInstallOutput, err error) {
  23. err = service.Install.Run(ctx)
  24. return
  25. }