This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HardwareMonitorServer is the server API for HardwareMonitor service. | |
// All implementations must embed UnimplementedHardwareMonitorServer | |
// for forward compatibility | |
type HardwareMonitorServer interface { | |
// Monitor will output stats about the hardware on the system host | |
Monitor(*EmptyRequest, HardwareMonitor_MonitorServer) error | |
mustEmbedUnimplementedHardwareMonitorServer() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"time" | |
// Dont forget this import :) | |
"github.com/mackerelio/go-osstat/cpu" | |
"github.com/mackerelio/go-osstat/memory" | |
hardwaremonitoring "github.com/percybolmer/grpcstreams/proto" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
hardwaremonitoring "github.com/percybolmer/grpcstreams/proto" | |
"google.golang.org/grpc" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"time" | |
hardwaremonitoring "github.com/percybolmer/grpcstreams/proto" | |
"google.golang.org/grpc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logo from './logo.svg'; | |
import './App.css'; | |
import React, { useState, useEffect } from 'react'; | |
import { HardwareMonitorClient } from './proto/service_grpc_web_pb'; | |
import { EmptyRequest } from './proto/service_pb'; | |
// Create a new HardwareMonitorClient like this, correct the ADDR and Port used | |
// If you use something else. | |
var client = new HardwareMonitorClient('http://localhost:8080'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Static version of the {@see toObject} method. | |
* @param {boolean|undefined} includeInstance Deprecated. Whether to include | |
* the JSPB instance for transitional soy proto support: | |
* http://goto/soy-param-migration | |
* @param {!proto.main.HardwareStats} msg The msg instance to transform. | |
* @return {!Object} | |
* @suppress {unusedLocalVariables} f is only used for nested messages | |
*/ | |
proto.main.HardwareStats.toObject = function(includeInstance, msg) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"net/http" | |
"time" | |
"github.com/improbable-eng/grpc-web/go/grpcweb" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.0" | |
services: | |
redis: | |
image: "redis:alpine" | |
# The Command will make redis-server run with our custom Configuration | |
command: redis-server /usr/local/etc/redis/redis.conf | |
volumes: | |
- ./redis/data:/data #Used for persisting data | |
- ./redis/conf:/usr/local/etc/redis #Used for configuring redis | |
networks: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
fmt.Println("hello from publisher") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.15 | |
RUN mkdir /app | |
WORKDIR /app | |
COPY . . | |
RUN go mod init publisher | |
RUN go build -o publisher | |
CMD ["/app/publisher"] |