tools

package
v0.0.0-...-1b5f0b1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2017 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const MetricForm string = "testMetric-"
View Source
const TagKeyForm string = "testTagKey-"
View Source
const TagValueForm string = "testTagValue-"

Variables

View Source
var Sleep2 = 5 * time.Second
View Source
var Sleep3 = 3 * time.Second

Functions

This section is empty.

Types

type CassandraSettings

type CassandraSettings struct {
	Keyspace       string
	Consistency    string
	Nodes          []string
	Username       string
	Password       string
	Connections    int
	Retry          int
	DiscoverHosts  bool
	DiscoverySleep int
	PageSize       int
	Timeout        string
	ProtoVersion   int
}

CassandraSettings abstracts the configuration of a cassandra cluster

type ElasticsearchSettings

type ElasticsearchSettings struct {
	Node    string
	Port    string
	Timeout time.Duration
}

ElasticsearchSettings abstracts the configuration of an Elastic Search cluster

type Error

type Error struct {
	Error   string `json:"error,omitempty"`
	Message string `json:"message,omitempty"`
}

type EsPost

type EsPost struct {
	Hits TagValuePostHits `json:"hits"`
}

type Headers

type Headers struct {
	User   *User
	Header map[string]string
	Cookie *bytes.Buffer
}

type Keyspace

type Keyspace struct {
	ID                string `json:"key,omitempty"`
	Name              string `json:"name,omitempty"`
	Datacenter        string `json:"datacenter,omitempty"`
	ReplicationFactor int    `json:"replicationFactor,omitempty"`
	Contact           string `json:"contact,omitempty"`
	TTL               int    `json:"ttl,omitempty"`
	TUUID             bool   `json:"tuuid,omitempty"`
}

func (Keyspace) Marshal

func (k Keyspace) Marshal() []byte

type KeyspaceAttributes

type KeyspaceAttributes struct {
	Name                    string
	Replication_factor      int
	Datacenter              string
	Ks_ttl                  int
	Ks_tuuid                bool
	Contact                 string
	Replication_factor_meta string
}

type KeyspaceEdit

type KeyspaceEdit struct {
	Name    string
	Contact string
}

func (KeyspaceEdit) Marshal

func (ke KeyspaceEdit) Marshal() []byte

type KeyspaceProperties

type KeyspaceProperties struct {
	Keyspace_name  string
	Durable_writes bool
	Replication    map[string]string
}

type KeyspaceResp

type KeyspaceResp struct {
	KSID string `json:"ksid"`
}

type Meta

type Meta struct {
	ID     string     `json:"_id"`
	Source Metasource `json:"_source"`
	Found  bool
}

type Metasource

type Metasource struct {
	ID     string    `json:"id"`
	Metric string    `json:"metric"`
	Tags   []TagMeta `json:"tagsNested"`
}

type Metric

type Metric struct {
	ID     string  `json:"_id"`
	Source Msource `json:"_source"`
	Found  bool
}

type MsgV2

type MsgV2 struct {
	Value     float32           `json:"value,omitempty"`
	Text      string            `json:"text,omitempty"`
	Metric    string            `json:"metric,omitempty"`
	Tags      map[string]string `json:"tags,omitempty"`
	Timestamp int64             `json:"timestamp,omitempty"`
}

type Msource

type Msource struct {
	Metric string `json:"metric"`
}

type MycenaePoints

type MycenaePoints struct {
	Payload map[string]respPoints `json:"payload"`
}

type MycenaePointsText

type MycenaePointsText struct {
	Payload map[string]respPointsText `json:"payload"`
}

type MycenaeSettings

type MycenaeSettings struct {
	Node    string
	Port    string
	Timeout time.Duration
}

type PayPoints

type PayPoints struct {
	Count int             `json:"count"`
	Total int             `json:"total"`
	Ts    [][]interface{} `json:"ts"`
}

type Payload

type Payload struct {
	Value     *float32          `json:"value,omitempty"`
	Text      *string           `json:"text,omitempty"`
	Metric    string            `json:"metric"`
	Tags      map[string]string `json:"tags"`
	TagKey    string            `json:"-"`
	TagValue  string            `json:"-"`
	TagKey2   string            `json:"-"`
	TagValue2 string            `json:"-"`
	Timestamp *int64            `json:"timestamp,omitempty"`
	Random    int               `json:"-"`
}

func (Payload) Marshal

func (p Payload) Marshal() []byte

func (Payload) StringArray

func (p Payload) StringArray() string

type PayloadSlice

type PayloadSlice struct {
	PS []Payload
}

func (PayloadSlice) Marshal

func (p PayloadSlice) Marshal() []byte

type Point

type Point struct {
	Value     float32           `json:"value"`
	Metric    string            `json:"metric"`
	Tags      map[string]string `json:"tags"`
	Timestamp int64             `json:"timestamp"`
}

type ResponseMeta

type ResponseMeta struct {
	TotalRecord int      `json:"totalRecords"`
	Payload     []TsMeta `json:"payload"`
}

type ResponseMetricTags

type ResponseMetricTags struct {
	TotalRecords int      `json:"totalRecords,omitempty"`
	Payload      []string `json:"payload,omitempty"`
}

type ResponseQuery

type ResponseQuery struct {
	Metric  string                 `json:"metric"`
	Tags    map[string]string      `json:"tags"`
	AggTags []string               `json:"aggregateTags"`
	Tsuuids []string               `json:"tsuids"`
	Dps     map[string]interface{} `json:"dps"`
	Query   *structs.TSDBquery     `json:"query,omitempty"`
}

type RestError

type RestError struct {
	Datapoint *MsgV2 `json:"datapoint"`
	Error     string `json:"error"`
}

type RestErrors

type RestErrors struct {
	Errors  []RestError `json:"errors"`
	Failed  int         `json:"failed"`
	Success int         `json:"success"`
}

type TKsource

type TKsource struct {
	Key string `json:"key"`
}

type TSDBfilter

type TSDBfilter struct {
	Ftype   string `json:"type"`
	Tagk    string `json:"tagk"`
	Filter  string `json:"filter"`
	GroupBy bool   `json:"groupBy"`
}

type TSDBquery

type TSDBquery struct {
	Aggregator  string            `json:"aggregator"`
	Downsample  string            `json:"downsample"`
	Metric      string            `json:"metric"`
	Tags        map[string]string `json:"tags"`
	Rate        bool              `json:"rate"`
	RateOptions TSDBrateOptions   `json:"rateOptions"`
	Order       []string          `json:"order"`
	FilterValue string            `json:"filterValue"`
	Filters     []TSDBfilter      `json:"filters"`
}

type TSDBqueryPayload

type TSDBqueryPayload struct {
	Relative string      `json:"relative"`
	Queries  []TSDBquery `json:"queries"`
}

type TSDBrateOptions

type TSDBrateOptions struct {
	Counter    bool   `json:"counter"`
	CounterMax *int64 `json:"counterMax"`
	ResetValue int64  `json:"resetValue"`
}

type TVsource

type TVsource struct {
	Value string `json:"value"`
}

type TableProperties

type TableProperties struct {
	Bloom_filter_fp_chance      float64
	Caching                     map[string]string
	Comment                     string
	Compaction                  map[string]string
	Compression                 map[string]string
	Dclocal_read_repair_chance  float64
	Default_time_to_live        int
	Gc_grace_seconds            int
	Max_index_interval          int
	Memtable_flush_period_in_ms int
	Min_index_interval          int
	Read_repair_chance          float64
	Speculative_retry           string
}

type TagKey

type TagKey struct {
	ID     string   `json:"_id"`
	Source TKsource `json:"_source"`
	Found  bool
}

type TagMeta

type TagMeta struct {
	TagKey   string `json:"tagKey"`
	TagValue string `json:"tagValue"`
}

type TagValue

type TagValue struct {
	ID     string   `json:"_id"`
	Source TVsource `json:"_source"`
	Found  bool
}

type TagValuePostHits

type TagValuePostHits struct {
	Total int `json:"total"`
}

type TextPoint

type TextPoint struct {
	Text      string            `json:"text"`
	Metric    string            `json:"metric"`
	Tags      map[string]string `json:"tags"`
	Timestamp int64             `json:"timestamp"`
}

type Tool

type Tool struct {
	Cassandra     *cassTool
	ElasticSearch *esTool
	HTTP          *httpTool
	UDP           *udpTool
	Mycenae       *mycenaeTool
}

Tool is the main structure to be created from this package

func (*Tool) InitCass

func (t *Tool) InitCass(cassSet CassandraSettings)

InitCass initializes the cassandra session

func (*Tool) InitEs

func (t *Tool) InitEs(esSet ElasticsearchSettings)

InitEs initializes the Elastic Search connection

func (*Tool) InitHTTP

func (t *Tool) InitHTTP(hostname string, port string, timeout time.Duration)

InitHTTP initializes the http toolkit

func (*Tool) InitMycenae

func (t *Tool) InitMycenae(mSet MycenaeSettings)

InitMycenae initializes the Mycenae connection

func (*Tool) InitUDP

func (t *Tool) InitUDP(hostname string, port string)

InitUDP initializes the UDP toolkit

type TsError

type TsError struct {
	ID      string
	Error   string
	Message string
	Date    time.Time
}

type TsErrorV2

type TsErrorV2 struct {
	Metric string
	Tags   []TsTagV2 `json:"tagsError"`
}

type TsMeta

type TsMeta struct {
	TsID   string            `json:"id"`
	Metric string            `json:"metric,omitempty"`
	Tags   map[string]string `json:"tags,omitempty"`
}

type TsTagV2

type TsTagV2 struct {
	TagKey   string
	TagValue string
}

type User

type User struct {
	Name     string
	PassWord string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL