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.

imagelistlogic.go 859 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package image
  2. import (
  3. "context"
  4. "github.com/zeromicro/go-zero/core/logx"
  5. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
  6. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
  7. )
  8. type ImageListLogic struct {
  9. logx.Logger
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. }
  13. type ImageTags struct {
  14. Name string `json:"name"`
  15. Tags []string `json:"tags" copier:"tags"`
  16. }
  17. func NewImageListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ImageListLogic {
  18. return &ImageListLogic{
  19. Logger: logx.WithContext(ctx),
  20. ctx: ctx,
  21. svcCtx: svcCtx,
  22. }
  23. }
  24. func (l *ImageListLogic) ImageList() (resp *types.ImageListResp, err error) {
  25. var images []string
  26. l.svcCtx.DbEngin.Raw("select distinct name from file where kind = 'image'").Scan(&images)
  27. result := types.ImageListResp{
  28. Repositories: images,
  29. }
  30. return &result, nil
  31. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.