Compare commits
3 Commits
a0ce809869
...
5825d0018d
Author | SHA1 | Date | |
---|---|---|---|
5825d0018d | |||
29135938c2 | |||
dbdff6b477 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ dist/
|
|||||||
tmp/
|
tmp/
|
||||||
*/*App
|
*/*App
|
||||||
project/db-data/
|
project/db-data/
|
||||||
|
**/*.pb.go
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"broker/cmd/api/event"
|
"broker/event"
|
||||||
|
"broker/logs"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -10,13 +12,16 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/rpc"
|
"net/rpc"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RequestPayload struct {
|
type RequestPayload struct {
|
||||||
Action string `string:"action"`
|
Action string `string:"action"`
|
||||||
Auth AuthPayload `json:"auth,omitempty"`
|
Auth AuthPayload ` json:"auth,omitempty"`
|
||||||
Log LogPayload `json:"log,omitempty"`
|
Log LogPayload ` json:"log,omitempty"`
|
||||||
Mail MailPayload `json:"mail,omitempty"`
|
Mail MailPayload ` json:"mail,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AuthPayload struct {
|
type AuthPayload struct {
|
||||||
@ -57,12 +62,14 @@ func (app *Config) HandleSubmission(w http.ResponseWriter, r *http.Request) {
|
|||||||
switch requestPayload.Action {
|
switch requestPayload.Action {
|
||||||
case "auth":
|
case "auth":
|
||||||
app.authenticate(w, requestPayload.Auth)
|
app.authenticate(w, requestPayload.Auth)
|
||||||
case "logHttp": // 2729 us
|
case "logHttp": // 2336 us
|
||||||
app.LogItem(w, requestPayload.Log)
|
app.LogItem(w, requestPayload.Log)
|
||||||
case "logRabbit": // 10007 us
|
case "logRabbit": // 7825 us
|
||||||
app.logEventViaRabbit(w, requestPayload.Log)
|
app.logEventViaRabbit(w, requestPayload.Log)
|
||||||
case "logRpc": // 555 us
|
case "logRpc": // 2097 us
|
||||||
app.logItemViaRPC(w, requestPayload.Log)
|
app.logItemViaRPC(w, requestPayload.Log)
|
||||||
|
case "logGrpc": // 236882 us
|
||||||
|
app.LogViaGRPC(w, requestPayload.Log)
|
||||||
case "mail":
|
case "mail":
|
||||||
app.SendMail(w, requestPayload.Mail)
|
app.SendMail(w, requestPayload.Mail)
|
||||||
default:
|
default:
|
||||||
@ -253,3 +260,39 @@ func (app *Config) logItemViaRPC(w http.ResponseWriter, l LogPayload) {
|
|||||||
|
|
||||||
app.writeJSON(w, http.StatusOK, payload)
|
app.writeJSON(w, http.StatusOK, payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (app *Config) LogViaGRPC(w http.ResponseWriter, l LogPayload) {
|
||||||
|
conn, err := grpc.NewClient(
|
||||||
|
"logger-service:50001",
|
||||||
|
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
app.errorJSON(w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
|
now := time.Now()
|
||||||
|
l.Data += fmt.Sprintf("gRPC sent date %d", now.UnixMicro())
|
||||||
|
|
||||||
|
c := logs.NewLogServiceClient(conn)
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
_, err = c.WriteLog(ctx, &logs.LogRequest{
|
||||||
|
LogEntry: &logs.Log{
|
||||||
|
Name: l.Name,
|
||||||
|
Data: l.Data,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
app.errorJSON(w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var payload jsonResponse
|
||||||
|
payload.Error = false
|
||||||
|
payload.Message = "logged via gRPC"
|
||||||
|
|
||||||
|
app.writeJSON(w, http.StatusOK, payload)
|
||||||
|
}
|
||||||
|
@ -7,4 +7,15 @@ require (
|
|||||||
github.com/go-chi/cors v1.2.1
|
github.com/go-chi/cors v1.2.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require github.com/rabbitmq/amqp091-go v1.10.0
|
require (
|
||||||
|
github.com/rabbitmq/amqp091-go v1.10.0
|
||||||
|
google.golang.org/grpc v1.66.0
|
||||||
|
google.golang.org/protobuf v1.34.1
|
||||||
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
golang.org/x/net v0.26.0 // indirect
|
||||||
|
golang.org/x/sys v0.21.0 // indirect
|
||||||
|
golang.org/x/text v0.16.0 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
|
||||||
|
)
|
||||||
|
@ -2,7 +2,21 @@ github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
|
|||||||
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
||||||
github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
|
github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
|
||||||
github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
|
github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
|
||||||
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw=
|
github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw=
|
||||||
github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
|
github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
|
||||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||||
|
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
|
||||||
|
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
|
||||||
|
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||||
|
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
|
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
||||||
|
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
|
||||||
|
google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c=
|
||||||
|
google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
|
||||||
|
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
|
||||||
|
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||||
|
23
broker-service/logs/logs.proto
Normal file
23
broker-service/logs/logs.proto
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package logs;
|
||||||
|
|
||||||
|
option go_package = "/logs";
|
||||||
|
|
||||||
|
message Log {
|
||||||
|
string name = 1;
|
||||||
|
string data = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message LogRequest {
|
||||||
|
Log logEntry = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message LogResponse {
|
||||||
|
string result = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
service LogService {
|
||||||
|
rpc WriteLog(LogRequest) returns (LogResponse);
|
||||||
|
}
|
||||||
|
|
@ -12,6 +12,7 @@
|
|||||||
<a id="logHttpBtn" class="btn btn-outline-secondary" href="javascript:void(0);">Test HTTP Log</a>
|
<a id="logHttpBtn" class="btn btn-outline-secondary" href="javascript:void(0);">Test HTTP Log</a>
|
||||||
<a id="logRabbitBtn" class="btn btn-outline-secondary" href="javascript:void(0);">Test Rabbit Log</a>
|
<a id="logRabbitBtn" class="btn btn-outline-secondary" href="javascript:void(0);">Test Rabbit Log</a>
|
||||||
<a id="logRpcBtn" class="btn btn-outline-secondary" href="javascript:void(0);">Test RPC Log</a>
|
<a id="logRpcBtn" class="btn btn-outline-secondary" href="javascript:void(0);">Test RPC Log</a>
|
||||||
|
<a id="logGrpcBtn" class="btn btn-outline-secondary" href="javascript:void(0);">Test gRPC Log</a>
|
||||||
<a id="mailBtn" class="btn btn-outline-secondary" href="javascript:void(0);">Test Mail</a>
|
<a id="mailBtn" class="btn btn-outline-secondary" href="javascript:void(0);">Test Mail</a>
|
||||||
|
|
||||||
<div id="output" class="mt-5" style="outline: 1px solid silver; padding: 2em;">
|
<div id="output" class="mt-5" style="outline: 1px solid silver; padding: 2em;">
|
||||||
@ -44,6 +45,7 @@
|
|||||||
let logHttpBtn = document.getElementById("logHttpBtn");
|
let logHttpBtn = document.getElementById("logHttpBtn");
|
||||||
let logRabbitBtn = document.getElementById("logRabbitBtn");
|
let logRabbitBtn = document.getElementById("logRabbitBtn");
|
||||||
let logRpcBtn = document.getElementById("logRpcBtn");
|
let logRpcBtn = document.getElementById("logRpcBtn");
|
||||||
|
let logGrpcBtn = document.getElementById("logGrpcBtn");
|
||||||
let output = document.getElementById("output");
|
let output = document.getElementById("output");
|
||||||
let sent = document.getElementById("payload");
|
let sent = document.getElementById("payload");
|
||||||
let received = document.getElementById("received");
|
let received = document.getElementById("received");
|
||||||
@ -196,6 +198,38 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
logGrpcBtn.addEventListener("click", () => {
|
||||||
|
const payload = {
|
||||||
|
action: "logGrpc",
|
||||||
|
log: {
|
||||||
|
name: "event",
|
||||||
|
data: "some kind of data",
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const headers = new Headers();
|
||||||
|
headers.append("Content-Type", "application/json");
|
||||||
|
const body = {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(payload),
|
||||||
|
headers: headers,
|
||||||
|
}
|
||||||
|
fetch("http:\/\/localhost:8080/handle", body)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => {
|
||||||
|
sent.innerHTML = JSON.stringify(payload, undefined, 4);
|
||||||
|
received.innerHTML = JSON.stringify(data, undefined, 4);
|
||||||
|
if (data.error) {
|
||||||
|
console.log(data.message);
|
||||||
|
output.innerHTML += `<br><strong>Error:</strong>: ${data.message}`;
|
||||||
|
} else {
|
||||||
|
output.innerHTML += `<br><strong>Response from broker service</strong>: ${data.message}`;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
output.innerHTML += "<br><br>Error: " + error;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
mailBtn.addEventListener("click", () => {
|
mailBtn.addEventListener("click", () => {
|
||||||
const payload = {
|
const payload = {
|
||||||
action: "mail",
|
action: "mail",
|
||||||
|
59
logger-service/cmd/api/grpc.go
Normal file
59
logger-service/cmd/api/grpc.go
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"logger/data"
|
||||||
|
"logger/logs"
|
||||||
|
"net"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
)
|
||||||
|
|
||||||
|
type LogServer struct {
|
||||||
|
logs.UnimplementedLogServiceServer
|
||||||
|
Models data.Models
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *LogServer) WriteLog(
|
||||||
|
ctx context.Context,
|
||||||
|
req *logs.LogRequest,
|
||||||
|
) (*logs.LogResponse, error) {
|
||||||
|
now := time.Now()
|
||||||
|
input := req.GetLogEntry()
|
||||||
|
|
||||||
|
// write the log
|
||||||
|
logEntry := data.LogEntry{
|
||||||
|
Name: input.Name,
|
||||||
|
Data: input.Data,
|
||||||
|
}
|
||||||
|
|
||||||
|
logEntry.Data += fmt.Sprintf(" received date %d", now.UnixMicro())
|
||||||
|
err := l.Models.LogEntry.Insert(logEntry)
|
||||||
|
if err != nil {
|
||||||
|
res := &logs.LogResponse{Result: "failed"}
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
|
|
||||||
|
res := &logs.LogResponse{Result: "logged!"}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (app *Config) gRPCListen() {
|
||||||
|
lis, err := net.Listen("tcp", fmt.Sprintf(":%s", gRpcPort))
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to listen to gRPC %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
s := grpc.NewServer()
|
||||||
|
|
||||||
|
logs.RegisterLogServiceServer(s, &LogServer{Models: app.Models})
|
||||||
|
|
||||||
|
log.Printf("gRPC Server started on port %s", gRpcPort)
|
||||||
|
|
||||||
|
if err := s.Serve(lis); err != nil {
|
||||||
|
log.Fatalf("Failed to listen to gRPC %v", err)
|
||||||
|
}
|
||||||
|
}
|
@ -15,6 +15,7 @@ type JSONPayload struct {
|
|||||||
|
|
||||||
func (app *Config) WriteLog(w http.ResponseWriter, r *http.Request) {
|
func (app *Config) WriteLog(w http.ResponseWriter, r *http.Request) {
|
||||||
// read json into var
|
// read json into var
|
||||||
|
now := time.Now()
|
||||||
var requestPayload JSONPayload
|
var requestPayload JSONPayload
|
||||||
err := app.readJSON(w, r, &requestPayload)
|
err := app.readJSON(w, r, &requestPayload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -29,7 +30,6 @@ func (app *Config) WriteLog(w http.ResponseWriter, r *http.Request) {
|
|||||||
Data: requestPayload.Data,
|
Data: requestPayload.Data,
|
||||||
}
|
}
|
||||||
|
|
||||||
now := time.Now()
|
|
||||||
event.Data += fmt.Sprintf(" received date %d", now.UnixMicro())
|
event.Data += fmt.Sprintf(" received date %d", now.UnixMicro())
|
||||||
|
|
||||||
log.Println("event", event)
|
log.Println("event", event)
|
||||||
|
@ -59,6 +59,8 @@ func main() {
|
|||||||
|
|
||||||
go app.rpcListen()
|
go app.rpcListen()
|
||||||
|
|
||||||
|
go app.gRPCListen()
|
||||||
|
|
||||||
// start web server
|
// start web server
|
||||||
log.Println("Starting service on port", webPort)
|
log.Println("Starting service on port", webPort)
|
||||||
app.serve()
|
app.serve()
|
||||||
|
@ -6,6 +6,8 @@ require (
|
|||||||
github.com/go-chi/chi/v5 v5.1.0
|
github.com/go-chi/chi/v5 v5.1.0
|
||||||
github.com/go-chi/cors v1.2.1
|
github.com/go-chi/cors v1.2.1
|
||||||
go.mongodb.org/mongo-driver v1.16.1
|
go.mongodb.org/mongo-driver v1.16.1
|
||||||
|
google.golang.org/grpc v1.66.0
|
||||||
|
google.golang.org/protobuf v1.34.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@ -16,7 +18,10 @@ require (
|
|||||||
github.com/xdg-go/scram v1.1.2 // indirect
|
github.com/xdg-go/scram v1.1.2 // indirect
|
||||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
||||||
golang.org/x/crypto v0.22.0 // indirect
|
golang.org/x/crypto v0.24.0 // indirect
|
||||||
|
golang.org/x/net v0.26.0 // indirect
|
||||||
golang.org/x/sync v0.7.0 // indirect
|
golang.org/x/sync v0.7.0 // indirect
|
||||||
golang.org/x/text v0.14.0 // indirect
|
golang.org/x/sys v0.21.0 // indirect
|
||||||
|
golang.org/x/text v0.16.0 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
|
||||||
)
|
)
|
||||||
|
@ -25,12 +25,14 @@ go.mongodb.org/mongo-driver v1.16.1 h1:rIVLL3q0IHM39dvE+z2ulZLp9ENZKThVfuvN/IiN4
|
|||||||
go.mongodb.org/mongo-driver v1.16.1/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw=
|
go.mongodb.org/mongo-driver v1.16.1/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
|
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
|
||||||
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
|
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
|
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
|
||||||
|
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
||||||
@ -40,15 +42,23 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||||
|
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
||||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
|
||||||
|
google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c=
|
||||||
|
google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
|
||||||
|
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
|
||||||
|
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||||
|
22
logger-service/logs/logs.proto
Normal file
22
logger-service/logs/logs.proto
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package logs;
|
||||||
|
|
||||||
|
option go_package = "/logs";
|
||||||
|
|
||||||
|
message Log {
|
||||||
|
string name = 1;
|
||||||
|
string data = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message LogRequest {
|
||||||
|
Log logEntry = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message LogResponse {
|
||||||
|
string result = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
service LogService {
|
||||||
|
rpc WriteLog(LogRequest) returns (LogResponse);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user