Skip to content

Instantly share code, notes, and snippets.

View percybolmer's full-sized avatar

ProgrammingPercy percybolmer

View GitHub Profile
// 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()
}
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"
package main
import (
"fmt"
"log"
"net"
hardwaremonitoring "github.com/percybolmer/grpcstreams/proto"
"google.golang.org/grpc"
)
package main
import (
"context"
"fmt"
"log"
"time"
hardwaremonitoring "github.com/percybolmer/grpcstreams/proto"
"google.golang.org/grpc"
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');
/**
* 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) {
package main
import (
"fmt"
"log"
"net"
"net/http"
"time"
"github.com/improbable-eng/grpc-web/go/grpcweb"
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:
package main
import "fmt"
func main() {
fmt.Println("hello from publisher")
}
FROM golang:1.15
RUN mkdir /app
WORKDIR /app
COPY . .
RUN go mod init publisher
RUN go build -o publisher
CMD ["/app/publisher"]