Skip to content

Commit

Permalink
chore: rename to raystack
Browse files Browse the repository at this point in the history
  • Loading branch information
ravisuhag committed Jun 12, 2023
1 parent 471b7d3 commit aee7057
Show file tree
Hide file tree
Showing 24 changed files with 57 additions and 56 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# salt

[![GoDoc reference](https://img.shields.io/badge/godoc-reference-5272B4.svg)](https://godoc.org/github.com/odpf/salt)
![test workflow](https://github.com/odpf/salt/actions/workflows/test.yaml/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/odpf/salt)](https://goreportcard.com/report/github.com/odpf/salt)
[![GoDoc reference](https://img.shields.io/badge/godoc-reference-5272B4.svg)](https://godoc.org/github.com/raystack/salt)
![test workflow](https://github.com/raystack/salt/actions/workflows/test.yaml/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/raystack/salt)](https://goreportcard.com/report/github.com/raystack/salt)

Shared libraries used in the ODPF ecosystem. Use at your own risk. Breaking changes should be anticipated.
Shared libraries used in the Raystack ecosystem. Use at your own risk. Breaking changes should be anticipated.

## Installation

To use, run the following command:

```
go get github.com/odpf/salt
go get github.com/raystack/salt
```

## Pacakages
Expand Down
4 changes: 2 additions & 2 deletions audit/audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

"github.com/odpf/salt/audit"
"github.com/odpf/salt/audit/mocks"
"github.com/raystack/salt/audit"
"github.com/raystack/salt/audit/mocks"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
)
Expand Down
2 changes: 1 addition & 1 deletion audit/mocks/repository.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions audit/repositories/dockertest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"time"

_ "github.com/lib/pq"
"github.com/odpf/salt/audit/repositories"
"github.com/odpf/salt/log"
"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
"github.com/raystack/salt/audit/repositories"
"github.com/raystack/salt/log"
)

func newTestRepository(logger log.Logger) (*repositories.PostgresRepository, *dockertest.Pool, *dockertest.Resource, error) {
Expand Down
2 changes: 1 addition & 1 deletion audit/repositories/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/jmoiron/sqlx/types"
"github.com/odpf/salt/audit"
"github.com/raystack/salt/audit"
)

type AuditModel struct {
Expand Down
6 changes: 3 additions & 3 deletions audit/repositories/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/jmoiron/sqlx/types"
"github.com/odpf/salt/audit"
"github.com/odpf/salt/audit/repositories"
"github.com/odpf/salt/log"
"github.com/raystack/salt/audit"
"github.com/raystack/salt/audit/repositories"
"github.com/raystack/salt/log"
"github.com/stretchr/testify/suite"
)

Expand Down
16 changes: 8 additions & 8 deletions cmdx/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
"github.com/spf13/pflag"
"gopkg.in/yaml.v3"

"github.com/odpf/salt/config"
"github.com/raystack/salt/config"
)

const (
ODPF_CONFIG_DIR = "ODPF_CONFIG_DIR"
XDG_CONFIG_HOME = "XDG_CONFIG_HOME"
APP_DATA = "AppData"
LOCAL_APP_DATA = "LocalAppData"
RAYSTACK_CONFIG_DIR = "RAYSTACK_CONFIG_DIR"
XDG_CONFIG_HOME = "XDG_CONFIG_HOME"
APP_DATA = "AppData"
LOCAL_APP_DATA = "LocalAppData"
)

type ConfigLoaderOpt func(c *Config)
Expand Down Expand Up @@ -71,7 +71,7 @@ func (c *Config) Write(cfg interface{}) error {
}

if _, err := os.Stat(c.filename); os.IsNotExist(err) {
_ = os.MkdirAll(configDir("odpf"), 0700)
_ = os.MkdirAll(configDir("raystack"), 0700)
}

if err := os.WriteFile(c.filename, data, 0655); err != nil {
Expand Down Expand Up @@ -101,12 +101,12 @@ func (c *Config) Load(cfg interface{}, opts ...ConfigLoaderOpt) error {

func configFile(app string) string {
file := app + ".yml"
return filepath.Join(configDir("odpf"), file)
return filepath.Join(configDir("raystack"), file)
}

func configDir(root string) string {
var path string
if a := os.Getenv(ODPF_CONFIG_DIR); a != "" {
if a := os.Getenv(RAYSTACK_CONFIG_DIR); a != "" {
path = a
} else if b := os.Getenv(XDG_CONFIG_HOME); b != "" {
path = filepath.Join(b, root)
Expand Down
2 changes: 1 addition & 1 deletion cmdx/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"strings"

"github.com/odpf/salt/printer"
"github.com/raystack/salt/printer"
"github.com/spf13/cobra"
)

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

commonv1 "go.buf.build/odpf/gw/odpf/proton/odpf/common/v1"
commonv1 "go.buf.build/raystack/gw/raystack/proton/raystack/common/v1"
)

type CommonService struct {
Expand Down
17 changes: 9 additions & 8 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"encoding/json"
"fmt"

"github.com/odpf/salt/config"
"github.com/raystack/salt/config"
)

type Config struct {
Expand Down Expand Up @@ -56,12 +56,12 @@ In the above program a YAML file or environment variables can be used to configu
```yaml
port: 9000
db:
port: 5432
host: db-host-yaml
port: 5432
host: db-host-yaml
new_relic:
enabled: true
app_name: config-test-yaml
license: ____LICENSE_STRING_OF_40_CHARACTERS_____
enabled: true
app_name: config-test-yaml
license: ____LICENSE_STRING_OF_40_CHARACTERS_____
log_level: debug
```

Expand All @@ -82,5 +82,6 @@ or a mix of both.
**Configs set in environment will override the ones set as default and in yaml file.**

## TODO
- function to print/return config keys in yaml path and env format with defaults as helper
- add support for flags

- function to print/return config keys in yaml path and env format with defaults as helper
- add support for flags
2 changes: 1 addition & 1 deletion db/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"time"

"github.com/jmoiron/sqlx"
"github.com/odpf/salt/db"
"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
"github.com/raystack/salt/db"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion db/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"testing"

"github.com/odpf/salt/db"
"github.com/raystack/salt/db"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion dockertestx/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/google/uuid"
"github.com/jmoiron/sqlx"
"github.com/odpf/salt/log"
"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
"github.com/raystack/salt/log"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/odpf/salt
module github.com/raystack/salt

go 1.16

Expand Down Expand Up @@ -38,7 +38,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.8.0
go.buf.build/odpf/gw/odpf/proton v1.1.9
go.buf.build/raystack/gw/raystack/proton v1.1.9
go.uber.org/zap v1.19.0
golang.org/x/net v0.0.0-20220919232410-f2f64ebce3c1 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1265,10 +1265,10 @@ github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPS
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE=
go.buf.build/odpf/gw/grpc-ecosystem/grpc-gateway v1.1.35 h1:d5dMyaXBowF98Oylwhyr4eM1yB17UWWTuoSEk5WRrMM=
go.buf.build/odpf/gw/grpc-ecosystem/grpc-gateway v1.1.35/go.mod h1:/LuddrGPi0fwj7ay6Orutt8oFfPz8Y3c8qdBkacJq1A=
go.buf.build/odpf/gw/odpf/proton v1.1.9 h1:iEdRUVVc/HwOqB7WRXjhXjR2pza2gyUbQ74G2sBlWHU=
go.buf.build/odpf/gw/odpf/proton v1.1.9/go.mod h1:I9E8CF7w/690vRNWqBU6qDcUbi3Pi2THdn1yycBVTDQ=
go.buf.build/raystack/gw/grpc-ecosystem/grpc-gateway v1.1.35 h1:d5dMyaXBowF98Oylwhyr4eM1yB17UWWTuoSEk5WRrMM=
go.buf.build/raystack/gw/grpc-ecosystem/grpc-gateway v1.1.35/go.mod h1:/LuddrGPi0fwj7ay6Orutt8oFfPz8Y3c8qdBkacJq1A=
go.buf.build/raystack/gw/raystack/proton v1.1.9 h1:iEdRUVVc/HwOqB7WRXjhXjR2pza2gyUbQ74G2sBlWHU=
go.buf.build/raystack/gw/raystack/proton v1.1.9/go.mod h1:I9E8CF7w/690vRNWqBU6qDcUbi3Pi2THdn1yycBVTDQ=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
Expand Down
2 changes: 1 addition & 1 deletion log/logrus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/sirupsen/logrus"

"github.com/odpf/salt/log"
"github.com/raystack/salt/log"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion log/zap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

"go.uber.org/zap"

"github.com/odpf/salt/log"
"github.com/raystack/salt/log"
)

type zapBufWriter struct {
Expand Down
6 changes: 3 additions & 3 deletions mux/_example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"time"

"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/odpf/salt/common"
"github.com/odpf/salt/mux"
commonv1 "go.buf.build/odpf/gw/odpf/proton/odpf/common/v1"
"github.com/raystack/salt/common"
"github.com/raystack/salt/mux"
commonv1 "go.buf.build/raystack/gw/raystack/proton/raystack/common/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
)
Expand Down
2 changes: 1 addition & 1 deletion oidc/_example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"

"github.com/odpf/salt/oidc"
"github.com/raystack/salt/oidc"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion printer/spinner.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"

"github.com/briandowns/spinner"
"github.com/odpf/salt/term"
"github.com/raystack/salt/term"
)

type Indicator struct {
Expand Down
2 changes: 1 addition & 1 deletion printer/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package printer
import (
"fmt"

"github.com/odpf/salt/term"
"github.com/raystack/salt/term"
)

func Success(t ...string) {
Expand Down
6 changes: 3 additions & 3 deletions server/example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
grpc_ctxtags "github.com/grpc-ecosystem/go-grpc-middleware/tags"
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"github.com/odpf/salt/common"
"github.com/odpf/salt/server"
commonv1 "go.buf.build/odpf/gw/odpf/proton/odpf/common/v1"
"github.com/raystack/salt/common"
"github.com/raystack/salt/server"
commonv1 "go.buf.build/raystack/gw/raystack/proton/raystack/common/v1"
"go.uber.org/zap"
"google.golang.org/grpc"
)
Expand Down
4 changes: 2 additions & 2 deletions version/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Info struct {

// ReleaseInfo fetches details related to provided release URL
// releaseURL should point to a specific version
// for example: https://api.github.com/repos/odpf/optimus/releases/latest
// for example: https://api.github.com/repos/raystack/optimus/releases/latest
func ReleaseInfo(releaseURL string) (*Info, error) {
httpClient := http.Client{
Timeout: ReleaseInfoTimeout,
Expand All @@ -32,7 +32,7 @@ func ReleaseInfo(releaseURL string) (*Info, error) {
if err != nil {
return nil, errors.Wrapf(err, "failed to create request")
}
req.Header.Set("User-Agent", "odpf/salt")
req.Header.Set("User-Agent", "raystack/salt")
resp, err := httpClient.Do(req)
if err != nil {
return nil, errors.Wrapf(err, "failed to reach releaseURL: %s", releaseURL)
Expand Down
4 changes: 2 additions & 2 deletions version/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

"github.com/gorilla/mux"
"github.com/odpf/salt/version"
"github.com/raystack/salt/version"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -98,7 +98,7 @@ func TestUpdateNotice(t *testing.T) {
res, err := version.IsCurrentLatest("v0.0.1", info.Version)
assert.Nil(t, err)
assert.True(t, res)
s := version.UpdateNotice("v0.0.1", "odpf/optimus")
s := version.UpdateNotice("v0.0.1", "raystack/optimus")
assert.NotEqual(t, "v0.0.1", s)
})
}

0 comments on commit aee7057

Please sign in to comment.