diff --git a/agent/logs_agent.go b/agent/logs_agent.go index 65ddacc..cfab1df 100644 --- a/agent/logs_agent.go +++ b/agent/logs_agent.go @@ -15,18 +15,18 @@ import ( coreconfig "flashcat.cloud/categraf/config" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/auditor" - "flashcat.cloud/categraf/pkg/logs/client" - "flashcat.cloud/categraf/pkg/logs/client/http" - "flashcat.cloud/categraf/pkg/logs/diagnostic" - "flashcat.cloud/categraf/pkg/logs/input/file" - "flashcat.cloud/categraf/pkg/logs/input/journald" - "flashcat.cloud/categraf/pkg/logs/input/listener" - "flashcat.cloud/categraf/pkg/logs/pipeline" - "flashcat.cloud/categraf/pkg/logs/restart" - "flashcat.cloud/categraf/pkg/logs/service" - logService "flashcat.cloud/categraf/pkg/logs/service" - "flashcat.cloud/categraf/pkg/logs/status" + "flashcat.cloud/categraf/logs/auditor" + "flashcat.cloud/categraf/logs/client" + "flashcat.cloud/categraf/logs/client/http" + "flashcat.cloud/categraf/logs/diagnostic" + "flashcat.cloud/categraf/logs/input/file" + "flashcat.cloud/categraf/logs/input/journald" + "flashcat.cloud/categraf/logs/input/listener" + "flashcat.cloud/categraf/logs/pipeline" + "flashcat.cloud/categraf/logs/restart" + "flashcat.cloud/categraf/logs/service" + logService "flashcat.cloud/categraf/logs/service" + "flashcat.cloud/categraf/logs/status" ) // LogAgent represents the data pipeline that collects, decodes, diff --git a/pkg/logs/README.md b/logs/README.md similarity index 100% rename from pkg/logs/README.md rename to logs/README.md diff --git a/pkg/logs/auditor/api.go b/logs/auditor/api.go similarity index 100% rename from pkg/logs/auditor/api.go rename to logs/auditor/api.go diff --git a/pkg/logs/auditor/auditor.go b/logs/auditor/auditor.go similarity index 99% rename from pkg/logs/auditor/auditor.go rename to logs/auditor/auditor.go index 927e727..6303a5e 100644 --- a/pkg/logs/auditor/auditor.go +++ b/logs/auditor/auditor.go @@ -15,7 +15,7 @@ import ( "time" config "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) // DefaultRegistryFilename is the default registry filename diff --git a/pkg/logs/auditor/null_auditor.go b/logs/auditor/null_auditor.go similarity index 96% rename from pkg/logs/auditor/null_auditor.go rename to logs/auditor/null_auditor.go index 5bcfa7a..a163575 100644 --- a/pkg/logs/auditor/null_auditor.go +++ b/logs/auditor/null_auditor.go @@ -1,7 +1,7 @@ package auditor import ( - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) // NullAuditor is an auditor not doing anything with the message it received. diff --git a/pkg/logs/client/destination.go b/logs/client/destination.go similarity index 100% rename from pkg/logs/client/destination.go rename to logs/client/destination.go diff --git a/pkg/logs/client/destinations.go b/logs/client/destinations.go similarity index 100% rename from pkg/logs/client/destinations.go rename to logs/client/destinations.go diff --git a/pkg/logs/client/destinations_context.go b/logs/client/destinations_context.go similarity index 100% rename from pkg/logs/client/destinations_context.go rename to logs/client/destinations_context.go diff --git a/pkg/logs/client/errors.go b/logs/client/errors.go similarity index 100% rename from pkg/logs/client/errors.go rename to logs/client/errors.go diff --git a/pkg/logs/client/http/content_encoding.go b/logs/client/http/content_encoding.go similarity index 100% rename from pkg/logs/client/http/content_encoding.go rename to logs/client/http/content_encoding.go diff --git a/pkg/logs/client/http/destination.go b/logs/client/http/destination.go similarity index 99% rename from pkg/logs/client/http/destination.go rename to logs/client/http/destination.go index e85b822..b3cfb19 100644 --- a/pkg/logs/client/http/destination.go +++ b/logs/client/http/destination.go @@ -13,7 +13,7 @@ import ( "time" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/client" + "flashcat.cloud/categraf/logs/client" "flashcat.cloud/categraf/pkg/util/backoff" httputils "flashcat.cloud/categraf/pkg/util/http" ) diff --git a/pkg/logs/client/tcp/connection_manager.go b/logs/client/tcp/connection_manager.go similarity index 99% rename from pkg/logs/client/tcp/connection_manager.go rename to logs/client/tcp/connection_manager.go index 861ff8a..f0c890d 100644 --- a/pkg/logs/client/tcp/connection_manager.go +++ b/logs/client/tcp/connection_manager.go @@ -21,7 +21,7 @@ import ( "golang.org/x/net/proxy" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/status" + "flashcat.cloud/categraf/logs/status" ) const ( diff --git a/pkg/logs/client/tcp/delimiter.go b/logs/client/tcp/delimiter.go similarity index 100% rename from pkg/logs/client/tcp/delimiter.go rename to logs/client/tcp/delimiter.go diff --git a/pkg/logs/client/tcp/destination.go b/logs/client/tcp/destination.go similarity index 98% rename from pkg/logs/client/tcp/destination.go rename to logs/client/tcp/destination.go index 13511b3..cf4cc5a 100644 --- a/pkg/logs/client/tcp/destination.go +++ b/logs/client/tcp/destination.go @@ -11,7 +11,7 @@ import ( "time" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/client" + "flashcat.cloud/categraf/logs/client" ) const ( diff --git a/pkg/logs/client/tcp/prefixer.go b/logs/client/tcp/prefixer.go similarity index 100% rename from pkg/logs/client/tcp/prefixer.go rename to logs/client/tcp/prefixer.go diff --git a/pkg/logs/decoder/auto_multiline_handler.go b/logs/decoder/auto_multiline_handler.go similarity index 100% rename from pkg/logs/decoder/auto_multiline_handler.go rename to logs/decoder/auto_multiline_handler.go diff --git a/pkg/logs/decoder/decoder.go b/logs/decoder/decoder.go similarity index 99% rename from pkg/logs/decoder/decoder.go rename to logs/decoder/decoder.go index dc7d1f3..04e60bc 100644 --- a/pkg/logs/decoder/decoder.go +++ b/logs/decoder/decoder.go @@ -13,7 +13,7 @@ import ( "time" config "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/parser" + "flashcat.cloud/categraf/logs/parser" ) // defaultContentLenLimit represents the max size for a line, diff --git a/pkg/logs/decoder/line_handler.go b/logs/decoder/line_handler.go similarity index 100% rename from pkg/logs/decoder/line_handler.go rename to logs/decoder/line_handler.go diff --git a/pkg/logs/decoder/line_parser.go b/logs/decoder/line_parser.go similarity index 99% rename from pkg/logs/decoder/line_parser.go rename to logs/decoder/line_parser.go index b903493..a981f35 100644 --- a/pkg/logs/decoder/line_parser.go +++ b/logs/decoder/line_parser.go @@ -10,7 +10,7 @@ import ( "log" "time" - "flashcat.cloud/categraf/pkg/logs/parser" + "flashcat.cloud/categraf/logs/parser" ) // LineParser e diff --git a/pkg/logs/decoder/matcher.go b/logs/decoder/matcher.go similarity index 100% rename from pkg/logs/decoder/matcher.go rename to logs/decoder/matcher.go diff --git a/pkg/logs/decoder/multiline_handler.go b/logs/decoder/multiline_handler.go similarity index 100% rename from pkg/logs/decoder/multiline_handler.go rename to logs/decoder/multiline_handler.go diff --git a/pkg/logs/decoder/single_line_handler.go b/logs/decoder/single_line_handler.go similarity index 100% rename from pkg/logs/decoder/single_line_handler.go rename to logs/decoder/single_line_handler.go diff --git a/pkg/logs/diagnostic/message_receiver.go b/logs/diagnostic/message_receiver.go similarity index 98% rename from pkg/logs/diagnostic/message_receiver.go rename to logs/diagnostic/message_receiver.go index 68906e2..067b743 100644 --- a/pkg/logs/diagnostic/message_receiver.go +++ b/logs/diagnostic/message_receiver.go @@ -12,7 +12,7 @@ import ( "time" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) // MessageReceiver interface to handle messages for diagnostics diff --git a/pkg/logs/diagnostic/noop_message_receiver.go b/logs/diagnostic/noop_message_receiver.go similarity index 91% rename from pkg/logs/diagnostic/noop_message_receiver.go rename to logs/diagnostic/noop_message_receiver.go index 2495332..dfc33cd 100644 --- a/pkg/logs/diagnostic/noop_message_receiver.go +++ b/logs/diagnostic/noop_message_receiver.go @@ -5,7 +5,7 @@ package diagnostic -import "flashcat.cloud/categraf/pkg/logs/message" +import "flashcat.cloud/categraf/logs/message" // NoopMessageReceiver for cases where diagnosing messages is unsupported or not needed (serverless, tests) type NoopMessageReceiver struct{} diff --git a/pkg/logs/input/channel/launcher.go b/logs/input/channel/launcher.go similarity index 97% rename from pkg/logs/input/channel/launcher.go rename to logs/input/channel/launcher.go index 60429fb..c8e8f35 100644 --- a/pkg/logs/input/channel/launcher.go +++ b/logs/input/channel/launcher.go @@ -7,7 +7,7 @@ package channel import ( logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/pipeline" + "flashcat.cloud/categraf/logs/pipeline" ) // Launcher starts a channel reader on the given channel of string. diff --git a/pkg/logs/input/channel/tailer.go b/logs/input/channel/tailer.go similarity index 98% rename from pkg/logs/input/channel/tailer.go rename to logs/input/channel/tailer.go index 797aaa8..c76769e 100644 --- a/pkg/logs/input/channel/tailer.go +++ b/logs/input/channel/tailer.go @@ -11,7 +11,7 @@ import ( "time" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) // serviceEnvVar is the environment variable of the service tag (this is used only for the serverless agent) diff --git a/pkg/logs/input/file/file_provider.go b/logs/input/file/file_provider.go similarity index 99% rename from pkg/logs/input/file/file_provider.go rename to logs/input/file/file_provider.go index f757ef8..8654aea 100644 --- a/pkg/logs/input/file/file_provider.go +++ b/logs/input/file/file_provider.go @@ -13,7 +13,7 @@ import ( "sort" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/status" + "flashcat.cloud/categraf/logs/status" ) // OpenFilesLimitWarningType is the key of the message generated when too many diff --git a/pkg/logs/input/file/open_file_nix.go b/logs/input/file/open_file_nix.go similarity index 100% rename from pkg/logs/input/file/open_file_nix.go rename to logs/input/file/open_file_nix.go diff --git a/pkg/logs/input/file/open_file_windows.go b/logs/input/file/open_file_windows.go similarity index 100% rename from pkg/logs/input/file/open_file_windows.go rename to logs/input/file/open_file_windows.go diff --git a/pkg/logs/input/file/position.go b/logs/input/file/position.go similarity index 96% rename from pkg/logs/input/file/position.go rename to logs/input/file/position.go index bd061a0..c66aa13 100644 --- a/pkg/logs/input/file/position.go +++ b/logs/input/file/position.go @@ -10,7 +10,7 @@ import ( "strconv" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/auditor" + "flashcat.cloud/categraf/logs/auditor" ) // Position returns the position from where logs should be collected. diff --git a/pkg/logs/input/file/rotate_nix.go b/logs/input/file/rotate_nix.go similarity index 100% rename from pkg/logs/input/file/rotate_nix.go rename to logs/input/file/rotate_nix.go diff --git a/pkg/logs/input/file/rotate_windows.go b/logs/input/file/rotate_windows.go similarity index 100% rename from pkg/logs/input/file/rotate_windows.go rename to logs/input/file/rotate_windows.go diff --git a/pkg/logs/input/file/scanner.go b/logs/input/file/scanner.go similarity index 98% rename from pkg/logs/input/file/scanner.go rename to logs/input/file/scanner.go index 22694c5..308f0b4 100644 --- a/pkg/logs/input/file/scanner.go +++ b/logs/input/file/scanner.go @@ -15,10 +15,10 @@ import ( "time" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/auditor" - "flashcat.cloud/categraf/pkg/logs/message" - "flashcat.cloud/categraf/pkg/logs/pipeline" - "flashcat.cloud/categraf/pkg/logs/restart" + "flashcat.cloud/categraf/logs/auditor" + "flashcat.cloud/categraf/logs/message" + "flashcat.cloud/categraf/logs/pipeline" + "flashcat.cloud/categraf/logs/restart" ) // rxContainerID is used in the shouldIgnore func to do a best-effort validation diff --git a/pkg/logs/input/file/tailer.go b/logs/input/file/tailer.go similarity index 98% rename from pkg/logs/input/file/tailer.go rename to logs/input/file/tailer.go index 5b15699..9c5e96a 100644 --- a/pkg/logs/input/file/tailer.go +++ b/logs/input/file/tailer.go @@ -18,10 +18,10 @@ import ( "time" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/decoder" - "flashcat.cloud/categraf/pkg/logs/message" - "flashcat.cloud/categraf/pkg/logs/parser" - "flashcat.cloud/categraf/pkg/logs/tag" + "flashcat.cloud/categraf/logs/decoder" + "flashcat.cloud/categraf/logs/message" + "flashcat.cloud/categraf/logs/parser" + "flashcat.cloud/categraf/logs/tag" ) // DefaultSleepDuration represents the amount of time the tailer waits before reading new data when no data is received diff --git a/pkg/logs/input/file/tailer_nix.go b/logs/input/file/tailer_nix.go similarity index 97% rename from pkg/logs/input/file/tailer_nix.go rename to logs/input/file/tailer_nix.go index 9784fb9..8dc7efd 100644 --- a/pkg/logs/input/file/tailer_nix.go +++ b/logs/input/file/tailer_nix.go @@ -14,7 +14,7 @@ import ( "log" "path/filepath" - "flashcat.cloud/categraf/pkg/logs/decoder" + "flashcat.cloud/categraf/logs/decoder" ) // setup sets up the file tailer diff --git a/pkg/logs/input/file/tailer_windows.go b/logs/input/file/tailer_windows.go similarity index 97% rename from pkg/logs/input/file/tailer_windows.go rename to logs/input/file/tailer_windows.go index b702b21..ab3188d 100644 --- a/pkg/logs/input/file/tailer_windows.go +++ b/logs/input/file/tailer_windows.go @@ -14,7 +14,7 @@ import ( "os" "path/filepath" - "flashcat.cloud/categraf/pkg/logs/decoder" + "flashcat.cloud/categraf/logs/decoder" ) // setup sets up the file tailer diff --git a/pkg/logs/input/journald/launcher.go b/logs/input/journald/launcher.go similarity index 94% rename from pkg/logs/input/journald/launcher.go rename to logs/input/journald/launcher.go index 4f9c7df..18c10f5 100644 --- a/pkg/logs/input/journald/launcher.go +++ b/logs/input/journald/launcher.go @@ -11,9 +11,9 @@ package journald import ( "log" - "flashcat.cloud/categraf/pkg/logs/auditor" - "flashcat.cloud/categraf/pkg/logs/pipeline" - "flashcat.cloud/categraf/pkg/logs/restart" + "flashcat.cloud/categraf/logs/auditor" + "flashcat.cloud/categraf/logs/pipeline" + "flashcat.cloud/categraf/logs/restart" ) // Launcher is in charge of starting and stopping new journald tailers diff --git a/pkg/logs/input/journald/launcher_nosystemd.go b/logs/input/journald/launcher_nosystemd.go similarity index 89% rename from pkg/logs/input/journald/launcher_nosystemd.go rename to logs/input/journald/launcher_nosystemd.go index dc424e5..5c14af6 100644 --- a/pkg/logs/input/journald/launcher_nosystemd.go +++ b/logs/input/journald/launcher_nosystemd.go @@ -10,8 +10,8 @@ package journald import ( logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/auditor" - "flashcat.cloud/categraf/pkg/logs/pipeline" + "flashcat.cloud/categraf/logs/auditor" + "flashcat.cloud/categraf/logs/pipeline" ) // Launcher is not supported on no systemd environment. diff --git a/pkg/logs/input/journald/tailer.go b/logs/input/journald/tailer.go similarity index 99% rename from pkg/logs/input/journald/tailer.go rename to logs/input/journald/tailer.go index 333628c..359a35d 100644 --- a/pkg/logs/input/journald/tailer.go +++ b/logs/input/journald/tailer.go @@ -18,7 +18,7 @@ import ( "github.com/coreos/go-systemd/sdjournal" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) // defaultWaitDuration represents the delay before which we try to collect a new log from the journal diff --git a/pkg/logs/input/journald/tailer_util.go b/logs/input/journald/tailer_util.go similarity index 100% rename from pkg/logs/input/journald/tailer_util.go rename to logs/input/journald/tailer_util.go diff --git a/pkg/logs/input/listener/errors.go b/logs/input/listener/errors.go similarity index 100% rename from pkg/logs/input/listener/errors.go rename to logs/input/listener/errors.go diff --git a/pkg/logs/input/listener/launcher.go b/logs/input/listener/launcher.go similarity index 95% rename from pkg/logs/input/listener/launcher.go rename to logs/input/listener/launcher.go index e22b669..4ca1831 100644 --- a/pkg/logs/input/listener/launcher.go +++ b/logs/input/listener/launcher.go @@ -7,8 +7,8 @@ package listener import ( logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/pipeline" - "flashcat.cloud/categraf/pkg/logs/restart" + "flashcat.cloud/categraf/logs/pipeline" + "flashcat.cloud/categraf/logs/restart" ) // Launcher summons different protocol specific listeners based on configuration diff --git a/pkg/logs/input/listener/tailer.go b/logs/input/listener/tailer.go similarity index 94% rename from pkg/logs/input/listener/tailer.go rename to logs/input/listener/tailer.go index 3d8b706..2e2077a 100644 --- a/pkg/logs/input/listener/tailer.go +++ b/logs/input/listener/tailer.go @@ -11,9 +11,9 @@ import ( "net" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/decoder" - "flashcat.cloud/categraf/pkg/logs/message" - "flashcat.cloud/categraf/pkg/logs/parser" + "flashcat.cloud/categraf/logs/decoder" + "flashcat.cloud/categraf/logs/message" + "flashcat.cloud/categraf/logs/parser" ) // Tailer reads data from a connection diff --git a/pkg/logs/input/listener/tcp.go b/logs/input/listener/tcp.go similarity index 97% rename from pkg/logs/input/listener/tcp.go rename to logs/input/listener/tcp.go index 9d78027..c985818 100644 --- a/pkg/logs/input/listener/tcp.go +++ b/logs/input/listener/tcp.go @@ -13,8 +13,8 @@ import ( "time" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/pipeline" - "flashcat.cloud/categraf/pkg/logs/restart" + "flashcat.cloud/categraf/logs/pipeline" + "flashcat.cloud/categraf/logs/restart" ) // A TCPListener listens and accepts TCP connections and delegates the read operations to a tailer. diff --git a/pkg/logs/input/listener/udp.go b/logs/input/listener/udp.go similarity index 98% rename from pkg/logs/input/listener/udp.go rename to logs/input/listener/udp.go index efe43e9..988364d 100644 --- a/pkg/logs/input/listener/udp.go +++ b/logs/input/listener/udp.go @@ -11,7 +11,7 @@ import ( "net" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/pipeline" + "flashcat.cloud/categraf/logs/pipeline" ) // The UDP listener is limited by the size of its read buffer, diff --git a/pkg/logs/message/message.go b/logs/message/message.go similarity index 100% rename from pkg/logs/message/message.go rename to logs/message/message.go diff --git a/pkg/logs/message/origin.go b/logs/message/origin.go similarity index 100% rename from pkg/logs/message/origin.go rename to logs/message/origin.go diff --git a/pkg/logs/message/status.go b/logs/message/status.go similarity index 100% rename from pkg/logs/message/status.go rename to logs/message/status.go diff --git a/pkg/logs/parser/parser.go b/logs/parser/parser.go similarity index 100% rename from pkg/logs/parser/parser.go rename to logs/parser/parser.go diff --git a/pkg/logs/pb/agent_logs_payload.pb.go b/logs/pb/agent_logs_payload.pb.go similarity index 100% rename from pkg/logs/pb/agent_logs_payload.pb.go rename to logs/pb/agent_logs_payload.pb.go diff --git a/pkg/logs/pipeline/pipeline.go b/logs/pipeline/pipeline.go similarity index 90% rename from pkg/logs/pipeline/pipeline.go rename to logs/pipeline/pipeline.go index 9376ae8..176a8f3 100644 --- a/pkg/logs/pipeline/pipeline.go +++ b/logs/pipeline/pipeline.go @@ -9,13 +9,13 @@ import ( "context" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/client" - "flashcat.cloud/categraf/pkg/logs/client/http" - "flashcat.cloud/categraf/pkg/logs/client/tcp" - "flashcat.cloud/categraf/pkg/logs/diagnostic" - "flashcat.cloud/categraf/pkg/logs/message" - "flashcat.cloud/categraf/pkg/logs/processor" - "flashcat.cloud/categraf/pkg/logs/sender" + "flashcat.cloud/categraf/logs/client" + "flashcat.cloud/categraf/logs/client/http" + "flashcat.cloud/categraf/logs/client/tcp" + "flashcat.cloud/categraf/logs/diagnostic" + "flashcat.cloud/categraf/logs/message" + "flashcat.cloud/categraf/logs/processor" + "flashcat.cloud/categraf/logs/sender" ) // Pipeline processes and sends messages to the backend diff --git a/pkg/logs/pipeline/provider.go b/logs/pipeline/provider.go similarity index 94% rename from pkg/logs/pipeline/provider.go rename to logs/pipeline/provider.go index 198b667..9b14edc 100644 --- a/pkg/logs/pipeline/provider.go +++ b/logs/pipeline/provider.go @@ -9,13 +9,13 @@ import ( "context" "sync/atomic" - "flashcat.cloud/categraf/pkg/logs/diagnostic" + "flashcat.cloud/categraf/logs/diagnostic" config "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/auditor" - "flashcat.cloud/categraf/pkg/logs/client" - "flashcat.cloud/categraf/pkg/logs/message" - "flashcat.cloud/categraf/pkg/logs/restart" + "flashcat.cloud/categraf/logs/auditor" + "flashcat.cloud/categraf/logs/client" + "flashcat.cloud/categraf/logs/message" + "flashcat.cloud/categraf/logs/restart" ) // Provider provides message channels diff --git a/pkg/logs/processor/encoder.go b/logs/processor/encoder.go similarity index 95% rename from pkg/logs/processor/encoder.go rename to logs/processor/encoder.go index 966bc00..ce99d0d 100644 --- a/pkg/logs/processor/encoder.go +++ b/logs/processor/encoder.go @@ -9,7 +9,7 @@ import ( "unicode" "unicode/utf8" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) // Encoder turns a message into a raw byte array ready to be sent. diff --git a/pkg/logs/processor/json.go b/logs/processor/json.go similarity index 96% rename from pkg/logs/processor/json.go rename to logs/processor/json.go index b04be14..bdc2d1c 100644 --- a/pkg/logs/processor/json.go +++ b/logs/processor/json.go @@ -9,7 +9,7 @@ import ( "encoding/json" "time" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) const nanoToMillis = 1000000 diff --git a/pkg/logs/processor/json_serverless.go b/logs/processor/json_serverless.go similarity index 97% rename from pkg/logs/processor/json_serverless.go rename to logs/processor/json_serverless.go index 5b83070..01e40ce 100644 --- a/pkg/logs/processor/json_serverless.go +++ b/logs/processor/json_serverless.go @@ -9,7 +9,7 @@ import ( "encoding/json" "time" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) // JSONServerlessEncoder is a shared json encoder sending a struct message field diff --git a/pkg/logs/processor/processor.go b/logs/processor/processor.go similarity index 97% rename from pkg/logs/processor/processor.go rename to logs/processor/processor.go index a8da090..a7d8c44 100644 --- a/pkg/logs/processor/processor.go +++ b/logs/processor/processor.go @@ -11,8 +11,8 @@ import ( "sync" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/diagnostic" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/diagnostic" + "flashcat.cloud/categraf/logs/message" ) // A Processor updates messages from an inputChan and pushes diff --git a/pkg/logs/processor/proto.go b/logs/processor/proto.go similarity index 91% rename from pkg/logs/processor/proto.go rename to logs/processor/proto.go index 84c5935..17c18af 100644 --- a/pkg/logs/processor/proto.go +++ b/logs/processor/proto.go @@ -8,8 +8,8 @@ package processor import ( "time" - "flashcat.cloud/categraf/pkg/logs/message" - "flashcat.cloud/categraf/pkg/logs/pb" + "flashcat.cloud/categraf/logs/message" + "flashcat.cloud/categraf/logs/pb" ) // ProtoEncoder is a shared proto encoder. diff --git a/pkg/logs/processor/raw.go b/logs/processor/raw.go similarity index 98% rename from pkg/logs/processor/raw.go rename to logs/processor/raw.go index d3bb832..1269ad4 100644 --- a/pkg/logs/processor/raw.go +++ b/logs/processor/raw.go @@ -10,7 +10,7 @@ import ( "time" logsconfig "flashcat.cloud/categraf/config/logs" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) // RawEncoder is a shared raw encoder. diff --git a/pkg/logs/restart/parallel_stop.go b/logs/restart/parallel_stop.go similarity index 100% rename from pkg/logs/restart/parallel_stop.go rename to logs/restart/parallel_stop.go diff --git a/pkg/logs/restart/restart.go b/logs/restart/restart.go similarity index 100% rename from pkg/logs/restart/restart.go rename to logs/restart/restart.go diff --git a/pkg/logs/restart/serial_stop.go b/logs/restart/serial_stop.go similarity index 100% rename from pkg/logs/restart/serial_stop.go rename to logs/restart/serial_stop.go diff --git a/pkg/logs/restart/start.go b/logs/restart/start.go similarity index 100% rename from pkg/logs/restart/start.go rename to logs/restart/start.go diff --git a/pkg/logs/restart/starter.go b/logs/restart/starter.go similarity index 100% rename from pkg/logs/restart/starter.go rename to logs/restart/starter.go diff --git a/pkg/logs/restart/stop.go b/logs/restart/stop.go similarity index 100% rename from pkg/logs/restart/stop.go rename to logs/restart/stop.go diff --git a/pkg/logs/sender/batch_strategy.go b/logs/sender/batch_strategy.go similarity index 99% rename from pkg/logs/sender/batch_strategy.go rename to logs/sender/batch_strategy.go index ff11f83..9ac7ecc 100644 --- a/pkg/logs/sender/batch_strategy.go +++ b/logs/sender/batch_strategy.go @@ -11,7 +11,7 @@ import ( "sync" "time" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) // batchStrategy contains all the logic to send logs in batch. diff --git a/pkg/logs/sender/message_buffer.go b/logs/sender/message_buffer.go similarity index 97% rename from pkg/logs/sender/message_buffer.go rename to logs/sender/message_buffer.go index a8efa74..0be723a 100644 --- a/pkg/logs/sender/message_buffer.go +++ b/logs/sender/message_buffer.go @@ -6,7 +6,7 @@ package sender import ( - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) // MessageBuffer accumulates messages to a buffer until the max capacity is reached. diff --git a/pkg/logs/sender/sender.go b/logs/sender/sender.go similarity index 96% rename from pkg/logs/sender/sender.go rename to logs/sender/sender.go index 41d96db..7b0d3e4 100644 --- a/pkg/logs/sender/sender.go +++ b/logs/sender/sender.go @@ -8,8 +8,8 @@ package sender import ( "context" - "flashcat.cloud/categraf/pkg/logs/client" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/client" + "flashcat.cloud/categraf/logs/message" ) // Strategy should contain all logic to send logs to a remote destination diff --git a/pkg/logs/sender/serializer.go b/logs/sender/serializer.go similarity index 97% rename from pkg/logs/sender/serializer.go rename to logs/sender/serializer.go index 76b6a24..57eb490 100644 --- a/pkg/logs/sender/serializer.go +++ b/logs/sender/serializer.go @@ -8,7 +8,7 @@ package sender import ( "bytes" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) var ( diff --git a/pkg/logs/sender/stream_strategy.go b/logs/sender/stream_strategy.go similarity index 96% rename from pkg/logs/sender/stream_strategy.go rename to logs/sender/stream_strategy.go index 5b1696c..f0b2fce 100644 --- a/pkg/logs/sender/stream_strategy.go +++ b/logs/sender/stream_strategy.go @@ -9,7 +9,7 @@ import ( "context" "log" - "flashcat.cloud/categraf/pkg/logs/message" + "flashcat.cloud/categraf/logs/message" ) // StreamStrategy is a shared stream strategy. diff --git a/pkg/logs/service/service.go b/logs/service/service.go similarity index 100% rename from pkg/logs/service/service.go rename to logs/service/service.go diff --git a/pkg/logs/service/services.go b/logs/service/services.go similarity index 100% rename from pkg/logs/service/services.go rename to logs/service/services.go diff --git a/pkg/logs/status/builder.go b/logs/status/builder.go similarity index 100% rename from pkg/logs/status/builder.go rename to logs/status/builder.go diff --git a/pkg/logs/status/status.go b/logs/status/status.go similarity index 100% rename from pkg/logs/status/status.go rename to logs/status/status.go diff --git a/pkg/logs/tag/local_provider.go b/logs/tag/local_provider.go similarity index 100% rename from pkg/logs/tag/local_provider.go rename to logs/tag/local_provider.go diff --git a/pkg/logs/tag/provider.go b/logs/tag/provider.go similarity index 100% rename from pkg/logs/tag/provider.go rename to logs/tag/provider.go