Skip to content

Commit

Permalink
migrate the path to goraz
Browse files Browse the repository at this point in the history
  • Loading branch information
fzerorubigd committed Jul 7, 2019
1 parent 1448341 commit 2334aea
Show file tree
Hide file tree
Showing 34 changed files with 99 additions and 69 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ before_install:
- bash .travis/install_etcd.sh &
- sleep 3
script:
- go get -u ./...
- goveralls -v -service travis-ci -repotoken $COVERALLS_TOKEN || go test -v ./...
- make update
- goveralls -v -service travis-ci -repotoken $COVERALLS_TOKEN || make test

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015, 2016, 2017, 2018, 2019 Forud Ghafouri (fzerorubigd)
Copyright (c) 2015, 2016, 2017, 2018, 2019 Forud Ghafouri (goraz)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export ROOT:=$(realpath $(dir $(firstword $(MAKEFILE_LIST))))
SUBDIRS := $(wildcard */*/go.mod)

test: $(addsuffix -test,$(SUBDIRS))
go test -v

update: $(addsuffix -update,$(SUBDIRS))
go get -u .

tidy: $(addsuffix -tidy,$(SUBDIRS))
go mod tidy

$(addsuffix -test,$(SUBDIRS)):
cd $(shell dirname $(ROOT)/$@) && go test -v

$(addsuffix -update,$(SUBDIRS)):
cd $(shell dirname $(ROOT)/$@) && go get -u

$(addsuffix -tidy,$(SUBDIRS)):
cd $(shell dirname $(ROOT)/$@) && go mod tidy


.PHONY: all $(SUBDIRS)
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# onion

[![Build Status](https://travis-ci.org/fzerorubigd/onion.svg)](https://travis-ci.org/fzerorubigd/onion)
[![Coverage Status](https://coveralls.io/repos/fzerorubigd/onion/badge.svg?branch=develop&service=github)](https://coveralls.io/github/fzerorubigd/onion?branch=master)
[![GoDoc](https://godoc.org/github.com/fzerorubigd/onion?status.svg)](https://godoc.org/github.com/fzerorubigd/onion)
[![Go Report Card](https://goreportcard.com/badge/github.com/fzerorubigd/onion)](https://goreportcard.com/report/github.com/fzerorubigd/onion)
[![Build Status](https://travis-ci.org/goraz/onion.svg)](https://travis-ci.org/goraz/onion)
[![Coverage Status](https://coveralls.io/repos/goraz/onion/badge.svg?branch=develop&service=github)](https://coveralls.io/github/goraz/onion?branch=master)
[![GoDoc](https://godoc.org/github.com/goraz/onion?status.svg)](https://godoc.org/github.com/goraz/onion)
[![Go Report Card](https://goreportcard.com/badge/github.com/goraz/onion)](https://goreportcard.com/report/github.com/goraz/onion)

import "github.com/fzerorubigd/onion"
import "github.com/goraz/onion"

Package onion is a layer based, pluggable config manager for golang.

The current version in `develop` branch is work in progress (see the [milestone](https://github.com/fzerorubigd/onion/milestone/1)), for older versions check the `v2` and `v3` branches and use the `gopkg.in/fzerorubigd/onion.v1` and `gopkg.in/fzerorubigd/onion.v2`
The current version in `develop` branch is work in progress (see the [milestone](https://github.com/goraz/onion/milestone/1)), for older versions check the `v2` and `v3` branches and use the `gopkg.in/goraz/onion.v1` and `gopkg.in/goraz/onion.v2`
For the next release we use the go module and tagging using semantic version.

```
Expand Down Expand Up @@ -49,7 +49,7 @@ package main
import (
"fmt"

"github.com/fzerorubigd/onion"
"github.com/goraz/onion"
)

func main() {
Expand Down Expand Up @@ -81,7 +81,7 @@ for including other formats, (currently other than builtin `json`, the `toml` an
loader package like this :
```go
import (
_ "github.com/fzerorubigd/onion/loaders/toml"
_ "github.com/goraz/onion/loaders/toml"
)
```

Expand All @@ -95,9 +95,9 @@ package main
import (
"fmt"

"github.com/fzerorubigd/onion"
"github.com/fzerorubigd/onion/layers/etcdlayer"
"github.com/fzerorubigd/onion/layers/filewatchlayer"
"github.com/goraz/onion"
"github.com/goraz/onion/layers/etcdlayer"
"github.com/goraz/onion/layers/filewatchlayer"
)

func main() {
Expand All @@ -123,7 +123,7 @@ func main() {
### Encrypted config

Also if you want to store data in encrypted content. currently only `secconf` (based on the [crypt](https://github.com/xordataexchange/crypt) project)
also the [onioncli](https://github.com/fzerorubigd/onion/tree/develop/cli/onioncli) helps you to manage this keys.
also the [onioncli](https://github.com/goraz/onion/tree/develop/cli/onioncli) helps you to manage this keys.

```go
package main
Expand All @@ -132,18 +132,18 @@ import (
"bytes"
"fmt"

"github.com/fzerorubigd/onion"
"github.com/fzerorubigd/onion/ciphers/secconf"
"github.com/fzerorubigd/onion/layers/etcdlayer"
"github.com/fzerorubigd/onion/layers/filewatchlayer"
"github.com/goraz/onion"
"github.com/goraz/onion/ciphers/secconf"
"github.com/goraz/onion/layers/etcdlayer"
"github.com/goraz/onion/layers/filewatchlayer"
)

// Normally this should be in a safe place, not here
const privateKey = `PRIVATE KEY`

func main() {
// The private key should be in the safe place. this is just a demo, also there is a cli tool
// to create this `go get -u github.com/fzerorubigd/onion/cli/onioncli`
// to create this `go get -u github.com/goraz/onion/cli/onioncli`
cipher, err := secconf.NewCipher(bytes.NewReader([]byte(privateKey)))
if err != nil {
panic(err)
Expand Down
6 changes: 3 additions & 3 deletions ciphers/secconf/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/fzerorubigd/onion/ciphers/secconf
module github.com/goraz/onion/ciphers/secconf

go 1.13

require (
github.com/fzerorubigd/onion v0.0.0-20190622125020-5b1e62e21309
github.com/goraz/onion v0.0.0-20190706114413-1448341d7b2b
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4
)

replace github.com/fzerorubigd/onion => ../../
replace github.com/goraz/onion => ../../
2 changes: 2 additions & 0 deletions ciphers/secconf/go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4=
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.0 h1:UVQPSSmc3qtTi+zPPkCXvZX9VvW/xT/NsRvKfwY81a8=
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
Expand Down
2 changes: 1 addition & 1 deletion ciphers/secconf/sec_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"io/ioutil"

"github.com/fzerorubigd/onion"
"github.com/goraz/onion"
)

type cipher struct {
Expand Down
2 changes: 1 addition & 1 deletion cli/onioncli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Currently it can read/write data from file and etcd keys. also it support for en
## Installation

```
go get -u github.com/fzerorubigd/onion/cli/onioncli
go get -u github.com/goraz/onion/cli/onioncli
```

if you want to encrypt/decrypt data using PGP, you need to create a private/public key pair using gpg (or any other tool)
Expand Down
2 changes: 1 addition & 1 deletion cli/onioncli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"os"

"github.com/coreos/etcd/client"
"github.com/fzerorubigd/onion/ciphers/secconf"
"github.com/goraz/onion/ciphers/secconf"
"github.com/ogier/pflag"
)

Expand Down
8 changes: 4 additions & 4 deletions cli/onioncli/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/fzerorubigd/onion/cli/onioncli
module github.com/goraz/onion/cli/onioncli

go 1.13

Expand All @@ -9,10 +9,10 @@ require (
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/fzerorubigd/onion/ciphers/secconf v0.0.0-00010101000000-000000000000
github.com/gogo/protobuf v1.2.1 // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/goraz/onion/ciphers/secconf v0.0.0-20190706114413-1448341d7b2b
github.com/gorilla/websocket v1.4.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
Expand All @@ -32,6 +32,6 @@ require (
gopkg.in/yaml.v2 v2.2.2 // indirect
)

replace github.com/fzerorubigd/onion/ciphers/secconf => ../../ciphers/secconf
replace github.com/goraz/onion/ciphers/secconf => ../../ciphers/secconf

replace github.com/fzerorubigd/onion => ../../
replace github.com/goraz/onion => ../../
2 changes: 2 additions & 0 deletions cli/onioncli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4=
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
Expand Down Expand Up @@ -97,6 +98,7 @@ github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.0 h1:UVQPSSmc3qtTi+zPPkCXvZX9VvW/xT/NsRvKfwY81a8=
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module github.com/fzerorubigd/onion
module github.com/goraz/onion

go 1.13

require (
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c // indirect
github.com/mattn/goveralls v0.0.2 // indirect
github.com/smartystreets/assertions v1.0.0 // indirect
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRid
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/mattn/goveralls v0.0.2 h1:7eJB6EqsPhRVxvwEXGnqdO2sJI0PTsrWoTMXEk9/OQc=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.0 h1:UVQPSSmc3qtTi+zPPkCXvZX9VvW/xT/NsRvKfwY81a8=
Expand Down
2 changes: 1 addition & 1 deletion layers/etcdlayer/etcd_layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

goetcd "github.com/etcd-io/etcd/client"
"github.com/fzerorubigd/onion"
"github.com/goraz/onion"
)

type streamReload interface {
Expand Down
2 changes: 1 addition & 1 deletion layers/etcdlayer/etcd_layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/etcd-io/etcd/client"
"github.com/fzerorubigd/onion"
"github.com/goraz/onion"
. "github.com/smartystreets/goconvey/convey"
)

Expand Down
6 changes: 3 additions & 3 deletions layers/etcdlayer/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/fzerorubigd/onion/layers/etcdlayer
module github.com/goraz/onion/layers/etcdlayer

go 1.13

replace github.com/fzerorubigd/onion => ../../
replace github.com/goraz/onion => ../../

require (
github.com/coreos/bbolt v1.3.3 // indirect
Expand All @@ -12,10 +12,10 @@ require (
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/etcd-io/etcd v3.3.13+incompatible
github.com/fzerorubigd/onion v1.0.0
github.com/gogo/protobuf v1.2.1 // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/goraz/onion v0.0.0-20190706114413-1448341d7b2b
github.com/gorilla/websocket v1.4.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion layers/filewatchlayer/file_layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"

"github.com/fsnotify/fsnotify"
"github.com/fzerorubigd/onion"
"github.com/goraz/onion"
)

type streamReload interface {
Expand Down
2 changes: 1 addition & 1 deletion layers/filewatchlayer/file_layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"time"

"github.com/fzerorubigd/onion"
"github.com/goraz/onion"
. "github.com/smartystreets/goconvey/convey"
)

Expand Down
6 changes: 3 additions & 3 deletions layers/filewatchlayer/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/fzerorubigd/onion/layers/filewatchlayer
module github.com/goraz/onion/layers/filewatchlayer

go 1.13

replace github.com/fzerorubigd/onion => ../../
replace github.com/goraz/onion => ../../

require (
github.com/fsnotify/fsnotify v1.4.7
github.com/fzerorubigd/onion v1.0.0
github.com/goraz/onion v0.0.0-20190706114413-1448341d7b2b
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect
)
6 changes: 3 additions & 3 deletions layers/structlayer/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/fzerorubigd/onion/layers/structlayer
module github.com/goraz/onion/layers/structlayer

go 1.13

replace github.com/fzerorubigd/onion => ../../
replace github.com/goraz/onion => ../../

require (
github.com/fzerorubigd/onion v1.0.0
github.com/goraz/onion v0.0.0-20190706114413-1448341d7b2b
github.com/mitchellh/mapstructure v1.1.2
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a
)
2 changes: 1 addition & 1 deletion layers/structlayer/struct_layer.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package structlayer

import (
"github.com/fzerorubigd/onion"
"github.com/goraz/onion"
"github.com/mitchellh/mapstructure"
)

Expand Down
2 changes: 1 addition & 1 deletion layers/structlayer/struct_layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package structlayer
import (
"testing"

"github.com/fzerorubigd/onion"
"github.com/goraz/onion"
. "github.com/smartystreets/goconvey/convey"
)

Expand Down
6 changes: 3 additions & 3 deletions loaders/properties/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/fzerorubigd/onion/loaders/properties
module github.com/goraz/onion/loaders/properties

go 1.13

replace github.com/fzerorubigd/onion => ../../
replace github.com/goraz/onion => ../../

require (
github.com/fzerorubigd/onion v1.0.0
github.com/goraz/onion v0.0.0-20190706114413-1448341d7b2b
github.com/magiconair/properties v1.8.1
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a
)
4 changes: 2 additions & 2 deletions loaders/properties/properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// for using this package, just import it
//
// import (
// _ "github.com/fzerorubigd/onion/loaders/properties"
// _ "github.com/goraz/onion/loaders/properties"
// )
//
// There is no need to do anything else, if you load a file with toml
Expand All @@ -14,7 +14,7 @@ import (
"io"
"io/ioutil"

"github.com/fzerorubigd/onion"
"github.com/goraz/onion"
"github.com/magiconair/properties"
)

Expand Down
2 changes: 1 addition & 1 deletion loaders/properties/properties_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"testing"

. "github.com/fzerorubigd/onion"
. "github.com/goraz/onion"
. "github.com/smartystreets/goconvey/convey"
)

Expand Down

0 comments on commit 2334aea

Please sign in to comment.