Skip to content

Commit

Permalink
chore: lint all files
Browse files Browse the repository at this point in the history
  • Loading branch information
aslafy-z committed May 22, 2023
1 parent 8243fea commit 3dc9e1d
Show file tree
Hide file tree
Showing 44 changed files with 927 additions and 747 deletions.
23 changes: 11 additions & 12 deletions pkg/mirror/struct_iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,17 @@ import (
//
// Example:
//
// s := struct{
// ...
// }{
// ...
// }
// iter := unstructured.StructRange(s)
// for iter.Next() {
// f := iter.Field()
// v := iter.Value()
// ...
// }
//
// s := struct{
// ...
// }{
// ...
// }
// iter := unstructured.StructRange(s)
// for iter.Next() {
// f := iter.Field()
// v := iter.Value()
// ...
// }
func StructRange(v interface{}) *StructIter {
return NewStructIter(reflect.ValueOf(v))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/hosttailer/hosttailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (h *HostTailer) Name(suffix string) string {
return strings.Join(strs, "-")
}

//Run is the implementation of type Resource interface, generates Deamonset for fileTailers
// Run is the implementation of type Resource interface, generates Deamonset for fileTailers
func (h *HostTailer) Run() (runtime.Object, reconciler.DesiredState, error) {
tailers := h.MergeTailers()
volumePaths := h.GatherPathStrings(tailers)
Expand Down
1 change: 1 addition & 0 deletions pkg/sdk/logging/model/common/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package common

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/sdk/logging/model/common/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package common

import (
Expand Down
46 changes: 26 additions & 20 deletions pkg/sdk/logging/model/filter/concat.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,30 +71,36 @@ type Concat struct {

// ## Example `Concat` filter configurations
// ```yaml
//apiVersion: logging.banzaicloud.io/v1beta1
//kind: Flow
//metadata:
// name: demo-flow
//spec:
// filters:
// - concat:
// partial_key: "partial_message"
// separator: ""
// n_lines: 10
// selectors: {}
// localOutputRefs:
// - demo-output
// apiVersion: logging.banzaicloud.io/v1beta1
// kind: Flow
// metadata:
//
// name: demo-flow
//
// spec:
//
// filters:
// - concat:
// partial_key: "partial_message"
// separator: ""
// n_lines: 10
// selectors: {}
// localOutputRefs:
// - demo-output
//
// ```
//
// #### Fluentd Config Result
// ```yaml
//<filter **>
// @type concat
// @id test_concat
// key message
// n_lines 10
// partial_key partial_message
//</filter>
// <filter **>
//
// @type concat
// @id test_concat
// key message
// n_lines 10
// partial_key partial_message
//
// </filter>
// ```
type _expConcat interface{} //nolint:deadcode,unused

Expand Down
42 changes: 24 additions & 18 deletions pkg/sdk/logging/model/filter/dedot.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,34 @@ type DedotFilterConfig struct {

// ## Example `Dedot` filter configurations
// ```yaml
//apiVersion: logging.banzaicloud.io/v1beta1
//kind: Flow
//metadata:
// name: demo-flow
//spec:
// filters:
// - dedot:
// de_dot_separator: "-"
// de_dot_nested: true
// selectors: {}
// localOutputRefs:
// - demo-output
// apiVersion: logging.banzaicloud.io/v1beta1
// kind: Flow
// metadata:
//
// name: demo-flow
//
// spec:
//
// filters:
// - dedot:
// de_dot_separator: "-"
// de_dot_nested: true
// selectors: {}
// localOutputRefs:
// - demo-output
//
// ```
//
// #### Fluentd Config Result
// ```yaml
//<filter **>
// @type dedot
// @id test_dedot
// de_dot_nested true
// de_dot_separator -
//</filter>
// <filter **>
//
// @type dedot
// @id test_dedot
// de_dot_nested true
// de_dot_separator -
//
// </filter>
// ```
type _expDedot interface{} //nolint:deadcode,unused

Expand Down
61 changes: 34 additions & 27 deletions pkg/sdk/logging/model/filter/detect_exceptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ import (
type _hugoExceptionDetector interface{} //nolint:deadcode,unused

// +docName:"Exception Detector"
//This filter plugin consumes a log stream of JSON objects which contain single-line log messages. If a consecutive sequence of log messages form an exception stack trace, they forwarded as a single, combined JSON object. Otherwise, the input log data is forwarded as is.
//More info at https://github.com/GoogleCloudPlatform/fluent-plugin-detect-exceptions
// This filter plugin consumes a log stream of JSON objects which contain single-line log messages. If a consecutive sequence of log messages form an exception stack trace, they forwarded as a single, combined JSON object. Otherwise, the input log data is forwarded as is.
// More info at https://github.com/GoogleCloudPlatform/fluent-plugin-detect-exceptions
//
// > Note: As Tag management is not supported yet, this Plugin is **mutually exclusive** with [Tag normaliser](../tagnormaliser)
//
// ## Example output configurations
// ```yaml
//filters:
// - detectExceptions:
// languages: java, python
// multiline_flush_interval: 0.1
// filters:
// - detectExceptions:
// languages: java, python
// multiline_flush_interval: 0.1
//
// ```
type _docExceptionDetector interface{} //nolint:deadcode,unused

Expand Down Expand Up @@ -69,31 +70,37 @@ type DetectExceptions struct {

// ## Example `Exception Detector` filter configurations
// ```yaml
//apiVersion: logging.banzaicloud.io/v1beta1
//kind: Flow
//metadata:
// name: demo-flow
//spec:
// filters:
// - detectExceptions:
// multiline_flush_interval: 0.1
// languages:
// - java
// - python
// selectors: {}
// localOutputRefs:
// - demo-output
// apiVersion: logging.banzaicloud.io/v1beta1
// kind: Flow
// metadata:
//
// name: demo-flow
//
// spec:
//
// filters:
// - detectExceptions:
// multiline_flush_interval: 0.1
// languages:
// - java
// - python
// selectors: {}
// localOutputRefs:
// - demo-output
//
// ```
//
// #### Fluentd Config Result
// ```yaml
//<match kubernetes.**>
// @type detect_exceptions
// @id test_detect_exceptions
// languages ["java","python"]
// multiline_flush_interval 0.1
// remove_tag_prefix kubernetes
//</match>
// <match kubernetes.**>
//
// @type detect_exceptions
// @id test_detect_exceptions
// languages ["java","python"]
// multiline_flush_interval 0.1
// remove_tag_prefix kubernetes
//
// </match>
// ```
type _expDetectExceptions interface{} //nolint:deadcode,unused

Expand Down
28 changes: 17 additions & 11 deletions pkg/sdk/logging/model/filter/enhance_k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,27 @@ type EnhanceK8s struct {

// ## Example `EnhanceK8s` filter configurations
// ```yaml
//apiVersion: logging.banzaicloud.io/v1beta1
//kind: Logging
//metadata:
// name: demo-flow
//spec:
// globalFilters:
// - enhanceK8s: {}
// apiVersion: logging.banzaicloud.io/v1beta1
// kind: Logging
// metadata:
//
// name: demo-flow
//
// spec:
//
// globalFilters:
// - enhanceK8s: {}
//
// ```
//
// #### Fluentd Config Result
// ```yaml
//<filter **>
// @type enhance_k8s_metadata
// @id test_enhanceK8s
//</filter>
// <filter **>
//
// @type enhance_k8s_metadata
// @id test_enhanceK8s
//
// </filter>
// ```
type _expEnhanceK8s interface{} //nolint:deadcode,unused

Expand Down
66 changes: 36 additions & 30 deletions pkg/sdk/logging/model/filter/geoip.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,40 +53,46 @@ type GeoIP struct {

// ## Example `GeoIP` filter configurations
// ```yaml
//apiVersion: logging.banzaicloud.io/v1beta1
//kind: Flow
//metadata:
// name: demo-flow
//spec:
// filters:
// - geoip:
// geoip_lookup_keys: remote_addr
// records:
// - city: ${city.names.en["remote_addr"]}
// location_array: '''[${location.longitude["remote"]},${location.latitude["remote"]}]'''
// country: ${country.iso_code["remote_addr"]}
// country_name: ${country.names.en["remote_addr"]}
// postal_code: ${postal.code["remote_addr"]}
// selectors: {}
// localOutputRefs:
// - demo-output
// apiVersion: logging.banzaicloud.io/v1beta1
// kind: Flow
// metadata:
//
// name: demo-flow
//
// spec:
//
// filters:
// - geoip:
// geoip_lookup_keys: remote_addr
// records:
// - city: ${city.names.en["remote_addr"]}
// location_array: '''[${location.longitude["remote"]},${location.latitude["remote"]}]'''
// country: ${country.iso_code["remote_addr"]}
// country_name: ${country.names.en["remote_addr"]}
// postal_code: ${postal.code["remote_addr"]}
// selectors: {}
// localOutputRefs:
// - demo-output
//
// ```
//
// #### Fluentd Config Result
// ```yaml
//<filter **>
// @type geoip
// @id test_geoip
// geoip_lookup_keys remote_addr
// skip_adding_null_record true
// <record>
// city ${city.names.en["remote_addr"]}
// country ${country.iso_code["remote_addr"]}
// country_name ${country.names.en["remote_addr"]}
// location_array '[${location.longitude["remote"]},${location.latitude["remote"]}]'
// postal_code ${postal.code["remote_addr"]}
// </record>
//</filter>
// <filter **>
//
// @type geoip
// @id test_geoip
// geoip_lookup_keys remote_addr
// skip_adding_null_record true
// <record>
// city ${city.names.en["remote_addr"]}
// country ${country.iso_code["remote_addr"]}
// country_name ${country.names.en["remote_addr"]}
// location_array '[${location.longitude["remote"]},${location.latitude["remote"]}]'
// postal_code ${postal.code["remote_addr"]}
// </record>
//
// </filter>
// ```
type _expGeoIP interface{} //nolint:deadcode,unused

Expand Down

0 comments on commit 3dc9e1d

Please sign in to comment.