github.com/erda-project/erda-infra@v1.0.9/providers/component-protocol/components/commodel/data-structure/data_structure.go (about)

     1  // Copyright (c) 2021 Terminus, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package structure
    16  
    17  // Type defined
    18  const (
    19  	String      Type = "string"
    20  	Number      Type = "number"
    21  	Capacity    Type = "capacity"
    22  	TrafficRate Type = "trafficRate"
    23  	Storage     Type = "storage"
    24  	Timestamp   Type = "timestamp"
    25  	Time        Type = "time"
    26  )
    27  
    28  // Precision defined
    29  const (
    30  	K           Precision = "K"
    31  	M           Precision = "M"
    32  	B           Precision = "B"
    33  	KB          Precision = "KB"
    34  	MB          Precision = "MB"
    35  	GB          Precision = "GB"
    36  	TB          Precision = "TB"
    37  	PB          Precision = "PB"
    38  	EB          Precision = "EB"
    39  	ZB          Precision = "ZB"
    40  	YB          Precision = "YB"
    41  	BSlashS     Precision = "B/s"
    42  	KBSlashS    Precision = "KB/s"
    43  	MBSlashS    Precision = "MB/s"
    44  	GBSlashS    Precision = "GB/s"
    45  	TBSlashS    Precision = "TB/s"
    46  	PBSlashS    Precision = "PB/s"
    47  	EBSlashS    Precision = "EB/s"
    48  	ZBSlashS    Precision = "ZB/s"
    49  	YBSlashS    Precision = "YB/s"
    50  	Nanosecond  Precision = "ns"
    51  	Microsecond Precision = "μs"
    52  	Millisecond Precision = "ms"
    53  	Second      Precision = "s"
    54  	ReqSlashS   Precision = "req/s"
    55  )
    56  
    57  type (
    58  	//Type .
    59  	Type string
    60  	//Precision .
    61  	Precision string
    62  	//DataStructure .
    63  	DataStructure struct {
    64  		Type      Type      `json:"type"`
    65  		Precision Precision `json:"precision"`
    66  		Enable    bool      `json:"enable"`
    67  	}
    68  )