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" | |
| "grpc_stream_medium/server/sensor" | |
| "grpc_stream_medium/server/sensorpb" | |
| "log" | |
| "net" | |
| "time" |
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 sensor | |
| import ( | |
| "log" | |
| "math/rand" | |
| "sync" | |
| "time" | |
| ) | |
| type Sensor struct { |
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
| type server struct{} | |
| func (*server) TempSensor(req *sensorpb.SensorRequest, | |
| stream sensorpb.Sensor_TempSensorServer) error { | |
| return nil | |
| } | |
| func (*server) HumiditySensor(req *sensorpb.SensorRequest, | |
| stream sensorpb.Sensor_HumiditySensorServer) error { |
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
| type SensorServer interface { | |
| TempSensor(*SensorRequest, Sensor_TempSensorServer) error | |
| HumiditySensor(*SensorRequest, Sensor_HumiditySensorServer) error | |
| } |
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 ( | |
| "grpc_stream_medium/server/sensorpb" | |
| "log" | |
| "net" | |
| "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
| syntax = "proto3"; | |
| package sensors; | |
| option go_package="sensorpb"; | |
| message SensorRequest { | |
| } | |
| message SensorResponse { | |
| int64 value = 1; | |
| } |
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
| #!/bin/sh | |
| echo " ---- Getting credentials for the hd-engineering cluster ---- " | |
| gcloud container clusters get-credentials hd-engineering-cluster --zone us-central1-a --project hd-engineering | |
| echo " ---- Creating a ephemeral pod in the retooling cluster ---- " | |
| echo " ---- run -> telnet internalhostip 6379 to connect to the memorystore instance " | |
| kubectl -n retooling run memorystore-proxy --rm -i --tty --image us.gcr.io/hd-engineering/memorystore-proxy -- bash |
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" | |
| "image/color" | |
| "log" | |
| "gocv.io/x/gocv" | |
| ) |
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" | |
| "gocv.io/x/gocv" | |
| ) | |
| func main() { | |
| webcam, err := gocv.VideoCaptureDevice(0) |
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
| brew install mysql | |
| brew tap homebrew/services | |
| brew services start mysql |