From 7361ec739fd71ad3d9d568f4ec4ac2bc247a9f52 Mon Sep 17 00:00:00 2001 From: David Allen Date: Wed, 10 Jul 2024 12:11:28 -0600 Subject: [PATCH] Moved internal/ to pkg/ to make building external plugins possible --- internal/generator/plugins/hostfile/hostfile_test.go | 1 - internal/schema.go | 2 -- {internal => pkg}/auth.go | 0 {internal => pkg}/client.go | 0 {internal => pkg}/config.go | 0 {internal => pkg}/configurator.go | 0 {internal => pkg}/generator/generator.go | 0 {internal => pkg}/generator/plugins/conman/conman.go | 0 {internal => pkg}/generator/plugins/coredhcp/coredhcp.go | 0 {internal => pkg}/generator/plugins/dhcpd/dhcpd.go | 0 {internal => pkg}/generator/plugins/dnsmasq/dnsmasq.go | 0 {internal => pkg}/generator/plugins/example/example.go | 0 {internal => pkg}/generator/plugins/hostfile/hostfile.go | 0 {internal => pkg}/generator/plugins/powerman/powerman.go | 0 {internal => pkg}/generator/plugins/syslog/syslog.go | 0 {internal => pkg}/generator/plugins/warewulf/warewulf.go | 0 {internal => pkg}/server/server.go | 4 ++++ {internal => pkg}/util/params.go | 0 {internal => pkg}/util/util.go | 0 19 files changed, 4 insertions(+), 3 deletions(-) delete mode 100644 internal/generator/plugins/hostfile/hostfile_test.go delete mode 100644 internal/schema.go rename {internal => pkg}/auth.go (100%) rename {internal => pkg}/client.go (100%) rename {internal => pkg}/config.go (100%) rename {internal => pkg}/configurator.go (100%) rename {internal => pkg}/generator/generator.go (100%) rename {internal => pkg}/generator/plugins/conman/conman.go (100%) rename {internal => pkg}/generator/plugins/coredhcp/coredhcp.go (100%) rename {internal => pkg}/generator/plugins/dhcpd/dhcpd.go (100%) rename {internal => pkg}/generator/plugins/dnsmasq/dnsmasq.go (100%) rename {internal => pkg}/generator/plugins/example/example.go (100%) rename {internal => pkg}/generator/plugins/hostfile/hostfile.go (100%) rename {internal => pkg}/generator/plugins/powerman/powerman.go (100%) rename {internal => pkg}/generator/plugins/syslog/syslog.go (100%) rename {internal => pkg}/generator/plugins/warewulf/warewulf.go (100%) rename {internal => pkg}/server/server.go (99%) rename {internal => pkg}/util/params.go (100%) rename {internal => pkg}/util/util.go (100%) diff --git a/internal/generator/plugins/hostfile/hostfile_test.go b/internal/generator/plugins/hostfile/hostfile_test.go deleted file mode 100644 index 06ab7d0..0000000 --- a/internal/generator/plugins/hostfile/hostfile_test.go +++ /dev/null @@ -1 +0,0 @@ -package main diff --git a/internal/schema.go b/internal/schema.go deleted file mode 100644 index dc794a1..0000000 --- a/internal/schema.go +++ /dev/null @@ -1,2 +0,0 @@ -// TODO: implement a way to fetch schemas from node orchestrator -package configurator diff --git a/internal/auth.go b/pkg/auth.go similarity index 100% rename from internal/auth.go rename to pkg/auth.go diff --git a/internal/client.go b/pkg/client.go similarity index 100% rename from internal/client.go rename to pkg/client.go diff --git a/internal/config.go b/pkg/config.go similarity index 100% rename from internal/config.go rename to pkg/config.go diff --git a/internal/configurator.go b/pkg/configurator.go similarity index 100% rename from internal/configurator.go rename to pkg/configurator.go diff --git a/internal/generator/generator.go b/pkg/generator/generator.go similarity index 100% rename from internal/generator/generator.go rename to pkg/generator/generator.go diff --git a/internal/generator/plugins/conman/conman.go b/pkg/generator/plugins/conman/conman.go similarity index 100% rename from internal/generator/plugins/conman/conman.go rename to pkg/generator/plugins/conman/conman.go diff --git a/internal/generator/plugins/coredhcp/coredhcp.go b/pkg/generator/plugins/coredhcp/coredhcp.go similarity index 100% rename from internal/generator/plugins/coredhcp/coredhcp.go rename to pkg/generator/plugins/coredhcp/coredhcp.go diff --git a/internal/generator/plugins/dhcpd/dhcpd.go b/pkg/generator/plugins/dhcpd/dhcpd.go similarity index 100% rename from internal/generator/plugins/dhcpd/dhcpd.go rename to pkg/generator/plugins/dhcpd/dhcpd.go diff --git a/internal/generator/plugins/dnsmasq/dnsmasq.go b/pkg/generator/plugins/dnsmasq/dnsmasq.go similarity index 100% rename from internal/generator/plugins/dnsmasq/dnsmasq.go rename to pkg/generator/plugins/dnsmasq/dnsmasq.go diff --git a/internal/generator/plugins/example/example.go b/pkg/generator/plugins/example/example.go similarity index 100% rename from internal/generator/plugins/example/example.go rename to pkg/generator/plugins/example/example.go diff --git a/internal/generator/plugins/hostfile/hostfile.go b/pkg/generator/plugins/hostfile/hostfile.go similarity index 100% rename from internal/generator/plugins/hostfile/hostfile.go rename to pkg/generator/plugins/hostfile/hostfile.go diff --git a/internal/generator/plugins/powerman/powerman.go b/pkg/generator/plugins/powerman/powerman.go similarity index 100% rename from internal/generator/plugins/powerman/powerman.go rename to pkg/generator/plugins/powerman/powerman.go diff --git a/internal/generator/plugins/syslog/syslog.go b/pkg/generator/plugins/syslog/syslog.go similarity index 100% rename from internal/generator/plugins/syslog/syslog.go rename to pkg/generator/plugins/syslog/syslog.go diff --git a/internal/generator/plugins/warewulf/warewulf.go b/pkg/generator/plugins/warewulf/warewulf.go similarity index 100% rename from internal/generator/plugins/warewulf/warewulf.go rename to pkg/generator/plugins/warewulf/warewulf.go diff --git a/internal/server/server.go b/pkg/server/server.go similarity index 99% rename from internal/server/server.go rename to pkg/server/server.go index 425a594..0e63a24 100644 --- a/internal/server/server.go +++ b/pkg/server/server.go @@ -108,6 +108,10 @@ func (s *Server) Serve() error { return s.ListenAndServe() } +func (s *Server) Close() { + +} + // This is the corresponding service function to generate templated files, that // works similarly to the CLI variant. This function takes similiar arguments as // query parameters that are included in the HTTP request URL. diff --git a/internal/util/params.go b/pkg/util/params.go similarity index 100% rename from internal/util/params.go rename to pkg/util/params.go diff --git a/internal/util/util.go b/pkg/util/util.go similarity index 100% rename from internal/util/util.go rename to pkg/util/util.go