common

package
Version: v0.16.1-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package common is a generated protocol buffer package.

It is generated from these files:

github.com/intelsdi-x/snap/grpc/common/common.proto

It has these top-level messages:

Time
Empty
SnapError
Label
Metric
NamespaceElement
SubscribedPlugin
ConfigMap
Plugin

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigMapToConfig

func ConfigMapToConfig(cfg *ConfigMap) *cdata.ConfigDataNode

Converts configMaps to ConfigDataNode

func ConvertSnapErrors

func ConvertSnapErrors(s []*SnapError) []serror.SnapError

Converts SnapError protobuf messages to serror.Snaperrors

func GetError

func GetError(s *SnapError) string

Returns a SnapError protobuf messages errorString

func GetFields

func GetFields(s *SnapError) map[string]interface{}

Returns the fields from a SnapError protobuf message

func MetricToRequested

func MetricToRequested(mts []*Metric) []core.RequestedMetric

func MsgToCorePlugin

func MsgToCorePlugin(msg *Plugin) core.Plugin

Converts Plugin protobuf message to core.Plugin

func MsgToCorePlugins

func MsgToCorePlugins(msg []*Plugin) []core.Plugin

Converts slice of plugin protobuf messages to core.Plugins

func ParseConfig

func ParseConfig(config *ConfigMap) map[string]ctypes.ConfigValue

Parses a configMap to a map[string]ctypes.ConfigValue

func ToCoreMetric

func ToCoreMetric(mt *Metric) core.Metric

Convert common.Metric to core.Metric

func ToCoreMetrics

func ToCoreMetrics(mts []*Metric) []core.Metric

Convert slice of common.Metric to []core.Metric

func ToCoreNamespace

func ToCoreNamespace(n []*NamespaceElement) core.Namespace

Convert common.Namespace protobuf message to core.Namespace

func ToCorePlugin

func ToCorePlugin(pl core.SubscribedPlugin) core.Plugin

Convert from core.SubscribedPlugin to core.Plugin

func ToCorePlugins

func ToCorePlugins(pl []core.SubscribedPlugin) []core.Plugin

Convert from []core.SubscribedPlugin to []core.Plugin

func ToRequestedMetrics

func ToRequestedMetrics(mts []*Metric) []core.RequestedMetric

Convert slice of common.Metric to []core.RequestedMetric

func ToSnapError

func ToSnapError(e *SnapError) serror.SnapError

Converts a single SnapError protobuf message to SnapError

func ToSubPlugin

func ToSubPlugin(msg *SubscribedPlugin) core.SubscribedPlugin

Convert from a SubscribedPlugin protobuf message to core.SubscribedPlugin

func ToSubPlugins

func ToSubPlugins(msg []*SubscribedPlugin) []core.SubscribedPlugin

Converts slice of SubscribedPlugin Messages to core.SubscribedPlugins

Types

type ConfigMap

type ConfigMap struct {
	IntMap    map[string]int64  `` /* 145-byte string literal not displayed */
	StringMap map[string]string `` /* 153-byte string literal not displayed */
	// double is float64
	FloatMap map[string]float64 `` /* 152-byte string literal not displayed */
	BoolMap  map[string]bool    `` /* 148-byte string literal not displayed */
}

func ConfigToConfigMap

func ConfigToConfigMap(cd *cdata.ConfigDataNode) *ConfigMap

Converts ConfigDataNode to ConfigMap protobuf message

func ToConfigMap

func ToConfigMap(cv map[string]ctypes.ConfigValue) *ConfigMap

Converts ConfigDataNode to ConfigMap protobuf message

func (*ConfigMap) Descriptor

func (*ConfigMap) Descriptor() ([]byte, []int)

func (*ConfigMap) GetBoolMap

func (m *ConfigMap) GetBoolMap() map[string]bool

func (*ConfigMap) GetFloatMap

func (m *ConfigMap) GetFloatMap() map[string]float64

func (*ConfigMap) GetIntMap

func (m *ConfigMap) GetIntMap() map[string]int64

func (*ConfigMap) GetStringMap

func (m *ConfigMap) GetStringMap() map[string]string

func (*ConfigMap) ProtoMessage

func (*ConfigMap) ProtoMessage()

func (*ConfigMap) Reset

func (m *ConfigMap) Reset()

func (*ConfigMap) String

func (m *ConfigMap) String() string

type Empty

type Empty struct {
}

func (*Empty) Descriptor

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

type Label

type Label struct {
	Index uint64 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"`
	Name  string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
}

func (*Label) Descriptor

func (*Label) Descriptor() ([]byte, []int)

func (*Label) ProtoMessage

func (*Label) ProtoMessage()

func (*Label) Reset

func (m *Label) Reset()

func (*Label) String

func (m *Label) String() string

type Metric

type Metric struct {
	Namespace          []*NamespaceElement `protobuf:"bytes,1,rep,name=Namespace,json=namespace" json:"Namespace,omitempty"`
	Version            int64               `protobuf:"varint,2,opt,name=Version,json=version" json:"Version,omitempty"`
	Config             *ConfigMap          `protobuf:"bytes,3,opt,name=Config,json=config" json:"Config,omitempty"`
	LastAdvertisedTime *Time               `protobuf:"bytes,4,opt,name=LastAdvertisedTime,json=lastAdvertisedTime" json:"LastAdvertisedTime,omitempty"`
	Tags               map[string]string   `` /* 138-byte string literal not displayed */
	Timestamp          *Time               `protobuf:"bytes,6,opt,name=Timestamp,json=timestamp" json:"Timestamp,omitempty"`
	Unit               string              `protobuf:"bytes,7,opt,name=Unit,json=unit" json:"Unit,omitempty"`
	Description        string              `protobuf:"bytes,8,opt,name=Description,json=description" json:"Description,omitempty"`
	// Types that are valid to be assigned to Data:
	//	*Metric_StringData
	//	*Metric_Float32Data
	//	*Metric_Float64Data
	//	*Metric_Int32Data
	//	*Metric_Int64Data
	//	*Metric_BytesData
	//	*Metric_BoolData
	Data isMetric_Data `protobuf_oneof:"data"`
}

core.Metric

func NewMetrics

func NewMetrics(ms []core.Metric) []*Metric

Convert a slice of core.Metrics to []*common.Metric protobuf messages

func RequestedToMetric

func RequestedToMetric(requested []core.RequestedMetric) []*Metric

func ToMetric

func ToMetric(co core.Metric) *Metric

Convert a core.Metric to common.Metric protobuf message

func (*Metric) Descriptor

func (*Metric) Descriptor() ([]byte, []int)

func (*Metric) GetBoolData

func (m *Metric) GetBoolData() bool

func (*Metric) GetBytesData

func (m *Metric) GetBytesData() []byte

func (*Metric) GetConfig

func (m *Metric) GetConfig() *ConfigMap

func (*Metric) GetData

func (m *Metric) GetData() isMetric_Data

func (*Metric) GetFloat32Data

func (m *Metric) GetFloat32Data() float32

func (*Metric) GetFloat64Data

func (m *Metric) GetFloat64Data() float64

func (*Metric) GetInt32Data

func (m *Metric) GetInt32Data() int32

func (*Metric) GetInt64Data

func (m *Metric) GetInt64Data() int64

func (*Metric) GetLastAdvertisedTime

func (m *Metric) GetLastAdvertisedTime() *Time

func (*Metric) GetNamespace

func (m *Metric) GetNamespace() []*NamespaceElement

func (*Metric) GetStringData

func (m *Metric) GetStringData() string

func (*Metric) GetTags

func (m *Metric) GetTags() map[string]string

func (*Metric) GetTimestamp

func (m *Metric) GetTimestamp() *Time

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) Reset

func (m *Metric) Reset()

func (*Metric) String

func (m *Metric) String() string

func (*Metric) XXX_OneofFuncs

func (*Metric) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type Metric_BoolData

type Metric_BoolData struct {
	BoolData bool `protobuf:"varint,15,opt,name=bool_data,json=boolData,oneof"`
}

type Metric_BytesData

type Metric_BytesData struct {
	BytesData []byte `protobuf:"bytes,14,opt,name=bytes_data,json=bytesData,proto3,oneof"`
}

type Metric_Float32Data

type Metric_Float32Data struct {
	Float32Data float32 `protobuf:"fixed32,10,opt,name=float32_data,json=float32Data,oneof"`
}

type Metric_Float64Data

type Metric_Float64Data struct {
	Float64Data float64 `protobuf:"fixed64,11,opt,name=float64_data,json=float64Data,oneof"`
}

type Metric_Int32Data

type Metric_Int32Data struct {
	Int32Data int32 `protobuf:"varint,12,opt,name=int32_data,json=int32Data,oneof"`
}

type Metric_Int64Data

type Metric_Int64Data struct {
	Int64Data int64 `protobuf:"varint,13,opt,name=int64_data,json=int64Data,oneof"`
}

type Metric_StringData

type Metric_StringData struct {
	StringData string `protobuf:"bytes,9,opt,name=string_data,json=stringData,oneof"`
}

type NamespaceElement

type NamespaceElement struct {
	Value       string `protobuf:"bytes,1,opt,name=Value,json=value" json:"Value,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=Description,json=description" json:"Description,omitempty"`
	Name        string `protobuf:"bytes,3,opt,name=Name,json=name" json:"Name,omitempty"`
}

func ToNamespace

func ToNamespace(n core.Namespace) []*NamespaceElement

Convert core.Namespace to common.Namespace protobuf message

func (*NamespaceElement) Descriptor

func (*NamespaceElement) Descriptor() ([]byte, []int)

func (*NamespaceElement) ProtoMessage

func (*NamespaceElement) ProtoMessage()

func (*NamespaceElement) Reset

func (m *NamespaceElement) Reset()

func (*NamespaceElement) String

func (m *NamespaceElement) String() string

type Plugin

type Plugin struct {
	TypeName string `protobuf:"bytes,1,opt,name=TypeName,json=typeName" json:"TypeName,omitempty"`
	Name     string `protobuf:"bytes,2,opt,name=Name,json=name" json:"Name,omitempty"`
	Version  int64  `protobuf:"varint,3,opt,name=Version,json=version" json:"Version,omitempty"`
}

core.Plugin

func ToCorePluginMsg

func ToCorePluginMsg(pl core.Plugin) *Plugin

Convert from core.Plugin to Plugin protobuf message

func ToCorePluginsMsg

func ToCorePluginsMsg(pls []core.Plugin) []*Plugin

Convert from Plugin protobuf message to core.Plugin

func (*Plugin) Descriptor

func (*Plugin) Descriptor() ([]byte, []int)

func (*Plugin) ProtoMessage

func (*Plugin) ProtoMessage()

func (*Plugin) Reset

func (m *Plugin) Reset()

func (*Plugin) String

func (m *Plugin) String() string

type SnapError

type SnapError struct {
	ErrorString string            `protobuf:"bytes,1,opt,name=error_string,json=errorString" json:"error_string,omitempty"`
	ErrorFields map[string]string `` /* 161-byte string literal not displayed */
}

func NewErrors

func NewErrors(errs []serror.SnapError) []*SnapError

Converts a group of SnapErrors to SnapError protobuf messages

func (*SnapError) Descriptor

func (*SnapError) Descriptor() ([]byte, []int)

func (*SnapError) GetErrorFields

func (m *SnapError) GetErrorFields() map[string]string

func (*SnapError) ProtoMessage

func (*SnapError) ProtoMessage()

func (*SnapError) Reset

func (m *SnapError) Reset()

func (*SnapError) String

func (m *SnapError) String() string

type SubPlugin

type SubPlugin struct {
	// contains filtered or unexported fields
}

implements core.SubscribedPlugin

func (SubPlugin) Config

func (sp SubPlugin) Config() *cdata.ConfigDataNode

func (SubPlugin) Name

func (sp SubPlugin) Name() string

func (SubPlugin) TypeName

func (sp SubPlugin) TypeName() string

func (SubPlugin) Version

func (sp SubPlugin) Version() int

type SubscribedPlugin

type SubscribedPlugin struct {
	TypeName string     `protobuf:"bytes,1,opt,name=TypeName,json=typeName" json:"TypeName,omitempty"`
	Name     string     `protobuf:"bytes,2,opt,name=Name,json=name" json:"Name,omitempty"`
	Version  int64      `protobuf:"varint,3,opt,name=Version,json=version" json:"Version,omitempty"`
	Config   *ConfigMap `protobuf:"bytes,4,opt,name=Config,json=config" json:"Config,omitempty"`
}

core.SubscribedPlugin

func ToSubPluginMsg

func ToSubPluginMsg(pl core.SubscribedPlugin) *SubscribedPlugin

Convert core.SubscribedPlugin to SubscribedPlugin protobuf message

func ToSubPluginsMsg

func ToSubPluginsMsg(sp []core.SubscribedPlugin) []*SubscribedPlugin

Converts core.SubscribedPlugins to protobuf messages

func (*SubscribedPlugin) Descriptor

func (*SubscribedPlugin) Descriptor() ([]byte, []int)

func (*SubscribedPlugin) GetConfig

func (m *SubscribedPlugin) GetConfig() *ConfigMap

func (*SubscribedPlugin) ProtoMessage

func (*SubscribedPlugin) ProtoMessage()

func (*SubscribedPlugin) Reset

func (m *SubscribedPlugin) Reset()

func (*SubscribedPlugin) String

func (m *SubscribedPlugin) String() string

type Time

type Time struct {
	Sec  int64 `protobuf:"varint,1,opt,name=sec" json:"sec,omitempty"`
	Nsec int64 `protobuf:"varint,2,opt,name=nsec" json:"nsec,omitempty"`
}

func ToTime

func ToTime(t time.Time) *Time

func (*Time) Descriptor

func (*Time) Descriptor() ([]byte, []int)

func (*Time) ProtoMessage

func (*Time) ProtoMessage()

func (*Time) Reset

func (m *Time) Reset()

func (*Time) String

func (m *Time) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL