Categorygithub.com/lowl11/boost2
modulepackage
0.1.28
Repository: https://github.com/lowl11/boost2.git
Documentation: pkg.go.dev

# README

Boost 2.0

Kafka Example

func main() {
    app := boost.New()

    kafkaConfig := configurator.
		New().
		SetConsumer().
		SetProducer().
		SetHosts(config.Get("KAFKA_HOSTS").Strings()).
		SetAuth(config.Get("KAFKA_USER").String(), config.Get("KAFKA_PASS").String()).
		SetMechanism(mechanisms.Plain)

	// consumer example
    err := consumer.
        New("c360_valid_attrs", kafkaConfig).
        StartConsume(func(message *sarama.ConsumerMessage) error {
            fmt.Printf("Message value: %s\n", message.Value)
            return nil
        })
    if err != nil {
        log.Fatal(err)
    }

    // producer example
    prod, err := producer.NewSync(kafkaConfig)
    if err != nil {
        log.Fatal("Create producer error: ", err)
    }
    
    prod.Publish("c360_valid_attrs", "123", "")
	
    app.Run()
}

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author

# Structs

No description provided by the author
No description provided by the author