Skip to content

Commit

Permalink
feature: add compress type in logtail config
Browse files Browse the repository at this point in the history
feature: add compress type in logtail config
  • Loading branch information
shabicheng authored Apr 25, 2023
2 parents e8f9ed9 + 4f9434e commit d223a1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions log_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ func UpdateInputConfigField(detail InputDetailInterface, key string, val interfa
type OutputDetail struct {
ProjectName string `json:"projectName"`
LogStoreName string `json:"logstoreName"`
CompressType string `json:"compressType"`
}

// InputDetailInterface all input detail's interface
Expand Down
4 changes: 4 additions & 0 deletions log_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type ConfigTestSuite struct {
endpoint string
projectName string
logstoreName string
compressType string
accessKeyID string
accessKeySecret string
client Client
Expand Down Expand Up @@ -49,6 +50,7 @@ func (s *ConfigTestSuite) SetupSuite() {
s.endpoint = os.Getenv("LOG_TEST_ENDPOINT")
s.projectName = fmt.Sprintf("test-go-log-config-%d", time.Now().Unix())
s.logstoreName = fmt.Sprintf("logstore-%d", time.Now().Unix())
s.compressType = "lz4"
s.accessKeyID = os.Getenv("LOG_TEST_ACCESS_KEY_ID")
s.accessKeySecret = os.Getenv("LOG_TEST_ACCESS_KEY_SECRET")
s.client.AccessKeyID = s.accessKeyID
Expand Down Expand Up @@ -107,6 +109,7 @@ func (s *ConfigTestSuite) TestNormalFileConfig() {
OutputDetail: OutputDetail{
ProjectName: s.projectName,
LogStoreName: s.logstoreName,
CompressType: s.compressType,
},
}
regexConfig.Key = []string{"content"}
Expand All @@ -129,6 +132,7 @@ func (s *ConfigTestSuite) TestNormalFileConfig() {
s.Equal(destConfig.InputType, InputTypeFile)
s.Equal(destConfig.OutputDetail.ProjectName, s.projectName)
s.Equal(destConfig.OutputDetail.LogStoreName, s.logstoreName)
s.Equal(destConfig.OutputDetail.CompressType, s.compressType)
s.Equal(destConfig.OutputType, OutputTypeLogService)
regexConfigDest, ok := ConvertToRegexConfigInputDetail(destConfig.InputDetail)
s.True(ok)
Expand Down

0 comments on commit d223a1a

Please sign in to comment.