noimpl.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. Copyright 2020 Docker Compose CLI authors
  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. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package compose
  14. import (
  15. "context"
  16. "github.com/compose-spec/compose-go/types"
  17. "github.com/docker/compose-cli/api/errdefs"
  18. )
  19. // NoImpl implements Service to return ErrNotImplemented
  20. type NoImpl struct{}
  21. //Build implements Service interface
  22. func (s NoImpl) Build(ctx context.Context, project *types.Project, options BuildOptions) error {
  23. return errdefs.ErrNotImplemented
  24. }
  25. //Push implements Service interface
  26. func (s NoImpl) Push(ctx context.Context, project *types.Project, options PushOptions) error {
  27. return errdefs.ErrNotImplemented
  28. }
  29. //Pull implements Service interface
  30. func (s NoImpl) Pull(ctx context.Context, project *types.Project, options PullOptions) error {
  31. return errdefs.ErrNotImplemented
  32. }
  33. //Create implements Service interface
  34. func (s NoImpl) Create(ctx context.Context, project *types.Project, options CreateOptions) error {
  35. return errdefs.ErrNotImplemented
  36. }
  37. //Start implements Service interface
  38. func (s NoImpl) Start(ctx context.Context, project *types.Project, options StartOptions) error {
  39. return errdefs.ErrNotImplemented
  40. }
  41. //Restart implements Service interface
  42. func (s NoImpl) Restart(ctx context.Context, project *types.Project, options RestartOptions) error {
  43. return errdefs.ErrNotImplemented
  44. }
  45. //Stop implements Service interface
  46. func (s NoImpl) Stop(ctx context.Context, project *types.Project, options StopOptions) error {
  47. return errdefs.ErrNotImplemented
  48. }
  49. //Up implements Service interface
  50. func (s NoImpl) Up(ctx context.Context, project *types.Project, options UpOptions) error {
  51. return errdefs.ErrNotImplemented
  52. }
  53. //Down implements Service interface
  54. func (s NoImpl) Down(ctx context.Context, project string, options DownOptions) error {
  55. return errdefs.ErrNotImplemented
  56. }
  57. //Logs implements Service interface
  58. func (s NoImpl) Logs(ctx context.Context, project string, consumer LogConsumer, options LogOptions) error {
  59. return errdefs.ErrNotImplemented
  60. }
  61. //Ps implements Service interface
  62. func (s NoImpl) Ps(ctx context.Context, project string, options PsOptions) ([]ContainerSummary, error) {
  63. return nil, errdefs.ErrNotImplemented
  64. }
  65. //List implements Service interface
  66. func (s NoImpl) List(ctx context.Context, options ListOptions) ([]Stack, error) {
  67. return nil, errdefs.ErrNotImplemented
  68. }
  69. //Convert implements Service interface
  70. func (s NoImpl) Convert(ctx context.Context, project *types.Project, options ConvertOptions) ([]byte, error) {
  71. return nil, errdefs.ErrNotImplemented
  72. }
  73. //Kill implements Service interface
  74. func (s NoImpl) Kill(ctx context.Context, project *types.Project, options KillOptions) error {
  75. return errdefs.ErrNotImplemented
  76. }
  77. //RunOneOffContainer implements Service interface
  78. func (s NoImpl) RunOneOffContainer(ctx context.Context, project *types.Project, options RunOptions) (int, error) {
  79. return 0, errdefs.ErrNotImplemented
  80. }
  81. //Remove implements Service interface
  82. func (s NoImpl) Remove(ctx context.Context, project *types.Project, options RemoveOptions) ([]string, error) {
  83. return nil, errdefs.ErrNotImplemented
  84. }
  85. //Exec implements Service interface
  86. func (s NoImpl) Exec(ctx context.Context, project *types.Project, opts RunOptions) (int, error) {
  87. return 0, errdefs.ErrNotImplemented
  88. }
  89. //Pause implements Service interface
  90. func (s NoImpl) Pause(ctx context.Context, project string, options PauseOptions) error {
  91. return errdefs.ErrNotImplemented
  92. }
  93. //UnPause implements Service interface
  94. func (s NoImpl) UnPause(ctx context.Context, project string, options PauseOptions) error {
  95. return errdefs.ErrNotImplemented
  96. }
  97. //Top implements Service interface
  98. func (s NoImpl) Top(ctx context.Context, project string, services []string) ([]ContainerProcSummary, error) {
  99. return nil, errdefs.ErrNotImplemented
  100. }
  101. //Events implements Service interface
  102. func (s NoImpl) Events(ctx context.Context, project string, options EventsOptions) error {
  103. return errdefs.ErrNotImplemented
  104. }
  105. //Port implements Service interface
  106. func (s NoImpl) Port(ctx context.Context, project string, service string, port int, options PortOptions) (string, int, error) {
  107. return "", 0, errdefs.ErrNotImplemented
  108. }
  109. //Images implements Service interface
  110. func (s NoImpl) Images(ctx context.Context, project string, options ImagesOptions) ([]ImageSummary, error) {
  111. return nil, errdefs.ErrNotImplemented
  112. }