empty.go 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package project
  2. import (
  3. "golang.org/x/net/context"
  4. "github.com/docker/libcompose/project/options"
  5. )
  6. // EmptyService is a struct that implements Service but does nothing.
  7. type EmptyService struct {
  8. }
  9. // Create implements Service.Create but does nothing.
  10. func (e *EmptyService) Create(ctx context.Context, options options.Create) error {
  11. return nil
  12. }
  13. // Build implements Service.Build but does nothing.
  14. func (e *EmptyService) Build(ctx context.Context, buildOptions options.Build) error {
  15. return nil
  16. }
  17. // Up implements Service.Up but does nothing.
  18. func (e *EmptyService) Up(ctx context.Context, options options.Up) error {
  19. return nil
  20. }
  21. // Start implements Service.Start but does nothing.
  22. func (e *EmptyService) Start(ctx context.Context) error {
  23. return nil
  24. }
  25. // Stop implements Service.Stop() but does nothing.
  26. func (e *EmptyService) Stop(ctx context.Context, timeout int) error {
  27. return nil
  28. }
  29. // Delete implements Service.Delete but does nothing.
  30. func (e *EmptyService) Delete(ctx context.Context, options options.Delete) error {
  31. return nil
  32. }
  33. // Restart implements Service.Restart but does nothing.
  34. func (e *EmptyService) Restart(ctx context.Context, timeout int) error {
  35. return nil
  36. }
  37. // Log implements Service.Log but does nothing.
  38. func (e *EmptyService) Log(ctx context.Context, follow bool) error {
  39. return nil
  40. }
  41. // Pull implements Service.Pull but does nothing.
  42. func (e *EmptyService) Pull(ctx context.Context) error {
  43. return nil
  44. }
  45. // Kill implements Service.Kill but does nothing.
  46. func (e *EmptyService) Kill(ctx context.Context, signal string) error {
  47. return nil
  48. }
  49. // Containers implements Service.Containers but does nothing.
  50. func (e *EmptyService) Containers(ctx context.Context) ([]Container, error) {
  51. return []Container{}, nil
  52. }
  53. // Scale implements Service.Scale but does nothing.
  54. func (e *EmptyService) Scale(ctx context.Context, count int, timeout int) error {
  55. return nil
  56. }
  57. // Info implements Service.Info but does nothing.
  58. func (e *EmptyService) Info(ctx context.Context, qFlag bool) (InfoSet, error) {
  59. return InfoSet{}, nil
  60. }
  61. // Pause implements Service.Pause but does nothing.
  62. func (e *EmptyService) Pause(ctx context.Context) error {
  63. return nil
  64. }
  65. // Unpause implements Service.Pause but does nothing.
  66. func (e *EmptyService) Unpause(ctx context.Context) error {
  67. return nil
  68. }
  69. // Run implements Service.Run but does nothing.
  70. func (e *EmptyService) Run(ctx context.Context, commandParts []string) (int, error) {
  71. return 0, nil
  72. }
  73. // RemoveImage implements Service.RemoveImage but does nothing.
  74. func (e *EmptyService) RemoveImage(ctx context.Context, imageType options.ImageType) error {
  75. return nil
  76. }