cli

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGRPCAddress         = "grpc-collector.batch.sh:9000"
	DefaultHTTPListenAddress   = ":8080"
	DefaultGRPCTimeout         = "10s"
	DefaultNumWorkers          = "10"
	DefaultStatsReportInterval = "5s"
	DefaultCount               = "10"
	DefaultDproxyAddress       = "dproxy.batch.sh:443"
)
View Source
const (
	DefaultKafkaConnectTimeout = "10s"
	DefaultKafkaGroupId        = "plumber"

	// Optimize for immediate output
	DefaultKafkaMaxWait          = "1s"
	DefaultKafkaMinBytes         = "1"
	DefaultKafkaMaxBytes         = "1"
	DefaultKafkaQueueCapacity    = "1"
	DefaultKafkaRebalanceTimeout = "0"

	// Optimize for throughput + reliability
	DefaultKafkaRelayMaxWait          = "5s"
	DefaultKafkaRelayMinBytes         = "1048576" // 1MB
	DefaultKafkaRelayMaxBytes         = "1048576" // 1MB
	DefaultKafkaRelayQueueCapacity    = "1000"
	DefaultKafkaRelayRebalanceTimeout = "5s"
	DefaultKafkaRelayCommitInterval   = "5s"
	DefaultKafkaReadOffset            = "0"
)
View Source
const (
	MQTTDefaultConnectTimeout = "5s"
	MQTTDefaultClientId       = "plumber"
)
View Source
const DefaultPulsarConnectTimeout = "10s"

Variables

This section is empty.

Functions

func HandleAWSSNSFlags added in v0.11.0

func HandleAWSSNSFlags(_, writeCmd, _ *kingpin.CmdClause, opts *Options)

func HandleAWSSQSFlags added in v0.3.0

func HandleAWSSQSFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleActiveMqFlags added in v0.8.0

func HandleActiveMqFlags(readCmd, writeCmd *kingpin.CmdClause, opts *Options)

func HandleAzureEventHubFlags added in v0.21.0

func HandleAzureEventHubFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleAzureFlags added in v0.11.0

func HandleAzureFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleBatchFlags added in v0.20.0

func HandleBatchFlags(batchCmd *kingpin.CmdClause, opts *Options)

func HandleCDCMongoFlags added in v0.22.0

func HandleCDCMongoFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleCDCPostgresFlags added in v0.22.0

func HandleCDCPostgresFlags(readCmd, _, relayCmd *kingpin.CmdClause, opts *Options)

func HandleDynamicFlags added in v0.28.0

func HandleDynamicFlags(dynamicCmd *kingpin.CmdClause, opts *Options)

func HandleGCPPubSubFlags

func HandleGCPPubSubFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleGlobalDynamicFlags added in v0.28.0

func HandleGlobalDynamicFlags(cmd *kingpin.CmdClause, opts *Options)

func HandleGlobalFlags added in v0.6.0

func HandleGlobalFlags(cmd *kingpin.CmdClause, opts *Options)

func HandleGlobalReadFlags added in v0.7.0

func HandleGlobalReadFlags(cmd *kingpin.CmdClause, opts *Options)

func HandleGlobalWriteFlags added in v0.7.0

func HandleGlobalWriteFlags(cmd *kingpin.CmdClause, opts *Options)

func HandleKafkaFlags

func HandleKafkaFlags(readCmd, writeCmd, relayCmd, lagCmd *kingpin.CmdClause, opts *Options)

func HandleKubeMQQueueFlags added in v0.34.1

func HandleKubeMQQueueFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleMQTTFlags added in v0.2.0

func HandleMQTTFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleNSQFlags added in v0.27.0

func HandleNSQFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

HandleNSQFlags creates NSQ commands and flags

func HandleNatsFlags added in v0.12.0

func HandleNatsFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleNatsStreamingFlags added in v0.21.0

func HandleNatsStreamingFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandlePulsarFlags added in v0.24.0

func HandlePulsarFlags(readCmd, writeCmd, _ *kingpin.CmdClause, opts *Options)

func HandleRabbitFlags

func HandleRabbitFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleRabbitStreamsFlags added in v0.33.0

func HandleRabbitStreamsFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleRedisPubSubFlags added in v0.18.0

func HandleRedisPubSubFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleRedisStreamsFlags added in v0.18.0

func HandleRedisStreamsFlags(readCmd, writeCmd, relayCmd *kingpin.CmdClause, opts *Options)

func HandleRelayFlags added in v0.4.0

func HandleRelayFlags(relayCmd *kingpin.CmdClause, opts *Options)

func ValidateProtobufOptions added in v0.5.0

func ValidateProtobufOptions(dirs []string, rootMessage string) error

Types

type AWSSNSOptions added in v0.11.0

type AWSSNSOptions struct {
	TopicArn string
}

type AWSSQSOptions added in v0.3.0

type AWSSQSOptions struct {
	// Shared
	QueueName       string
	RemoteAccountID string

	// Read
	ReadMaxNumMessages          int64
	ReadAutoDelete              bool
	ReadReceiveRequestAttemptId string
	ReadWaitTimeSeconds         int64

	// Write
	WriteDelaySeconds           int64
	WriteAttributes             map[string]string
	WriteMessageGroupID         string
	WriteMessageDeduplicationID string

	// Relay
	RelayMaxNumMessages          int64
	RelayReceiveRequestAttemptId string
	RelayAutoDelete              bool
	RelayWaitTimeSeconds         int64
}

type ActiveMqOptions added in v0.8.0

type ActiveMqOptions struct {
	// Shared
	Address  string
	Topic    string
	Queue    string
	ClientId string

	// Read
	ReadFollow bool
}

type AzureEventHubOptions added in v0.21.0

type AzureEventHubOptions struct {
	// Shared
	ConnectionString string

	// Write
	MessageID    string
	PartitionKey string
}

type AzureServiceBusOptions added in v0.11.0

type AzureServiceBusOptions struct {
	// Shared
	Queue            string
	ConnectionString string
	Topic            string

	// Read
	Subscription string
}

type BatchOptions added in v0.20.0

type BatchOptions struct {
	// Shared
	DestinationID string
	CollectionID  string
	ReplayID      string
	SchemaID      string
	Notes         string
	Query         string
	Page          int
	OutputType    string

	// Collection specific
	CollectionName string

	// Destination specific
	DestinationName     string
	DestinationType     string
	DestinationMetadata *DestinationMetadata

	// Replay Specific
	ReplayName string
	ReplayType string
	ReplayFrom string
	ReplayTo   string
}

type CDCMongoOptions added in v0.22.0

type CDCMongoOptions struct {
	DSN                 string
	Database            string
	Collection          string
	IncludeFullDocument bool
}

type CDCPostgresOptions added in v0.22.0

type CDCPostgresOptions struct {
	Host          string
	Port          uint16
	Username      string
	Password      string
	DatabaseName  string
	SlotName      string
	PublisherName string
	UseTLS        bool
	SkipVerifyTLS bool
}

type DestinationMetadata added in v0.20.0

type DestinationMetadata struct {
	KafkaTopic       string
	KafkaAddress     string
	KafkaUseTLS      bool
	KafkaInsecureTLS bool
	KafkaSASLType    string
	KafkaUsername    string
	KafkaPassword    string

	// HTTP specific
	HTTPURL     string
	HTTPHeaders map[string]string

	// AWS-SQS specific
	SQSQueue     string
	SQSAccountID string

	// RabbitMQ
	RabbitDSN                string
	RabbitExchangeName       string
	RabbitRoutingKey         string
	RabbitExchangeType       string
	RabbitExchangeDeclare    bool
	RabbitExchangeAutoDelete bool
	RabbitExchangeDurable    bool

	// KubeMQ Queue specific
	KubeMQQueueAddress     string
	KubeMQQueueQueue       string
	KubeMQQueueClientID    string
	KubeMQQueueTLSCertFile string
	KubeMQQueueAuthToken   string
}

type DynamicOptions added in v0.28.0

type DynamicOptions struct {
}

type GCPPubSubOptions

type GCPPubSubOptions struct {
	// Shared
	ProjectId       string
	CredentialsFile string
	CredentialsJSON string

	// Read
	ReadSubscriptionId []string
	ReadAck            bool

	// Write
	WriteTopicId string
}

type KafkaOptions

type KafkaOptions struct {
	// Shared
	Brokers            []string
	Topics             []string
	Timeout            time.Duration
	InsecureTLS        bool
	Username           string
	Password           string
	AuthenticationType string

	// Read
	UseConsumerGroup bool
	GroupID          string
	ReadOffset       int64 // If UseConsumerGroup is true, ReadOffset will NOT be used
	MaxWait          time.Duration
	MinBytes         int
	MaxBytes         int
	QueueCapacity    int
	RebalanceTimeout time.Duration
	CommitInterval   time.Duration

	// Write
	WriteKey    string
	WriteHeader map[string]string
}

type KubeMQQueueOptions added in v0.34.1

type KubeMQQueueOptions struct {
	// Shared
	Address  string
	Queue    string
	ClientID string

	// TLS
	TLSCertFile string

	// Authentication
	AuthToken string
}

type MQTTOptions added in v0.2.0

type MQTTOptions struct {
	// Shared
	Address  string
	Topic    string
	Timeout  time.Duration
	ClientID string
	QoSLevel int

	// TLS-related pieces
	TLSCAFile         string
	TLSClientCertFile string
	TLSClientKeyFile  string
	InsecureTLS       bool

	// Read
	ReadTimeout time.Duration

	// Write
	WriteTimeout time.Duration
}

type NSQOptions added in v0.27.0

type NSQOptions struct {
	// Shared
	Topic             string
	NSQDAddress       string
	AuthSecret        string
	ClientID          string
	UseTLS            bool
	InsecureTLS       bool
	TLSClientKeyFile  string
	TLSClientCertFile string
	TLSCAFile         string

	// Read
	NSQLookupDAddress string
	Channel           string
}

NSQOptions stores the values of CLI options for NSQ flags

type NatsOptions added in v0.12.0

type NatsOptions struct {
	// Shared
	Subject string
	Address string

	// TLS-related pieces
	TLSCAFile         string
	TLSClientCertFile string
	TLSClientKeyFile  string
	InsecureTLS       bool

	// Authentication
	CredsFile string
}

type NatsStreamingOptions added in v0.21.0

type NatsStreamingOptions struct {
	// Shared
	Channel   string
	Address   string
	ClusterID string
	ClientID  string

	// TLS-related pieces
	TLSCAFile         string
	TLSClientCertFile string
	TLSClientKeyFile  string
	InsecureTLS       bool

	// Authentication
	CredsFile string

	// Read
	DurableSubscription string
	ReadLastReceived    bool
	ReadSince           time.Duration
	ReadFromSequence    uint64
	AllAvailable        bool
}

type Options

type Options struct {
	// Global
	Debug               bool
	Quiet               bool
	Stats               bool
	StatsReportInterval time.Duration
	Action              string
	Version             string
	Backend             string

	// Serializers
	AvroSchemaFile string

	// Dynamic Destination
	DProxyAPIToken    string
	DProxyAddress     string
	DProxyInsecure    bool
	DproxyGRPCTimeout time.Duration

	// Relay
	RelayToken             string
	RelayGRPCAddress       string
	RelayType              string
	RelayHTTPListenAddress string
	RelayNumWorkers        int
	RelayGRPCTimeout       time.Duration
	RelayGRPCDisableTLS    bool
	RelayBatchSize         int

	// Shared read flags
	ReadProtobufRootMessage string
	ReadProtobufDirs        []string
	ReadFollow              bool
	ReadLag                 bool
	ReadConvert             string
	ReadJSONOutput          bool
	ReadThriftOutput        bool
	Verbose                 bool

	// Shared write flags
	WriteInputData           []string
	WriteInputFile           string
	WriteInputType           string
	WriteProtobufDirs        []string
	WriteProtobufRootMessage string
	WriteInputIsJsonArray    bool

	Kafka           *KafkaOptions
	Rabbit          *RabbitOptions
	RabbitMQStreams *RabbitMQStreamsOptions
	GCPPubSub       *GCPPubSubOptions
	MQTT            *MQTTOptions
	AWSSQS          *AWSSQSOptions
	AWSSNS          *AWSSNSOptions
	ActiveMq        *ActiveMqOptions
	RedisPubSub     *RedisPubSubOptions
	RedisStreams    *RedisStreamsOptions
	Azure           *AzureServiceBusOptions
	AzureEventHub   *AzureEventHubOptions
	Nats            *NatsOptions
	NatsStreaming   *NatsStreamingOptions
	CDCMongo        *CDCMongoOptions
	Batch           *BatchOptions
	CDCPostgres     *CDCPostgresOptions
	Pulsar          *PulsarOptions
	NSQ             *NSQOptions
	KubeMQQueue     *KubeMQQueueOptions
}

func Handle

func Handle(cliArgs []string) (string, *Options, error)

type PulsarOptions added in v0.24.0

type PulsarOptions struct {
	// Shared
	Address             string
	Topic               string
	Queue               string
	ClientId            string
	InsecureTLS         bool
	AuthCertificateFile string
	AuthKeyFile         string
	ConnectTimeout      time.Duration

	// Read
	ReadFollow       bool
	SubscriptionName string
	SubscriptionType string
}

type RabbitMQStreamsOptions added in v0.33.0

type RabbitMQStreamsOptions struct {
	// Shared
	Address           string
	Port              int
	Stream            string
	UseTLS            bool
	SkipVerifyTLS     bool
	ClientName        string
	DeclareStream     bool
	DeclareStreamSize string
	Username          string
	Password          string

	// Read
	Offset string
}

type RabbitOptions

type RabbitOptions struct {
	// Shared
	Address       string
	Exchange      string
	RoutingKey    string
	UseTLS        bool
	SkipVerifyTLS bool

	// Read
	ReadQueue           string
	ReadQueueDurable    bool
	ReadQueueAutoDelete bool
	ReadQueueExclusive  bool
	ReadAutoAck         bool
	ReadQueueDeclare    bool
	ReadConsumerTag     string

	// Write
	WriteAppID string
}

type RedisPubSubOptions added in v0.18.0

type RedisPubSubOptions struct {
	// Shared
	Address  string
	Channels []string
	Username string
	Password string
	Database int
}

type RedisStreamsOptions added in v0.18.0

type RedisStreamsOptions struct {
	// Shared
	Address  string
	Username string
	Password string
	Database int

	// Read/Relay
	Streams               []string
	ConsumerGroup         string
	ConsumerName          string
	Count                 int64
	StartID               string
	RecreateConsumerGroup bool
	CreateStreams         bool

	// Write
	WriteID  string
	WriteKey string
}

Jump to

Keyboard shortcuts

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