Skip to content

Commit

Permalink
revert: "feat: add distribution API (#92)"
Browse files Browse the repository at this point in the history
This reverts commit 0e413d7.

Signed-off-by: Swagat Bora <[email protected]>
  • Loading branch information
swagatbora90 committed Nov 27, 2024
1 parent 9905569 commit 0a306d7
Show file tree
Hide file tree
Showing 15 changed files with 109 additions and 1,161 deletions.
77 changes: 0 additions & 77 deletions api/handlers/distribution/distribution.go

This file was deleted.

122 changes: 0 additions & 122 deletions api/handlers/distribution/distribution_test.go

This file was deleted.

19 changes: 8 additions & 11 deletions api/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (

"github.com/runfinch/finch-daemon/api/handlers/builder"
"github.com/runfinch/finch-daemon/api/handlers/container"
"github.com/runfinch/finch-daemon/api/handlers/distribution"
"github.com/runfinch/finch-daemon/api/handlers/exec"
"github.com/runfinch/finch-daemon/api/handlers/image"
"github.com/runfinch/finch-daemon/api/handlers/network"
Expand All @@ -32,15 +31,14 @@ import (

// Options defines the router options to be passed into the handlers.
type Options struct {
Config *config.Config
ContainerService container.Service
ImageService image.Service
NetworkService network.Service
SystemService system.Service
BuilderService builder.Service
VolumeService volume.Service
ExecService exec.Service
DistributionService distribution.Service
Config *config.Config
ContainerService container.Service
ImageService image.Service
NetworkService network.Service
SystemService system.Service
BuilderService builder.Service
VolumeService volume.Service
ExecService exec.Service

// NerdctlWrapper wraps the interactions with nerdctl to build
NerdctlWrapper *backend.NerdctlWrapper
Expand All @@ -61,7 +59,6 @@ func New(opts *Options) http.Handler {
builder.RegisterHandlers(vr, opts.BuilderService, opts.Config, logger, opts.NerdctlWrapper)
volume.RegisterHandlers(vr, opts.VolumeService, opts.Config, logger)
exec.RegisterHandlers(vr, opts.ExecService, opts.Config, logger)
distribution.RegisterHandlers(vr, opts.DistributionService, opts.Config, logger)
return ghandlers.LoggingHandler(os.Stderr, r)
}

Expand Down
20 changes: 9 additions & 11 deletions cmd/finch-daemon/router_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/runfinch/finch-daemon/internal/backend"
"github.com/runfinch/finch-daemon/internal/service/builder"
"github.com/runfinch/finch-daemon/internal/service/container"
"github.com/runfinch/finch-daemon/internal/service/distribution"
"github.com/runfinch/finch-daemon/internal/service/exec"
"github.com/runfinch/finch-daemon/internal/service/image"
"github.com/runfinch/finch-daemon/internal/service/network"
Expand Down Expand Up @@ -102,15 +101,14 @@ func createRouterOptions(
tarExtractor := archive.NewTarExtractor(ecc.NewExecCmdCreator(), logger)

return &router.Options{
Config: conf,
ContainerService: container.NewService(clientWrapper, ncWrapper, logger, fs, tarCreator, tarExtractor),
ImageService: image.NewService(clientWrapper, ncWrapper, logger),
NetworkService: network.NewService(clientWrapper, ncWrapper, logger),
SystemService: system.NewService(clientWrapper, ncWrapper, logger),
BuilderService: builder.NewService(clientWrapper, ncWrapper, logger, tarExtractor),
VolumeService: volume.NewService(ncWrapper, logger),
ExecService: exec.NewService(clientWrapper, logger),
DistributionService: distribution.NewService(clientWrapper, ncWrapper, logger),
NerdctlWrapper: ncWrapper,
Config: conf,
ContainerService: container.NewService(clientWrapper, ncWrapper, logger, fs, tarCreator, tarExtractor),
ImageService: image.NewService(clientWrapper, ncWrapper, logger),
NetworkService: network.NewService(clientWrapper, ncWrapper, logger),
SystemService: system.NewService(clientWrapper, ncWrapper, logger),
BuilderService: builder.NewService(clientWrapper, ncWrapper, logger, tarExtractor),
VolumeService: volume.NewService(ncWrapper, logger),
ExecService: exec.NewService(clientWrapper, logger),
NerdctlWrapper: ncWrapper,
}
}
Loading

0 comments on commit 0a306d7

Please sign in to comment.