notify

package
v0.0.0-...-fa273ca Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HelpAMQP = config.HelpKV{
		config.State:            "(Required) Is this server endpoint configuration active/enabled",
		config.Comment:          "A comment to describe the AMQP target setting",
		target.AmqpURL:          "(Required) AMQP server endpoint, e.g. `amqp://myuser:mypassword@localhost:5672`",
		target.AmqpExchange:     "Name of the AMQP exchange",
		target.AmqpExchangeType: "Kind of AMQP exchange type",
		target.AmqpRoutingKey:   "Routing key for publishing",
		target.AmqpMandatory:    "Set this to 'on' for server to return an unroutable message with a Return method. If this flag is 'off', the server silently drops the message",
		target.AmqpDurable:      "Set this to 'on' for queue to surive broker restarts",
		target.AmqpNoWait:       "When no_wait is 'on', declare without waiting for a confirmation from the server",
		target.AmqpInternal:     "Set this to 'on' for exchange to be not used directly by publishers, but only when bound to other exchanges",
		target.AmqpAutoDeleted:  "Set this to 'on' for queue that has had at least one consumer is deleted when last consumer unsubscribes",
		target.AmqpDeliveryMode: "Delivery queue implementation use non-persistent (1) or persistent (2)",
		target.AmqpQueueLimit:   "Enable persistent event store queue limit, defaults to '10000'",
		target.AmqpQueueDir:     "Local directory where events are stored eg: '/home/events'",
	}

	HelpKafka = config.HelpKV{
		config.State:              "(Required) Is this server endpoint configuration active/enabled",
		config.Comment:            "A comment to describe the Kafka target setting",
		target.KafkaTopic:         "The Kafka topic for a given message",
		target.KafkaBrokers:       "Command separated list of Kafka broker addresses",
		target.KafkaSASLUsername:  "Username for SASL/PLAIN  or SASL/SCRAM authentication",
		target.KafkaSASLPassword:  "Password for SASL/PLAIN  or SASL/SCRAM authentication",
		target.KafkaTLSClientAuth: "ClientAuth determines the Kafka server's policy for TLS client auth",
		target.KafkaSASL:          "Set this to 'on' to enable SASL authentication",
		target.KafkaTLS:           "Set this to 'on' to enable TLS",
		target.KafkaTLSSkipVerify: "Set this to 'on' to disable client verification of server certificate chain",
		target.KafkaQueueLimit:    "Enable persistent event store queue limit, defaults to '10000'",
		target.KafkaQueueDir:      "Local directory where events are stored eg: '/home/events'",
	}

	HelpMQTT = config.HelpKV{
		config.State:                 "(Required) Is this server endpoint configuration active/enabled",
		config.Comment:               "A comment to describe the MQTT target setting",
		target.MqttBroker:            "(Required) MQTT server endpoint, e.g. `tcp://localhost:1883`",
		target.MqttTopic:             "(Required) Name of the MQTT topic to publish on, e.g. `minio`",
		target.MqttUsername:          "Username to connect to the MQTT server (if required)",
		target.MqttPassword:          "Password to connect to the MQTT server (if required)",
		target.MqttQoS:               "Set the Quality of Service Level for MQTT endpoint",
		target.MqttKeepAliveInterval: "Optional keep alive interval for MQTT connections",
		target.MqttReconnectInterval: "Optional reconnect interval for MQTT connections",
		target.MqttQueueDir:          "Local directory where events are stored eg: '/home/events'",
		target.MqttQueueLimit:        "Enable persistent event store queue limit, defaults to '10000'",
	}

	HelpES = config.HelpKV{
		config.State:             "(Required) Is this server endpoint configuration active/enabled",
		config.Comment:           "A comment to describe the Elasticsearch target setting",
		target.ElasticURL:        "(Required) The Elasticsearch server's address, with optional authentication info",
		target.ElasticFormat:     "(Required) Either `namespace` or `access`, defaults to 'namespace'",
		target.ElasticIndex:      "(Required) The name of an Elasticsearch index in which MinIO will store document",
		target.ElasticQueueDir:   "Local directory where events are stored eg: '/home/events'",
		target.ElasticQueueLimit: "Enable persistent event store queue limit, defaults to '10000'",
	}

	HelpWebhook = config.HelpKV{
		config.State:             "(Required) Is this server endpoint configuration active/enabled",
		config.Comment:           "A comment to describe the Webhook target setting",
		target.WebhookEndpoint:   "Webhook server endpoint eg: http://localhost:8080/minio/events",
		target.WebhookAuthToken:  "Authorization token used for webhook server endpoint (optional)",
		target.WebhookQueueLimit: "Enable persistent event store queue limit, defaults to '10000'",
		target.WebhookQueueDir:   "Local directory where events are stored eg: '/home/events'",
	}

	HelpRedis = config.HelpKV{
		config.State:           "(Required) Is this server endpoint configuration active/enabled",
		config.Comment:         "A comment to describe the Redis target setting",
		target.RedisFormat:     "Specify how data is populated, a hash is used in case of `namespace` format and a list in case of `access` format, defaults to 'namespace'",
		target.RedisAddress:    "(Required) The Redis server's address. For example: `localhost:6379`",
		target.RedisKey:        "The name of the redis key under which events are stored",
		target.RedisPassword:   "(Optional) The Redis server's password",
		target.RedisQueueDir:   "Local directory where events are stored eg: '/home/events'",
		target.RedisQueueLimit: "Enable persistent event store queue limit, defaults to '10000'",
	}

	HelpPostgres = config.HelpKV{
		config.State:                    "(Required) Is this server endpoint configuration active/enabled",
		config.Comment:                  "A comment to describe the Postgres target setting",
		target.PostgresFormat:           "Specify how data is populated, `namespace` format and `access` format, defaults to 'namespace'",
		target.PostgresConnectionString: "Connection string parameters for the PostgreSQL server",
		target.PostgresTable:            "(Required) Table name in which events will be stored/updated. If the table does not exist, the MinIO server creates it at start-up",
		target.PostgresHost:             "(Optional) Host name of the PostgreSQL server. Defaults to `localhost`. IPv6 host should be enclosed with `[` and `]`",
		target.PostgresPort:             "(Optional) Port on which to connect to PostgreSQL server, defaults to `5432`",
		target.PostgresUsername:         "Database username, defaults to user running the MinIO process if not specified",
		target.PostgresPassword:         "Database password",
		target.PostgresDatabase:         "Database name",
		target.PostgresQueueDir:         "Local directory where events are stored eg: '/home/events'",
		target.PostgresQueueLimit:       "Enable persistent event store queue limit, defaults to '10000'",
	}

	HelpMySQL = config.HelpKV{
		config.State:           "(Required) Is this server endpoint configuration active/enabled",
		config.Comment:         "A comment to describe the MySQL target setting",
		target.MySQLFormat:     "Specify how data is populated, `namespace` format and `access` format, defaults to 'namespace'",
		target.MySQLHost:       "Host name of the MySQL server (used only if `dsnString` is empty)",
		target.MySQLPort:       "Port on which to connect to the MySQL server (used only if `dsn_string` is empty)",
		target.MySQLUsername:   "Database user-name (used only if `dsnString` is empty)",
		target.MySQLPassword:   "Database password (used only if `dsnString` is empty)",
		target.MySQLDatabase:   "Database name (used only if `dsnString` is empty)",
		target.MySQLDSNString:  "Data-Source-Name connection string for the MySQL server",
		target.MySQLTable:      "(Required) Table name in which events will be stored/updated. If the table does not exist, the MinIO server creates it at start-up",
		target.MySQLQueueLimit: "Enable persistent event store queue limit, defaults to '10000'",
		target.MySQLQueueDir:   "Local directory where events are stored eg: '/home/events'",
	}

	HelpNATS = config.HelpKV{
		config.State:                           "(Required) Is this server endpoint configuration active/enabled",
		config.Comment:                         "A comment to describe the NATS target setting",
		target.NATSAddress:                     "NATS server address eg: '0.0.0.0:4222'",
		target.NATSSubject:                     "NATS subject that represents this subscription",
		target.NATSUsername:                    "Username to be used when connecting to the server",
		target.NATSPassword:                    "Password to be used when connecting to a server",
		target.NATSToken:                       "Token to be used when connecting to a server",
		target.NATSSecure:                      "Set this to 'on', enables TLS secure connections that skip server verification (not recommended)",
		target.NATSPingInterval:                "Client ping commands interval to the server, disabled by default",
		target.NATSStreaming:                   "Set this to 'on', to use streaming NATS server",
		target.NATSStreamingAsync:              "Set this to 'on', to enable asynchronous publish, process the ACK or error state",
		target.NATSStreamingMaxPubAcksInFlight: "Specifies how many messages can be published without getting ACKs back from NATS streaming server",
		target.NATSStreamingClusterID:          "Unique ID for the NATS streaming cluster",
		target.NATSQueueLimit:                  "Enable persistent event store queue limit, defaults to '10000'",
		target.NATSQueueDir:                    "Local directory where events are stored eg: '/home/events'",
		target.NATSCertAuthority:               "Certificate chain of the target NATS server if self signed certs were used",
		target.NATSClientCert:                  "TLS Cert used to authenticate against NATS configured to require client certificates",
		target.NATSClientKey:                   "TLS Key used to authenticate against NATS configured to require client certificates",
	}

	HelpNSQ = config.HelpKV{
		config.State:            "(Required) Is this server endpoint configuration active/enabled",
		config.Comment:          "A comment to describe the NSQ target setting",
		target.NSQAddress:       "NSQ server address eg: '127.0.0.1:4150'",
		target.NSQTopic:         "NSQ topic unique per target",
		target.NSQTLS:           "Set this to 'on', to enable TLS negotiation",
		target.NSQTLSSkipVerify: "Set this to 'on', to disable client verification of server certificates",
		target.NSQQueueLimit:    "Enable persistent event store queue limit, defaults to '10000'",
		target.NSQQueueDir:      "Local directory where events are stored eg: '/home/events'",
	}
)

Help template inputs for all notification targets

DefaultAMQPKVS - default KV for AMQP config

View Source
var (
	DefaultESKVS = config.KVS{
		config.State:             config.StateOff,
		config.Comment:           "Default settings for Elasticsearch notification",
		target.ElasticURL:        "",
		target.ElasticFormat:     formatNamespace,
		target.ElasticIndex:      "",
		target.ElasticQueueDir:   "",
		target.ElasticQueueLimit: "0",
	}
)

DefaultESKVS - default KV config for Elasticsearch target

DefaultKakfaKVS - default KV for kafka target

DefaultMQTTKVS - default MQTT config

View Source
var (
	DefaultMySQLKVS = config.KVS{
		config.State:           config.StateOff,
		config.Comment:         "Default settings for MySQL notification",
		target.MySQLFormat:     formatNamespace,
		target.MySQLHost:       "",
		target.MySQLPort:       "",
		target.MySQLUsername:   "",
		target.MySQLPassword:   "",
		target.MySQLDatabase:   "",
		target.MySQLDSNString:  "",
		target.MySQLTable:      "",
		target.MySQLQueueLimit: "0",
		target.MySQLQueueDir:   "",
	}
)

DefaultMySQLKVS - default KV for MySQL

DefaultNATSKVS - NATS KV for nats config.

DefaultNSQKVS - NSQ KV for config

DefaultNotificationKVS - default notification list of kvs.

DefaultPostgresKVS - default Postgres KV for server config.

View Source
var (
	DefaultRedisKVS = config.KVS{
		config.State:           config.StateOff,
		config.Comment:         "Default settings for Redis notification",
		target.RedisFormat:     formatNamespace,
		target.RedisAddress:    "",
		target.RedisKey:        "",
		target.RedisPassword:   "",
		target.RedisQueueDir:   "",
		target.RedisQueueLimit: "0",
	}
)

DefaultRedisKVS - default KV for redis config

View Source
var (
	DefaultWebhookKVS = config.KVS{
		config.State:             config.StateOff,
		config.Comment:           "Default settings for Webhook notification",
		target.WebhookEndpoint:   "",
		target.WebhookAuthToken:  "",
		target.WebhookQueueLimit: "0",
		target.WebhookQueueDir:   "",
	}
)

DefaultWebhookKVS - default KV for webhook config

Functions

func GetNotificationTargets

func GetNotificationTargets(cfg config.Config, doneCh <-chan struct{}, rootCAs *x509.CertPool) (*event.TargetList, error)

GetNotificationTargets registers and initializes all notification targets, returns error if any.

func GetNotifyAMQP

func GetNotifyAMQP(amqpKVS map[string]config.KVS) (map[string]target.AMQPArgs, error)

GetNotifyAMQP - returns a map of registered notification 'amqp' targets

func GetNotifyES

func GetNotifyES(esKVS map[string]config.KVS) (map[string]target.ElasticsearchArgs, error)

GetNotifyES - returns a map of registered notification 'elasticsearch' targets

func GetNotifyKafka

func GetNotifyKafka(kafkaKVS map[string]config.KVS) (map[string]target.KafkaArgs, error)

GetNotifyKafka - returns a map of registered notification 'kafka' targets

func GetNotifyMQTT

func GetNotifyMQTT(mqttKVS map[string]config.KVS, rootCAs *x509.CertPool) (map[string]target.MQTTArgs, error)

GetNotifyMQTT - returns a map of registered notification 'mqtt' targets

func GetNotifyMySQL

func GetNotifyMySQL(mysqlKVS map[string]config.KVS) (map[string]target.MySQLArgs, error)

GetNotifyMySQL - returns a map of registered notification 'mysql' targets

func GetNotifyNATS

func GetNotifyNATS(natsKVS map[string]config.KVS) (map[string]target.NATSArgs, error)

GetNotifyNATS - returns a map of registered notification 'nats' targets

func GetNotifyNSQ

func GetNotifyNSQ(nsqKVS map[string]config.KVS) (map[string]target.NSQArgs, error)

GetNotifyNSQ - returns a map of registered notification 'nsq' targets

func GetNotifyPostgres

func GetNotifyPostgres(postgresKVS map[string]config.KVS) (map[string]target.PostgreSQLArgs, error)

GetNotifyPostgres - returns a map of registered notification 'postgres' targets

func GetNotifyRedis

func GetNotifyRedis(redisKVS map[string]config.KVS) (map[string]target.RedisArgs, error)

GetNotifyRedis - returns a map of registered notification 'redis' targets

func GetNotifyWebhook

func GetNotifyWebhook(webhookKVS map[string]config.KVS, rootCAs *x509.CertPool) (map[string]target.WebhookArgs, error)

GetNotifyWebhook - returns a map of registered notification 'webhook' targets

func RegisterNotificationTargets

func RegisterNotificationTargets(cfg config.Config, doneCh <-chan struct{}, rootCAs *x509.CertPool, test bool) (*event.TargetList, error)

RegisterNotificationTargets - returns TargetList which contains enabled targets in serverConfig. A new notification target is added like below * Add a new target in pkg/event/target package. * Add newly added target configuration to serverConfig.Notify.<TARGET_NAME>. * Handle the configuration in this function to create/add into TargetList.

func SetNotifyAMQP

func SetNotifyAMQP(s config.Config, amqpName string, cfg target.AMQPArgs) error

SetNotifyAMQP - helper for config migration from older config.

func SetNotifyES

func SetNotifyES(s config.Config, esName string, cfg target.ElasticsearchArgs) error

SetNotifyES - helper for config migration from older config.

func SetNotifyKafka

func SetNotifyKafka(s config.Config, kName string, cfg target.KafkaArgs) error

SetNotifyKafka - helper for config migration from older config.

func SetNotifyMQTT

func SetNotifyMQTT(s config.Config, mqttName string, cfg target.MQTTArgs) error

SetNotifyMQTT - helper for config migration from older config.

func SetNotifyMySQL

func SetNotifyMySQL(s config.Config, sqlName string, cfg target.MySQLArgs) error

SetNotifyMySQL - helper for config migration from older config.

func SetNotifyNATS

func SetNotifyNATS(s config.Config, natsName string, cfg target.NATSArgs) error

SetNotifyNATS - helper for config migration from older config.

func SetNotifyNSQ

func SetNotifyNSQ(s config.Config, nsqName string, cfg target.NSQArgs) error

SetNotifyNSQ - helper for config migration from older config.

func SetNotifyPostgres

func SetNotifyPostgres(s config.Config, psqName string, cfg target.PostgreSQLArgs) error

SetNotifyPostgres - helper for config migration from older config.

func SetNotifyRedis

func SetNotifyRedis(s config.Config, redisName string, cfg target.RedisArgs) error

SetNotifyRedis - helper for config migration from older config.

func SetNotifyWebhook

func SetNotifyWebhook(s config.Config, whName string, cfg target.WebhookArgs) error

SetNotifyWebhook - helper for config migration from older config.

func TestNotificationTargets

func TestNotificationTargets(cfg config.Config, doneCh <-chan struct{}, rootCAs *x509.CertPool) error

TestNotificationTargets is similar to GetNotificationTargets() avoids explicit registration.

Types

type Config

type Config struct {
	AMQP          map[string]target.AMQPArgs          `json:"amqp"`
	Elasticsearch map[string]target.ElasticsearchArgs `json:"elasticsearch"`
	Kafka         map[string]target.KafkaArgs         `json:"kafka"`
	MQTT          map[string]target.MQTTArgs          `json:"mqtt"`
	MySQL         map[string]target.MySQLArgs         `json:"mysql"`
	NATS          map[string]target.NATSArgs          `json:"nats"`
	NSQ           map[string]target.NSQArgs           `json:"nsq"`
	PostgreSQL    map[string]target.PostgreSQLArgs    `json:"postgresql"`
	Redis         map[string]target.RedisArgs         `json:"redis"`
	Webhook       map[string]target.WebhookArgs       `json:"webhook"`
}

Config - notification target configuration structure, holds information about various notification targets.

func NewConfig

func NewConfig() Config

NewConfig - initialize notification config.

Jump to

Keyboard shortcuts

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