Documentation
¶
Overview ¶
Package gstashs defines multiple back-end service used to persistent store iam analytics data.
Index ¶
- Constants
- type APIKeyTransport
- type BaseMongoConf
- type CSVConf
- type CSVGstash
- type CommonGstashConfig
- func (p *CommonGstashConfig) GetFilters() analytics.AnalyticsFilters
- func (p *CommonGstashConfig) GetOmitDetailedRecording() bool
- func (p *CommonGstashConfig) GetTimeout() int
- func (p *CommonGstashConfig) SetFilters(filters analytics.AnalyticsFilters)
- func (p *CommonGstashConfig) SetOmitDetailedRecording(omitDetailedRecording bool)
- func (p *CommonGstashConfig) SetTimeout(timeout int)
- type DummyGstash
- type Elasticsearch7Operator
- type ElasticsearchBulkConfig
- type ElasticsearchConf
- type ElasticsearchGstash
- type ElasticsearchOperator
- type Gstash
- type KafkaConf
- type KafkaGstash
- type Message
- type MongoConf
- type MongoGstash
- type MongoType
- type PrometheusConf
- type PrometheusGstash
- type SyslogConf
- type SyslogGstash
- func (s *SyslogGstash) GetFilters() analytics.AnalyticsFilters
- func (s *SyslogGstash) GetName() string
- func (s *SyslogGstash) GetTimeout() int
- func (s *SyslogGstash) Init(config interface{}) error
- func (s *SyslogGstash) New() Gstash
- func (s *SyslogGstash) SetFilters(filters analytics.AnalyticsFilters)
- func (s *SyslogGstash) SetTimeout(timeout int)
- func (s *SyslogGstash) WriteData(ctx context.Context, data []interface{}) error
Constants ¶
const ( KiB = 1 << (10 * iota) MiB GiB TiB )
Define unit constant.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyTransport ¶
APIKeyTransport defiens elasticsearch api key.
type BaseMongoConf ¶
type BaseMongoConf struct { MongoURL string `json:"mongo_url" mapstructure:"mongo_url"` MongoUseSSL bool `json:"mongo_use_ssl" mapstructure:"mongo_use_ssl"` MongoSSLInsecureSkipVerify bool `json:"mongo_ssl_insecure_skip_verify" mapstructure:"mongo_ssl_insecure_skip_verify"` MongoSSLAllowInvalidHostnames bool `json:"mongo_ssl_allow_invalid_hostnames" mapstructure:"mongo_ssl_allow_invalid_hostnames"` MongoSSLCAFile string `json:"mongo_ssl_ca_file" mapstructure:"mongo_ssl_ca_file"` MongoSSLPEMKeyfile string `json:"mongo_ssl_pem_keyfile" mapstructure:"mongo_ssl_pem_keyfile"` MongoDBType MongoType `json:"mongo_db_type" mapstructure:"mongo_db_type"` }
BaseMongoConf defines options needed when connnect to mongo db.
type CSVConf ¶
type CSVConf struct { // Specify the directory used to store automatically generated csv file which contains analyzed data. CSVDir string `mapstructure:"csv_dir"` }
CSVConf defines csv specific options.
type CSVGstash ¶
type CSVGstash struct { CommonGstashConfig // contains filtered or unexported fields }
CSVGstash defines a csv gstash with csv specific options and common options.
type CommonGstashConfig ¶
type CommonGstashConfig struct { OmitDetailedRecording bool // contains filtered or unexported fields }
CommonGstashConfig defines common options used by all persistent store, like elasticsearch, kafka, mongo and etc.
func (*CommonGstashConfig) GetFilters ¶
func (p *CommonGstashConfig) GetFilters() analytics.AnalyticsFilters
GetFilters get attributes `filters` for CommonGstashConfig.
func (*CommonGstashConfig) GetOmitDetailedRecording ¶
func (p *CommonGstashConfig) GetOmitDetailedRecording() bool
GetOmitDetailedRecording get attributes `OmitDetailedRecording` for CommonGstashConfig.
func (*CommonGstashConfig) GetTimeout ¶
func (p *CommonGstashConfig) GetTimeout() int
GetTimeout get attributes `timeout` for CommonGstashConfig.
func (*CommonGstashConfig) SetFilters ¶
func (p *CommonGstashConfig) SetFilters(filters analytics.AnalyticsFilters)
SetFilters set attributes `filters` for CommonGstashConfig.
func (*CommonGstashConfig) SetOmitDetailedRecording ¶
func (p *CommonGstashConfig) SetOmitDetailedRecording(omitDetailedRecording bool)
SetOmitDetailedRecording set attributes `OmitDetailedRecording` for CommonGstashConfig.
func (*CommonGstashConfig) SetTimeout ¶
func (p *CommonGstashConfig) SetTimeout(timeout int)
SetTimeout set attributes `timeout` for CommonGstashConfig.
type DummyGstash ¶
type DummyGstash struct {
CommonGstashConfig
}
DummyGstash defines a dummy gstash with dummy specific options and common options.
func (*DummyGstash) GetName ¶
func (p *DummyGstash) GetName() string
GetName returns the dummy gstash name.
func (*DummyGstash) Init ¶
func (p *DummyGstash) Init(conf interface{}) error
Init initialize the dummy gstash instance.
type Elasticsearch7Operator ¶
type Elasticsearch7Operator struct {
// contains filtered or unexported fields
}
Elasticsearch7Operator defines elasticsearch6 operator.
type ElasticsearchBulkConfig ¶
type ElasticsearchBulkConfig struct { Workers int `mapstructure:"workers"` FlushInterval int `mapstructure:"flush_interval"` BulkActions int `mapstructure:"bulk_actions"` BulkSize int `mapstructure:"bulk_size"` }
ElasticsearchBulkConfig defines elasticsearch bulk config.
type ElasticsearchConf ¶
type ElasticsearchConf struct { BulkConfig ElasticsearchBulkConfig `mapstructure:"bulk_config"` IndexName string `mapstructure:"index_name"` ElasticsearchURL string `mapstructure:"elasticsearch_url"` DocumentType string `mapstructure:"document_type"` AuthAPIKeyID string `mapstructure:"auth_api_key_id"` AuthAPIKey string `mapstructure:"auth_api_key"` Username string `mapstructure:"auth_basic_username"` Password string `mapstructure:"auth_basic_password"` EnableSniffing bool `mapstructure:"use_sniffing"` RollingIndex bool `mapstructure:"rolling_index"` DisableBulk bool `mapstructure:"disable_bulk"` }
ElasticsearchConf defines elasticsearch specific options.
type ElasticsearchGstash ¶
type ElasticsearchGstash struct { CommonGstashConfig // contains filtered or unexported fields }
ElasticsearchGstash defines a elasticsearch gstash with elasticsearch specific options and common options.
func (*ElasticsearchGstash) GetName ¶
func (e *ElasticsearchGstash) GetName() string
GetName returns the elasticsearch gstash name.
func (*ElasticsearchGstash) Init ¶
func (e *ElasticsearchGstash) Init(config interface{}) error
Init initialize the elasticsearch gstash instance.
func (*ElasticsearchGstash) New ¶
func (e *ElasticsearchGstash) New() Gstash
New create a elasticsearch gstash instance.
type ElasticsearchOperator ¶
type ElasticsearchOperator interface {
// contains filtered or unexported methods
}
ElasticsearchOperator defines interface for all elasticsearch operator.
type Gstash ¶
type Gstash interface { GetName() string New() Gstash Init(interface{}) error WriteData(context.Context, []interface{}) error SetFilters(analytics.AnalyticsFilters) GetFilters() analytics.AnalyticsFilters SetTimeout(timeout int) GetTimeout() int SetOmitDetailedRecording(bool) GetOmitDetailedRecording() bool }
Gstash defines the interface for all analytics back-end.
func GetGstashByName ¶
GetGstashByName returns the gstash instance by given name.
type KafkaConf ¶
type KafkaConf struct { Broker []string `mapstructure:"broker"` ClientID string `mapstructure:"client_id"` Topic string `mapstructure:"topic"` SSLCertFile string `mapstructure:"ssl_cert_file"` SSLKeyFile string `mapstructure:"ssl_key_file"` SASLMechanism string `mapstructure:"sasl_mechanism"` Username string `mapstructure:"sasl_username"` Password string `mapstructure:"sasl_password"` Algorithm string `mapstructure:"sasl_algorithm"` Timeout time.Duration `mapstructure:"timeout"` MetaData map[string]string `mapstructure:"meta_data"` Compressed bool `mapstructure:"compressed"` UseSSL bool `mapstructure:"use_ssl"` SSLInsecureSkipVerify bool `mapstructure:"ssl_insecure_skip_verify"` }
KafkaConf defines kafka specific options.
type KafkaGstash ¶
type KafkaGstash struct { CommonGstashConfig // contains filtered or unexported fields }
KafkaGstash defines a kafka gstash with kafka specific options and common options.
func (*KafkaGstash) GetName ¶
func (k *KafkaGstash) GetName() string
GetName returns the kafka gstash name.
func (*KafkaGstash) Init ¶
func (k *KafkaGstash) Init(config interface{}) error
Init initialize the kafka gstash instance.
type Message ¶
type Message map[string]interface{}
Message contains the messages need to push to gstash.
type MongoConf ¶
type MongoConf struct { BaseMongoConf CollectionName string `json:"collection_name" mapstructure:"collection_name"` MaxInsertBatchSizeBytes int `json:"max_insert_batch_size_bytes" mapstructure:"max_insert_batch_size_bytes"` MaxDocumentSizeBytes int `json:"max_document_size_bytes" mapstructure:"max_document_size_bytes"` CollectionCapMaxSizeBytes int `json:"collection_cap_max_size_bytes" mapstructure:"collection_cap_max_size_bytes"` CollectionCapEnable bool `json:"collection_cap_enable" mapstructure:"collection_cap_enable"` }
MongoConf defines mongo specific options.
type MongoGstash ¶
type MongoGstash struct { CommonGstashConfig // contains filtered or unexported fields }
MongoGstash defines a mongo gstash with mongo specific options and common options.
func (*MongoGstash) AccumulateSet ¶
func (m *MongoGstash) AccumulateSet(data []interface{}) [][]interface{}
AccumulateSet accumulate data.
func (*MongoGstash) GetName ¶
func (m *MongoGstash) GetName() string
GetName returns the mongo gstash name.
func (*MongoGstash) Init ¶
func (m *MongoGstash) Init(config interface{}) error
Init initialize the mongo gstash instance.
type PrometheusConf ¶
type PrometheusConf struct { Addr string `mapstructure:"listen_address"` Path string `mapstructure:"path"` }
PrometheusConf defines prometheus specific options.
type PrometheusGstash ¶
type PrometheusGstash struct { // Per service TotalStatusMetrics *prometheus.CounterVec CommonGstashConfig // contains filtered or unexported fields }
PrometheusGstash defines a prometheus gstash with prometheus specific options and common options.
func (*PrometheusGstash) GetName ¶
func (p *PrometheusGstash) GetName() string
GetName returns the prometheus gstash name.
func (*PrometheusGstash) Init ¶
func (p *PrometheusGstash) Init(conf interface{}) error
Init initialize the prometheus gstash instance.
func (*PrometheusGstash) New ¶
func (p *PrometheusGstash) New() Gstash
New create a prometheus gstash instance.
type SyslogConf ¶
type SyslogConf struct { Transport string `mapstructure:"transport"` NetworkAddr string `mapstructure:"network_addr"` LogLevel int `mapstructure:"log_level"` Tag string `mapstructure:"tag"` }
SyslogConf defines syslog specific options.
type SyslogGstash ¶
type SyslogGstash struct { CommonGstashConfig // contains filtered or unexported fields }
SyslogGstash defines a syslog gstash with syslog specific options and common options.
func (*SyslogGstash) GetFilters ¶
func (s *SyslogGstash) GetFilters() analytics.AnalyticsFilters
GetFilters get attributes `filters` for SyslogGstash.
func (*SyslogGstash) GetName ¶
func (s *SyslogGstash) GetName() string
GetName returns the syslog gstash name.
func (*SyslogGstash) GetTimeout ¶
func (s *SyslogGstash) GetTimeout() int
GetTimeout get attributes `timeout` for SyslogGstash.
func (*SyslogGstash) Init ¶
func (s *SyslogGstash) Init(config interface{}) error
Init initialize the syslog gstash instance.
func (*SyslogGstash) SetFilters ¶
func (s *SyslogGstash) SetFilters(filters analytics.AnalyticsFilters)
SetFilters set attributes `filters` for SyslogGstash.
func (*SyslogGstash) SetTimeout ¶
func (s *SyslogGstash) SetTimeout(timeout int)
SetTimeout set attributes `timeout` for SyslogGstash.