github.com/GuanceCloud/cliutils@v1.1.21/point/specs.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  const (
     9  	defaultObjectName    = "default"
    10  	defaultLoggingStatus = "unknown"
    11  )
    12  
    13  var (
    14  	DefaultMeasurementName = "__default"
    15  
    16  	KeyTime        = NewKey("time", I)
    17  	KeyMeasurement = NewKey("measurement", S)
    18  	KeySource      = NewKey("source", S)
    19  	KeyClass       = NewKey("class", S)
    20  	KeyDate        = NewKey("date", I)
    21  
    22  	KeyName   = NewKey("name", S, defaultObjectName)
    23  	KeyStatus = NewKey("status", S, defaultLoggingStatus)
    24  )
    25  
    26  var (
    27  	// For logging, we use measurement-name as source value
    28  	// in kodo, so there should not be any tag/field named
    29  	// with `source`.
    30  	//
    31  	// For object, we use measurement-name as class value
    32  	// in kodo, so there should not be any tag/field named
    33  	// with `class`.
    34  	requiredKeys = map[Category][]*Key{
    35  		Logging: {KeyStatus},
    36  		Object:  {KeyName},
    37  		// TODO: others data type not set...
    38  	}
    39  
    40  	disabledKeys = map[Category][]*Key{
    41  		Logging: {KeySource, KeyDate},
    42  		Object:  {KeyClass, KeyDate},
    43  		// TODO: others data type not set...
    44  	}
    45  
    46  	DefaultEncoding = LineProtocol
    47  )