github.com/GuanceCloud/cliutils@v1.1.21/point/env.go (about)

     1  // Unless explicitly stated otherwise all files in this repository are licensed
     2  // under the MIT License.
     3  // This product includes software developed at Guance Cloud (https://www.guance.com/).
     4  // Copyright 2021-present Guance, Inc.
     5  
     6  package point
     7  
     8  import "os"
     9  
    10  // ENV_DEFAULT_ENCODING: use protobuf point instead of lineprotocol(default use lineprotocol)
    11  
    12  const (
    13  	EnvDefaultEncoding       = "ENV_DEFAULT_ENCODING"
    14  	EnvEnableMixedArrayField = "ENV_ENABLE_MIXED_ARRAY_FIELD"
    15  	EnvEnableDictField       = "ENV_ENABLE_DICT_FIELD"
    16  )
    17  
    18  func loadEnvs() {
    19  	if v, ok := os.LookupEnv(EnvDefaultEncoding); ok {
    20  		DefaultEncoding = EncodingStr(v)
    21  	}
    22  
    23  	if _, ok := os.LookupEnv(EnvEnableMixedArrayField); ok {
    24  		EnableMixedArrayField = true
    25  	}
    26  
    27  	if _, ok := os.LookupEnv(EnvEnableDictField); ok {
    28  		EnableDictField = true
    29  	}
    30  }