Skip to content

Instantly share code, notes, and snippets.

Avatar
🛰️
work@microservices

Vasiliy Tolstov vtolstov

🛰️
work@microservices
View GitHub Profile
View watcher.go
package multi
import (
"sync"
"github.com/micro/go-micro/registry"
)
type multiWatcher struct {
wo registry.WatchOptions
View options.go
package multi
import (
"context"
"github.com/micro/go-micro/registry"
)
type writeKey struct{}
type readKey struct{}
View multi.go
package multi
import (
"context"
"sync"
"github.com/micro/go-micro/registry"
log "github.com/micro/go-micro/util/log"
)
View zone.proto
syntax = "proto3";
package unistack;
option go_package = "unistackpb";
import "list.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
View errors.go
package errors
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/micro/go-micro/errors"
)
View policy.go
package policy
import (
"context"
"github.com/micro/go-micro/client"
"github.com/micro/go-micro/server"
"unistack.org/centralv2/service/policy/policypb"
)
View gobreaker.go
package breaker
import (
"context"
"sync"
"github.com/micro/go-micro/client"
"github.com/micro/go-micro/errors"
"github.com/sony/gobreaker"
)
View gobreaker.go
package breaker
import (
"context"
"sync"
"github.com/micro/go-micro/client"
"github.com/micro/go-micro/errors"
"github.com/sony/gobreaker"
)
View gist:d4f77aaf6959eee8dec79545e472c814
{%- set archs = {'amd64': 'x86_64', 'i386': 'x86_32'} %}
{%- set system = '-'.join([salt['grains.get']('os'), salt['grains.get']('osrelease').split('.', 1)[0], archs.get(salt['grains.get']('osarch'), salt['grains.get']('osarch'))]).lower() %}
{%- set hostname, domainname = grains['id'].split('.',1) %}
{%- set project = '_'.join(domainname.split('.')[-2:]) %}
{%- set environment = domainname.replace('.','_') %}
{%- set roles = salt['pillar.get']('roles', []) %}
{%- from "macros.jinja" import include with context %}
base:
'*':
{{ include("systems/{0}/common".format(system)) }}
View gist:c426fc5e8f8688ac58334c7a4cc81c63
common/*.sls
system/{{ __grains__['os'].lower() }}-{{ __grains__['osrelease'].lower() }}-{{ __grains__['osarch'] }}.sls
{% set hostname, domainname = minion_id.split('.',1) %}
envs/{{ domainname | replace('.','_') }}/*.sls
roles/{{ hostname.rstrip('0123456789') }}.sls
nodes/{{ domainname | replace('.','_') }}/{{ hostname }}.sls
You can’t perform that action at this time.