backend.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // +build kube
  2. /*
  3. Copyright 2020 Docker Compose CLI authors
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. */
  14. package kube
  15. import (
  16. "github.com/docker/compose-cli/api/backend"
  17. "github.com/docker/compose-cli/api/cloud"
  18. "github.com/docker/compose-cli/api/compose"
  19. "github.com/docker/compose-cli/api/containers"
  20. "github.com/docker/compose-cli/api/context/store"
  21. "github.com/docker/compose-cli/api/resources"
  22. "github.com/docker/compose-cli/api/secrets"
  23. "github.com/docker/compose-cli/api/volumes"
  24. )
  25. const backendType = store.KubeContextType
  26. type kubeAPIService struct {
  27. composeService compose.Service
  28. }
  29. func init() {
  30. backend.Register(backendType, backendType, service, cloud.NotImplementedCloudService)
  31. }
  32. func service() (backend.Service, error) {
  33. s, err := NewComposeService()
  34. if err != nil {
  35. return nil, err
  36. }
  37. return &kubeAPIService{
  38. composeService: s,
  39. }, nil
  40. }
  41. func (s *kubeAPIService) ContainerService() containers.Service {
  42. return nil
  43. }
  44. func (s *kubeAPIService) ComposeService() compose.Service {
  45. return s.composeService
  46. }
  47. func (s *kubeAPIService) SecretsService() secrets.Service {
  48. return nil
  49. }
  50. func (s *kubeAPIService) VolumeService() volumes.Service {
  51. return nil
  52. }
  53. func (s *kubeAPIService) ResourceService() resources.Service {
  54. return nil
  55. }