1
0
mirror of https://github.com/ManyakRus/starter.git synced 2025-02-15 15:10:29 +02:00

сделал telegram_bot

This commit is contained in:
Nikitin Aleksandr 2024-11-11 18:09:33 +03:00
parent 942977504e
commit 6ad6d27f73

View File

@ -2,6 +2,7 @@ package kafka_connect
import (
"context"
"fmt"
"github.com/ManyakRus/starter/config_main"
"github.com/ManyakRus/starter/contextmain"
"github.com/ManyakRus/starter/micro"
@ -31,7 +32,7 @@ func TestCloseConnection(t *testing.T) {
CloseConnection()
}
func TestStartNats(t *testing.T) {
func TestStart(t *testing.T) {
//ProgramDir := micro.ProgramDir_Common()
config_main.LoadEnv()
StartKafka()
@ -88,3 +89,24 @@ func TestReadTopic(t *testing.T) {
t.Logf("new message: %#v", mess)
}
}
func TestReadGroups(t *testing.T) {
config_main.LoadEnv()
Connect()
defer CloseConnection()
partitions, err := Conn.ReadPartitions("kol_atom_ul_uni.stack.documents")
if err != nil {
panic(err.Error())
}
m := map[string]struct{}{}
for _, p := range partitions {
m[p.Topic] = struct{}{}
}
for k := range m {
fmt.Println(k)
}
}