Skip to content

Instantly share code, notes, and snippets.

{
"eventTime": "ISO DateTime String",
"serviceContext": {
"service": "Kubernetes deployment name eg user",
"version": "replica set number eg 3493650161"
},
"message": "stackTrace",
"context": {
"httpRequest": {
"method": "POST",
package controllers
import (
"context"
"github.com/codesword/microservices-blog-api/pb/authorization"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Assign Controller", func() {
syntax = "proto3";
package blog;
import "blog/blog.proto";
import "google/api/annotations.proto";
service BlogSvc {
rpc GetPost (blog.Slug) returns (blog.Post) {
option (google.api.http).get = "/v1/posts/{slug}";
syntax = "proto3";
package blog;
message Empty {}
message Id {
string id = 1;
}
syntax = "proto3";
package authorization;
import "google/api/annotations.proto";
import "authorization/authorization.proto";
service AuthorizationSvc {
/* Get a single user permission
@codesword
codesword / authorization.proto
Last active January 22, 2018 17:44
Input and Output messages
syntax = "proto3";
package authorization;
message Empty {}
//Input object
message ID {
// Unique identifier for permissions
string id = 1;
}
{
"UserInfo": {
"id": "#{USER_ID}",
"email": "#{USER_EMAIL}",
"first_name": "#{USER_FIRST_NAME}",
"last_name": "#{USER_LAST_NAME}",
"name": "#{USER_NAME}",
"picture": "#{USER_PROFILE_PICTURE}",
"roles": {
"#{ROLE_NAME}": "#{ROLE_ID}"
package auth
import (
"context"
"net/http"
"strings"
"google.golang.org/grpc/metadata"
"github.com/andela/micro-api-gateway/pb/authorization"
@codesword
codesword / minikube.md
Last active October 31, 2019 21:27
Installing minikube using xhyve driver

###Install docker-machine-driver-xhyve docker-machine-driver-xhyve is a docker machine driver plugin for xhyve native OS X Hypervisor. xhyve is a lightweight OS X virtualization solution. In my opinion, it's a far better option than virtualbox for running minikube. ####Brew On MacOS sierra, download latest using

brew install docker-machine-driver-xhyve --HEAD
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
const Sequelize = require('sequelize');
const models = require('./models');
const fs = require('fs');
// delete models.default;
const sequelize = new Sequelize(
'',
'',
'', {