config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PublisherNoop  = "noop"
	PublisherKafka = "kafka"
)

publisher names

View Source
const (
	AuthNoop  = "noop"
	AuthPlain = "plain"
)

authenticator names

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaConfigArgs

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

func (*KafkaConfigArgs) ConfigMap

func (c *KafkaConfigArgs) ConfigMap() kafka.ConfigMap

func (*KafkaConfigArgs) Set

func (c *KafkaConfigArgs) Set(value string) error

func (*KafkaConfigArgs) String

func (c *KafkaConfigArgs) String() string

type Server

type Server struct {
	HTTP struct {
		ListenAddress string
		GracePeriod   time.Duration
	}
	MQTT struct {
		ListenAddress    string
		GracePeriod      time.Duration
		ReadTimeout      time.Duration
		WriteTimeout     time.Duration
		IdleTimeout      time.Duration
		ReaderBufferSize int
		WriterBufferSize int
		TLSSrv           struct {
			Cert     string
			Key      string
			ClientCA string
		}
		Handler struct {
			IgnoreUnsupported    []string
			AllowUnauthenticated []string
			Publish              struct {
				Timeout time.Duration
				Async   struct {
					AtMostOnce  bool
					AtLeastOnce bool
					ExactlyOnce bool
				}
			}
			Authenticator struct {
				Name  string
				Plain struct {
					Credentials     map[string]string
					CredentialsFile string
				}
			}
		}
		Publisher struct {
			Name  string
			Kafka struct {
				BootstrapServers string
				GracePeriod      time.Duration
				ConfArgs         KafkaConfigArgs
				DefaultTopic     string
				TopicMappings    TopicMappings
				Workers          int
			}
		}
	}
}

func (*Server) Init

func (c *Server) Init()

func (Server) Validate

func (c Server) Validate() error

type TopicMapping

type TopicMapping struct {
	Topic  string
	RegExp *regexp.Regexp
}

func (*TopicMapping) String

func (c *TopicMapping) String() string

type TopicMappings

type TopicMappings struct {
	Mappings []TopicMapping
}

func (*TopicMappings) Set

func (c *TopicMappings) Set(value string) error

func (*TopicMappings) String

func (c *TopicMappings) String() string

Jump to

Keyboard shortcuts

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