当前位置: 首页>>代码示例>>Golang>>正文


Golang Point.Values方法代码示例

本文整理汇总了Golang中github.com/influxdb/influxdb/protocol.Point.Values方法的典型用法代码示例。如果您正苦于以下问题:Golang Point.Values方法的具体用法?Golang Point.Values怎么用?Golang Point.Values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/influxdb/influxdb/protocol.Point的用法示例。


在下文中一共展示了Point.Values方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: getPoint

// set the fields of the other time series to null making sure that
// the order of the null values match the order of the field
// definitions, i.e. left timeseries first followed by values from the
// right timeseries
func (self *mergeState) getPoint(fields []string, p *protocol.Point) *protocol.Point {
	if !self.modifyValues {
		return p
	}

	newValues := make([]*protocol.FieldValue, len(self.fields))
	oldValues := p.Values
	for idx, f := range fields {
		newIdx := self.fields[f]
		newValues[newIdx] = oldValues[idx]
	}
	p.Values = newValues
	return p
}
开发者ID:neurodrone,项目名称:influxdb,代码行数:18,代码来源:merge.go

示例2: filterColumns

func filterColumns(columns map[string]struct{}, fields []string, point *protocol.Point) {
	if _, ok := columns["*"]; ok {
		return
	}

	newValues := []*protocol.FieldValue{}
	newFields := []string{}
	for idx, f := range fields {
		if _, ok := columns[f]; !ok {
			continue
		}

		newValues = append(newValues, point.Values[idx])
		newFields = append(newFields, f)
	}
	point.Values = newValues
}
开发者ID:neurodrone,项目名称:influxdb,代码行数:17,代码来源:filtering.go


注:本文中的github.com/influxdb/influxdb/protocol.Point.Values方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。