Apache Kafka? ??? ??? ????? ? ???? ??????? ???? ? ???? ??? ?? ???? ??????. ? ??? ?????? Golang? ???? Kafka ???? ???? ???? ??? ?????.
????
???? ?? ???? ??? ???? ??? ?????.
?(1.16 ??)
Docker(Kafka? ???? ???? ? ??)
???
Docker? Kafka ??
Kafka? ??? ???? ?? Docker? ???????. ???? ????? docker-compose.yml ??? ????.
yamlCopy codeversion: '3.7' services: zookeeper: image: wurstmeister/zookeeper:3.4.6 ports: - "2181:2181" kafka: image: wurstmeister/kafka:2.13-2.7.0 ports: - "9092:9092" environment: KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 depends_on: - zookeeper
Kafka? Zookeeper? ????? ?? ??? ?????.
docker-compose up -d
Go?? Kafka ???? ???
?? ? Go ??? ??????.
go mod init kafka-example
kafka-go ????? ??:
go get github.com/segmentio/kafka-go
?? producer.go ??? ???? ?? ??? ?????.
package main import ( "context" "fmt" "github.com/segmentio/kafka-go" "log" "time" ) func main() { writer := kafka.Writer{ Addr: kafka.TCP("localhost:9092"), Topic: "example-topic", Balancer: &kafka.LeastBytes{}, } defer writer.Close() for i := 0; i < 10; i++ { msg := kafka.Message{ Key: []byte(fmt.Sprintf("Key-%d", i)), Value: []byte(fmt.Sprintf("Hello Kafka %d", i)), } err := writer.WriteMessages(context.Background(), msg) if err != nil { log.Fatal("could not write message " + err.Error()) } time.Sleep(1 * time.Second) fmt.Printf("Produced message: %s\n", msg.Value) } }
? ??? ?? ?? ??? 10?? ???? ??? Kafka ???? ?????.
???? ??:
go run producer.go
???? ?????? ???? ??? ?????.
Go?? Kafka ??? ???
consumer.go ??? ??? ?? ??? ?????.
package main import ( "context" "fmt" "github.com/segmentio/kafka-go" "log" ) func main() { reader := kafka.NewReader(kafka.ReaderConfig{ Brokers: []string{"localhost:9092"}, Topic: "example-topic", GroupID: "example-group", }) defer reader.Close() for { msg, err := reader.ReadMessage(context.Background()) if err != nil { log.Fatal("could not read message " + err.Error()) } fmt.Printf("Consumed message: %s\n", msg.Value) } }
? ???? ?? ?? ??? ???? ?? ?? ??? ?????.
??? ??:
go run consumer.go
???? ?????? ???? ??? ?????.
??
? ??? ?????? Golang? ???? Kafka ???? ???? ???? ??? ??????. ? ??? ?? ??? ?? ? ??? ?? ??? ?? ??? Kafka? ??? ??? ?? ?????. Kafka? ???? ???? ?? ??? ??? ??? ?? ???? ??? ? ????.
??? ??, ? ?? ??? ??, ?? ????? ??? ?? ?? ??? ???? ?????. ??? ?????!
?????! ? ??? ???? ??? ??? ??? ????? ????? ??? Go? ?? Kafka? ???? ??? ???? ?????.
? ??? Go?? Kafka ???? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

Golang? ?? ??? ??? ????? ??? ?? ???? ??? ? ??? ? ?? ????. ?? ??? ???, ?? ?? ? ??? ?? ?????? ????? API ??, ???? ???, ?? ???, ?????? ?? ? CLI ??? ?? ??? ?? ????? ???? ? ?????. Golang? ? ??? ??? ?? ??? ???? Gopherjs? ?? JavaScript? ?????? Tinygo? ?? WebAssembly?? ????? ??? ?? ??? ???? ?? ??? ???? HTML ???? ?? ? ? ????. ??? ???? ??? ?? ??? ??? ??JavaScript/TypeScript ? ???? ???????. ??? Golang? ??? ???? ???? ?? ?? ??? ? ?????.

GO?? GraphQlapi? ????? GQLGEN ?????? ???? ?? ???? ????? ?? ????. 1. ?? ???? ???? ?? ?? ??? ???? GQLGEN? ?? ??? ?????? ??????. 2. ?? ?? GraphQLSchema? ???? POST ?? ? ?? ??? ??? ?? API ?? ? ?? ??? ??????. 3. ?? ?? ????? ????? ?? ??? ???? Resolver?? ???? ??? ?????. 4. ????? ??? Qlhandler? httpserver? ???? ?? ???? ?? API? ???????. ?? ?? ?? ??, ?? ??, ?? ??? ? ?? ??? ???? ???? ?? ??? ?????.

GO? ???? ?? ??? ??? ???? ?? ??? ???? ??? ???? ????. 1. ?? ???? ?? ???? ??????? ?? ? ???? ??????. Windows? .msi ??? ???? MacOS? .pkg ??? ???? Linux? .tar.gz ??? ???? /usr /local ????? ??? ????. 2. Linux/MacOS?? ?? ??, ?? ~/.bashrc ?? ~/.zshrc? ???? ??? Gopath? ???? Windows Set ??? ??? ???? ?????. 3. ?? ??? ???? ??? ???? ??? ???? Hello.Go? ???? ?? ? ??? ???? ??????. ???? ???? ?? ?? ? ??

sync.waitgroup? ?? ? ??? ??? ?? ? ??? ???? ? ?????. ??? ??? ? ?? ??? ?? ?? ??? ???? : ??, ?? ? ??. 1. Aadd (n) ?? ? ?? ? ?? ?????. 2. DONE ()? ? ? ??? ??? ???? ???? 1 ? ?? ???. 3. Wait ()? ?? ??? ?? ? ??? ?? ? ??? ?????. ?? ??? ?? ?? ?? : ADD? ?? ? ???? ????????. ?? ??? ??? DON? ????? ??????. ??? ?? ???? ?? ????. ? ???? ?? ???, ?? ??? ?? ? ?? ?????? ????? ??? ????? ????? ?? ? ? ????.

Go? Embed ???? ???? ? ???? ??? HTML, CSS, ?? ? ?? ??? ???? ? ??? ?? ???? ????? ?? ???? ? ????. 1. ?? ? ???? ????? ??????. 2. ??/*? ?? ?? ????? ??? ? ??? embed.fs? ?? ?? ?? ??? ??? ? ????. 3. ?? ?? ?? ?? ??? ?? ??? ?? ??? ???? ???? ????? ?? ????. 4. ???? ???? ?? ???, ?? ?? ?? ? ?? ?? ?????????. Embed? ???? ??? ??? ????? ???? ??? ??? ? ? ????.

??? ? ??? ??? ??? ?? ???? ? ??? ??? ???? ? ????. 1. ?? ?????? ??, ???, ??, ??? ? ??? ???? ? ???? ??? ? ???? ????. 2. ??? ? ??? ??, ?? ??, ??? ???, ??? ?? ?? ?? ???? ??? ?? ??, ?? ???, ??? ?? ??, ?? ?? ?? ?? ?? ??? ? ????. 3. FFMPEG, OPENCV, WEBRTC, GSTREAMER ? ?? ??? ???? ??? ???? ?? ????. 4. ?? ?? ???? ???? ??, ???? ??? ??? ?? ??, ?? ??? ? ??? ?? ?????? ???????. ??? ?? ???? ????? ?? ???? ??? ??? ????? ? ??????.

?? ?? ??? ? ??? ???? ?? ??? ????. ??? Net/HTTP ???? ???? ?? ???? ???? ? ????. 1. net/http? ???? ?? ??? ??? ??????. ?? ?? ??? ???? ? ?? ??? ?? ??? ????. 2. ??? ?? : Servemux? ???? ?? ??? ? ??? ?? ?? ????? ??? ?????. 3. ???? ?? : ?? ?? ? ?? ??? ? ?? ?????? ???? ??? ??? ?????. 4. ?? ?? ??? : http.fileserver? ?? HTML, CSS ? JS ??? ?????. 5. ?? ? ?? : HTTPS ???, ?? ??? ??? ???? ?? ? ??? ????? ?? ?? ??? ?????. ??? ?? ???? ????? ??? ???? ?? ? ?? ????.

Select Plus Default? ??? ?? ??? ???? ??? ?? ????? ??? ? Select? ?? ??? ????? ???? ????. 1. ???? ?? ???? ???? ?? ? ? ??? ?? ??? ?? ??? ?? ?????. 2. ??? ??. ?? ?? ?? ????? ???? ?????. ??? ?? ?? ???? ?? ?? ????. 3. ?? ??? ????, ??? ?? ??? ???? ?? ?? ????? ???? ???????. ?? ??? ?? ?? ??? ?? ???? ?? ? ? ??? ?? ? ??? ?? ????? ??? ???? ????.
