diff --git a/.github/workflows/release-js-client.yml b/.github/workflows/release-js-client.yml index 417eca4d..370dd5f0 100644 --- a/.github/workflows/release-js-client.yml +++ b/.github/workflows/release-js-client.yml @@ -14,7 +14,7 @@ jobs: with: node-version: "12.x" registry-url: "https://registry.npmjs.org" - scope: "@odpf" + scope: "@raystack" - run: npm install working-directory: clients/js - run: npm publish --access public diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 1386f300..56d97691 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -12,9 +12,9 @@ builds: flags: - -a ldflags: - - -X github.com/odpf/stencil/config.Version={{.Tag}} - - -X github.com/odpf/stencil/config.BuildCommit={{.FullCommit}} - - -X github.com/odpf/stencil/config.BuildDate={{.Date}} + - -X github.com/raystack/stencil/config.Version={{.Tag}} + - -X github.com/raystack/stencil/config.BuildCommit={{.FullCommit}} + - -X github.com/raystack/stencil/config.BuildDate={{.Date}} goos: [darwin, linux, windows] goarch: [amd64, 386, arm, arm64] env: @@ -48,13 +48,13 @@ dockers: - stencil dockerfile: Dockerfile image_templates: - - "docker.io/odpf/{{.ProjectName}}:latest" - - "docker.io/odpf/{{.ProjectName}}:{{ .Version }}" - - "docker.io/odpf/{{.ProjectName}}:{{ .Tag }}-amd64" + - "docker.io/raystack/{{.ProjectName}}:latest" + - "docker.io/raystack/{{.ProjectName}}:{{ .Version }}" + - "docker.io/raystack/{{.ProjectName}}:{{ .Tag }}-amd64" nfpms: - maintainer: ODPF description: Schema registry - homepage: https://github.com/odpf/stencil + homepage: https://github.com/raystack/stencil license: Apache 2.0 formats: - deb @@ -63,17 +63,17 @@ nfpms: darwin: macOS scoop: bucket: - owner: odpf + owner: raystack name: scoop-bucket - homepage: "https://github.com/odpf/stencil" + homepage: "https://github.com/raystack/stencil" description: "Schema registry" license: Apache 2.0 brews: - name: stencil - homepage: "https://github.com/odpf/stencil" + homepage: "https://github.com/raystack/stencil" description: "Schema registry" tap: - owner: odpf + owner: raystack name: homebrew-tap license: "Apache 2.0" folder: Formula diff --git a/Makefile b/Makefile index d4ddcdfc..83def328 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -NAME="github.com/odpf/stencil" +NAME="github.com/raystack/stencil" VERSION=$(shell git describe --always --tags 2>/dev/null) PROTON_COMMIT := "a6c7056fa80128145d00d5ee72f216c28578ec43" @@ -22,9 +22,9 @@ lint: ## Run golang-ci lint golangci-lint run proto: ## Generate the protobuf files - @echo " > generating protobuf from odpf/proton" + @echo " > generating protobuf from raystack/proton" @echo " > [info] make sure correct version of dependencies are installed using 'make install'" - @buf generate https://github.com/odpf/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --template buf.gen.yaml --path odpf/stencil + @buf generate https://github.com/raystack/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --template buf.gen.yaml --path raystack/stencil @echo " > protobuf compilation finished" clean: ## Clean the build artifacts diff --git a/README.md b/README.md index 32eaa5e3..df28fba8 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Ideally, you should install it somewhere in your PATH for easy use. `/usr/local/ `stencil` is available via a Homebrew Tap, and as downloadable binary from the [releases](https://github.com/raystack/stencil/releases/latest) page: ```sh -brew install odpf/tap/stencil +brew install raystack/tap/stencil ``` To upgrade to the latest version: @@ -75,13 +75,13 @@ scoop update stencil We provide ready to use Docker container images. To pull the latest image: ```sh -docker pull odpf/stencil:latest +docker pull raystack/stencil:latest ``` To pull a specific version: ```sh -docker pull odpf/stencil:v0.3.3 +docker pull raystack/stencil:v0.3.3 ``` ## Usage diff --git a/buf.gen.yaml b/buf.gen.yaml index fdbea520..98ec91f0 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -6,7 +6,7 @@ plugins: - name: go-grpc out: ./proto opt: paths=source_relative - - remote: buf.build/odpf/plugins/validate + - remote: buf.build/raystack/plugins/validate out: "proto" opt: "paths=source_relative,lang=go" - name: grpc-gateway diff --git a/clients/clojure/README.md b/clients/clojure/README.md index 5c641bf8..85f60a42 100644 --- a/clients/clojure/README.md +++ b/clients/clojure/README.md @@ -7,7 +7,7 @@ A Clojure library designed to easily encode and decode protobuf messages by usin Add the below dependency to your `project.clj` file: ```clj - [io.odpf/stencil-clj "0.3.3"] + [org.raystack/stencil-clj "0.3.3"] ``` ## Usage @@ -20,7 +20,7 @@ syntax = "proto3"; package example; option java_multiple_files = true; -option java_package = "io.odpf.CljTest"; +option java_package = "org.raystack.CljTest"; message Address { string city = 1; @@ -60,7 +60,7 @@ message Person { (:require [stencil.core :refer [serialize]]) (def serialized-data - (serialize client "io.odpf.CljTest" {:name "Foo" + (serialize client "org.raystack.CljTest" {:name "Foo" :address {:street "bar"} :email-list ["a@example.com" "b@b.com"] :gender :NON-BINARY @@ -72,7 +72,7 @@ message Person { ```clojure (:require [stencil.core :refer [deserialize]]) -(deserialize client "io.odpf.CljTest" serialized-data) +(deserialize client "org.raystack.CljTest" serialized-data) ;; prints ;; {:name "Foo" ;; :address {:street "bar"} @@ -88,7 +88,7 @@ message Person { | field names | keywords in kebab case | `name` -> `:name`, `field_name` -> `:field-name` | | scalar fields | Values follow [protobuf-java scalar value mappings](https://developers.google.com/protocol-buffers/docs/proto3#scalar) | | | enums | Values converted as keywords of enum's original value | `UNKNOWN` -> `:UNKNOWN` | -| messages | clojure map | `message Hello {string name = 1;}` -> {:name "odpf"} | +| messages | clojure map | `message Hello {string name = 1;}` -> {:name "raystack"} | | repeated fields | clojure vector | | | one-of fields | treated as regular fields | if two fields are set that are part of one-of, last seen value is considered while serializing data | | map | map values follow it's [wire representation](https://developers.google.com/protocol-buffers/docs/proto3#backwards_compatibility) | for `map` type, example value will be `[{:key "key" :value "value"}]` | @@ -155,7 +155,7 @@ Serialize will throw error in following cases ```clojure (let [client (create-client sample-client-config) - proto-package "io.odpf.stencil_clj_test" + proto-package "org.raystack.stencil_clj_test" proto-class-name "Scalar" fully-qualified-proto-name (str proto-package "." proto-class-name)] (get-descriptor client fully-qualified-proto-name)) @@ -183,7 +183,7 @@ Serialize will throw error in following cases ```clojure (let [client (create-client sample-client-config) - proto-package "io.odpf.stencil_clj_test" + proto-package "org.raystack.stencil_clj_test" proto-class-name "Scalar" fully-qualified-proto-name (str proto-package "." proto-class-name) proto-desc (get-descriptor client fully-qualified-proto-name) @@ -213,7 +213,7 @@ Serialize will throw error in following cases ```clojure (let [client (create-client sample-client-config) - proto-package "io.odpf.stencil_clj_test" + proto-package "org.raystack.stencil_clj_test" proto-class-name "Scalar" fully-qualified-proto-name (str proto-package "." proto-class-name) proto-desc (get-descriptor client fully-qualified-proto-name)] diff --git a/clients/clojure/project.clj b/clients/clojure/project.clj index 00db73d2..9681e77c 100644 --- a/clients/clojure/project.clj +++ b/clients/clojure/project.clj @@ -1,10 +1,10 @@ -(defproject io.odpf/stencil-clj "0.3.3" +(defproject org.raystack/stencil-clj "0.3.3" :description "Stencil client for clojure" - :url "https://github.com/odpf/stencil" + :url "https://github.com/raystack/stencil" :license {:name "Apache 2.0" :url "https://www.apache.org/licenses/LICENSE-2.0"} :dependencies [[org.clojure/clojure "1.10.3"] - [io.odpf/stencil "0.2.1"]] + [org.raystack/stencil "0.2.1"]] :plugins [[lein-cljfmt "0.7.0"]] :global-vars {*warn-on-reflection* true} :source-paths ["src"] diff --git a/clients/clojure/src/stencil/core.clj b/clients/clojure/src/stencil/core.clj index 172b092b..bd735a0f 100644 --- a/clients/clojure/src/stencil/core.clj +++ b/clients/clojure/src/stencil/core.clj @@ -2,11 +2,11 @@ (:require [stencil.encode :refer [map->bytes]] [stencil.decode :refer [bytes->map]]) (:import - (io.odpf.stencil.client StencilClient) - (io.odpf.stencil StencilClientFactory) - (io.odpf.stencil.cache SchemaRefreshStrategy) - (io.odpf.stencil.exception StencilRuntimeException) - (io.odpf.stencil.config StencilConfig) + (org.raystack.stencil.client StencilClient) + (org.raystack.stencil StencilClientFactory) + (org.raystack.stencil.cache SchemaRefreshStrategy) + (org.raystack.stencil.exception StencilRuntimeException) + (org.raystack.stencil.config StencilConfig) (org.apache.http.message BasicHeader) (java.util ArrayList))) (defn create-client diff --git a/clients/clojure/test/stencil/core_test.clj b/clients/clojure/test/stencil/core_test.clj index 84b70d1c..1580baf0 100644 --- a/clients/clojure/test/stencil/core_test.clj +++ b/clients/clojure/test/stencil/core_test.clj @@ -2,11 +2,11 @@ (:require [clojure.test :refer :all] [stencil.core :refer :all]) (:import - (io.odpf.stencil.client StencilClient))) + (org.raystack.stencil.client StencilClient))) (deftest test-create-client (testing "should create client" - (let [config {:url "http://localhost:8000/v1beta1/namespaces/odpf/schemas/proton" + (let [config {:url "http://localhost:8000/v1beta1/namespaces/raystack/schemas/proton" :refresh-ttl 100 :request-timeout 10000 :request-backoff-time 100 diff --git a/clients/clojure/test/stencil/serde_test.clj b/clients/clojure/test/stencil/serde_test.clj index 119abfee..3f0f105c 100644 --- a/clients/clojure/test/stencil/serde_test.clj +++ b/clients/clojure/test/stencil/serde_test.clj @@ -3,7 +3,7 @@ [stencil.encode :refer [map->bytes]] [stencil.decode :refer [bytes->map]]) (:import - (io.odpf.stencil DescriptorMapBuilder) + (org.raystack.stencil DescriptorMapBuilder) (java.io File FileInputStream))) (defn file-desc-map [^String path] @@ -81,7 +81,7 @@ (deftest serialization-deserialization-test (testing "should handle scalar types" - (let [proto-name "io.odpf.stencil_clj_test.Scalar" + (let [proto-name "org.raystack.stencil_clj_test.Scalar" descriptor (local-get-descriptor proto-name) serialized-data (map->bytes descriptor scalar-data) deserialized-data (bytes->map descriptor serialized-data)] @@ -89,10 +89,10 @@ (is (= (seq (:field-bytes deserialized-data)) (seq (:field-bytes scalar-data)))))) (testing "should handle enum type if enum value is by name" - (verify "io.odpf.stencil_clj_test.SimpleNested" {:field-name :VALUE-1})) + (verify "org.raystack.stencil_clj_test.SimpleNested" {:field-name :VALUE-1})) (testing "should handle enum type if enum value is by number" - (let [proto-name "io.odpf.stencil_clj_test.SimpleNested" + (let [proto-name "org.raystack.stencil_clj_test.SimpleNested" descriptor (local-get-descriptor proto-name) test-data {:field-name 2} serialized-data (map->bytes descriptor test-data) @@ -100,33 +100,33 @@ (is (= deserialized-data {:field-name :VALUE-2})))) (testing "should deserialize message type field" - (verify "io.odpf.stencil_clj_test.SimpleNested" simple-nested)) + (verify "org.raystack.stencil_clj_test.SimpleNested" simple-nested)) (testing "should handle struct and map types" - (verify "io.odpf.stencil_clj_test.ComplexTypes" complex-types)) + (verify "org.raystack.stencil_clj_test.ComplexTypes" complex-types)) (testing "should handle repeated fields" - (verify "io.odpf.stencil_clj_test.SimpleArray" simple-array)) + (verify "org.raystack.stencil_clj_test.SimpleArray" simple-array)) (testing "should handle self referencing types" - (verify "io.odpf.stencil_clj_test.Recursive" recursive-data)) + (verify "org.raystack.stencil_clj_test.Recursive" recursive-data)) (testing "should handle wrapper types" - (verify "io.odpf.stencil_clj_test.Wrappers" wrapper-data)) + (verify "org.raystack.stencil_clj_test.Wrappers" wrapper-data)) (testing "should throw error if unknown field is present" - (try (verify "io.odpf.stencil_clj_test.Scalar" {:x "test"}) + (try (verify "org.raystack.stencil_clj_test.Scalar" {:x "test"}) (catch Exception e (is (= {:cause :unknown-field, :info {:field-name :x}} (ex-data e)))))) (testing "should throw error if enum value is invalid" - (try (verify "io.odpf.stencil_clj_test.SimpleArray" {:groups [:invalid :UNKNOWN]}) + (try (verify "org.raystack.stencil_clj_test.SimpleArray" {:groups [:invalid :UNKNOWN]}) (catch Exception e (is (= {:cause :unknown-enum-value :info {:field-name :invalid}} (ex-data e)))))) (testing "should throw error if non array value assigned to repeated(array) field" - (try (verify "io.odpf.stencil_clj_test.SimpleArray" {:groups :UNKNOWN}) + (try (verify "org.raystack.stencil_clj_test.SimpleArray" {:groups :UNKNOWN}) (catch Exception e (is (= {:cause :not-a-collection :info {:value :UNKNOWN}} (ex-data e))))))) diff --git a/clients/clojure/test/stencil/testdata/one.proto b/clients/clojure/test/stencil/testdata/one.proto index 69672f16..631acbe4 100644 --- a/clients/clojure/test/stencil/testdata/one.proto +++ b/clients/clojure/test/stencil/testdata/one.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package io.odpf.stencil_clj_test; +package org.raystack.stencil_clj_test; option java_multiple_files = true; -option java_package = "io.odpf.stencil_clj_test"; +option java_package = "org.raystack.stencil_clj_test"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; diff --git a/clients/go/LICENSE b/clients/go/LICENSE index 593b6302..f74f50bd 100644 --- a/clients/go/LICENSE +++ b/clients/go/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [2021] [odpf] + Copyright [2021] [raystack] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/clients/go/README.md b/clients/go/README.md index cf2608b0..16af2a62 100644 --- a/clients/go/README.md +++ b/clients/go/README.md @@ -1,31 +1,32 @@ # Stencil go client - -[![Go Reference](https://pkg.go.dev/badge/github.com/odpf/stencil/clients/go.svg)](https://pkg.go.dev/github.com/odpf/stencil/clients/go) +[![Go Reference](https://pkg.go.dev/badge/github.com/raystack/stencil/clients/go.svg)](https://pkg.go.dev/github.com/raystack/stencil/clients/go) Stencil go client package provides a store to lookup protobuf descriptors and options to keep the protobuf descriptors upto date. It has following features - - Deserialize protobuf messages directly by specifying protobuf message name - - Serialize data by specifying protobuf message name - - Ability to refresh protobuf descriptors in specified intervals - - Support to download descriptors from multiple urls +- Deserialize protobuf messages directly by specifying protobuf message name +- Serialize data by specifying protobuf message name +- Ability to refresh protobuf descriptors in specified intervals +- Support to download descriptors from multiple urls ## Requirements - - go 1.16 +- go 1.16 ## Installation Use `go get` + ``` -go get github.com/odpf/stencil/clients/go +go get github.com/raystack/stencil/clients/go ``` Then import the stencil package into your own code as mentioned below + ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" ``` ## Usage @@ -33,15 +34,16 @@ import stencil "github.com/odpf/stencil/clients/go" ### Creating a client ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://localhost:8000/v1beta1/namespaces/{test-namespace}/schemas/{schema-name}" client, err := stencil.NewClient([]string{url}, stencil.Options{}) ``` ### Get Descriptor + ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://localhost:8000/v1beta1/namespaces/{test-namespace}/schemas/{schema-name}" client, err := stencil.NewClient([]string{url}, stencil.Options{}) @@ -51,9 +53,10 @@ if err != nil { desc, err := client.GetDescriptor("google.protobuf.DescriptorProto") ``` -### Parse protobuf message. +### Parse protobuf message. + ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://localhost:8000/v1beta1/namespaces/{test-namespace}/schemas/{schema-name}" client, err := stencil.NewClient([]string{url}, stencil.Options{}) @@ -65,8 +68,9 @@ parsedMsg, err := client.Parse("google.protobuf.DescriptorProto", data) ``` ### Serialize data. + ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://url/to/proto/descriptorset/file" client, err := stencil.NewClient([]string{url}, stencil.Options{}) @@ -78,8 +82,9 @@ serializedMsg, err := client.Serialize("google.protobuf.DescriptorProto", data) ``` ### Enable auto refresh of schemas + ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://localhost:8000/v1beta1/namespaces/{test-namespace}/schemas/{schema-name}" // Configured to refresh schema every 12 hours @@ -91,8 +96,9 @@ desc, err := client.GetDescriptor("google.protobuf.DescriptorProto") ``` ### Using VersionBasedRefresh strategy + ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://localhost:8000/v1beta1/namespaces/{test-namespace}/schemas/{schema-name}" // Configured to refresh schema every 12 hours @@ -102,4 +108,5 @@ if err != nil { } desc, err := client.GetDescriptor("google.protobuf.DescriptorProto") ``` -Refer to [go documentation](https://pkg.go.dev/github.com/odpf/stencil/clients/go) for all available methods and options. + +Refer to [go documentation](https://pkg.go.dev/github.com/raystack/stencil/clients/go) for all available methods and options. diff --git a/clients/go/client_test.go b/clients/go/client_test.go index 3e105c79..83574c4c 100644 --- a/clients/go/client_test.go +++ b/clients/go/client_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - stencil "github.com/odpf/stencil/clients/go" + stencil "github.com/raystack/stencil/clients/go" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" diff --git a/clients/go/go.mod b/clients/go/go.mod index 07089e43..4e6bd8fe 100644 --- a/clients/go/go.mod +++ b/clients/go/go.mod @@ -1,4 +1,4 @@ -module github.com/odpf/stencil/clients/go +module github.com/raystack/stencil/clients/go go 1.16 diff --git a/clients/java/README.md b/clients/java/README.md index 0006ac90..38ddf98b 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -16,14 +16,14 @@ Protobuf allows you to define a protobuf file using DescriptorSet. A FileDescrip #### Gradle ```groovy - implementation group: 'io.odpf', name: 'stencil', version: '0.3.3' + implementation group: 'org.raystack', name: 'stencil', version: '0.3.3' ``` #### Maven ```xml - io.odpf + org.raystack stencil 0.1.6 @@ -36,8 +36,8 @@ Stencil client can be created in different modes. #### Loading Descriptor from Protobuf Class available in the classpath ```java -import io.odpf.stencil.client.StencilClient; -import io.odpf.stencil.StencilClientFactory; +import org.raystack.stencil.client.StencilClient; +import org.raystack.stencil.StencilClientFactory; StencilClient stencilClient = StencilClientFactory.getClient(); ``` @@ -45,7 +45,7 @@ StencilClient stencilClient = StencilClientFactory.getClient(); #### Create client with remote URL ```java -import io.odpf.stencil.config.StencilConfig; +import org.raystack.stencil.config.StencilConfig; String url = "http://url/to/proto/descriptor-set/file"; StencilClient stencilClient = StencilClientFacorty.getClient(url, StencilConfig.builder().build()); @@ -54,7 +54,7 @@ StencilClient stencilClient = StencilClientFacorty.getClient(url, StencilConfig. #### Creating MultiURL client ```java -import io.odpf.stencil.config.StencilConfig; +import org.raystack.stencil.config.StencilConfig; ArrayList urls = new ArrayList(); urls.add("http://localhost:8082/v1beta1/..."); @@ -77,7 +77,7 @@ StencilClient stencilClient = StencilClientFactory.getClient(url, StencilConfig. Whenever schema has changed this listener will be called. ```java -import io.odpf.stencil.SchemaUpdateListener; +import org.raystack.stencil.SchemaUpdateListener; SchemaUpdateListener updateListener = new SchemaUpdateListenerImpl(); StencilClient stencilClient = StencilClientFactory.getClient(url, StencilConfig.builder().updateListener(updateListener).build()); @@ -88,7 +88,7 @@ StencilClient stencilClient = StencilClientFactory.getClient(url, StencilConfig. If url belongs to stencil server, client can choose to refresh schema data only if there is a new version available. ```java -import io.odpf.stencil.cache.SchemaRefreshStrategy; +import org.raystack.stencil.cache.SchemaRefreshStrategy; StencilConfig config = StencilConfig.builder().refreshStrategy(SchemaRefreshStrategy.versionBasedRefresh()).build(); StencilClient stencilClient = StencilClientFactory.getClient(url, config); @@ -134,7 +134,7 @@ DynamicMessage message = DynamicMessage.parseFrom(descriptor, bytes); #### Using Parser interface ```java -import io.odpf.stencil.Parser; +import org.raystack.stencil.Parser; import com.google.protobuf.DynamicMessage; Parser protoParser = stencilClient.getParser("com.example.proto.schema"); diff --git a/clients/java/build.gradle b/clients/java/build.gradle index e43496f7..8510d175 100644 --- a/clients/java/build.gradle +++ b/clients/java/build.gradle @@ -9,7 +9,7 @@ plugins { id "io.github.gradle-nexus.publish-plugin" version "1.1.0" } -group 'io.odpf' +group 'org.raystack' version '0.3.2' repositories { @@ -75,10 +75,10 @@ publishing { pom { name = 'Stencil' description = 'Library to pull latest proto descriptors from a remote server' - url = 'https://github.com/odpf/stencil' + url = 'https://github.com/raystack/stencil' scm { - url = 'https://github.com/odpf/stencil.git' + url = 'https://github.com/raystack/stencil.git' } licenses { diff --git a/clients/java/src/main/java/io/odpf/stencil/DescriptorMapBuilder.java b/clients/java/src/main/java/io/odpf/stencil/DescriptorMapBuilder.java index f2398c39..429af8f6 100644 --- a/clients/java/src/main/java/io/odpf/stencil/DescriptorMapBuilder.java +++ b/clients/java/src/main/java/io/odpf/stencil/DescriptorMapBuilder.java @@ -1,4 +1,4 @@ -package io.odpf.stencil; +package org.raystack.stencil; import com.google.protobuf.DescriptorProtos; import com.google.protobuf.Descriptors; @@ -6,8 +6,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.odpf.stencil.exception.StencilRuntimeException; -import io.odpf.stencil.http.RemoteFile; +import org.raystack.stencil.exception.StencilRuntimeException; +import org.raystack.stencil.http.RemoteFile; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/clients/java/src/main/java/io/odpf/stencil/Parser.java b/clients/java/src/main/java/io/odpf/stencil/Parser.java index e085e2cd..7c9781b4 100644 --- a/clients/java/src/main/java/io/odpf/stencil/Parser.java +++ b/clients/java/src/main/java/io/odpf/stencil/Parser.java @@ -1,4 +1,4 @@ -package io.odpf.stencil; +package org.raystack.stencil; import com.google.protobuf.DynamicMessage; import com.google.protobuf.InvalidProtocolBufferException; diff --git a/clients/java/src/main/java/io/odpf/stencil/SchemaUpdateListener.java b/clients/java/src/main/java/io/odpf/stencil/SchemaUpdateListener.java index 7384f56e..d9a2260f 100644 --- a/clients/java/src/main/java/io/odpf/stencil/SchemaUpdateListener.java +++ b/clients/java/src/main/java/io/odpf/stencil/SchemaUpdateListener.java @@ -1,4 +1,4 @@ -package io.odpf.stencil; +package org.raystack.stencil; import java.util.Map; import com.google.protobuf.Descriptors; diff --git a/clients/java/src/main/java/io/odpf/stencil/StencilClientFactory.java b/clients/java/src/main/java/io/odpf/stencil/StencilClientFactory.java index 4347fa8f..834311e4 100644 --- a/clients/java/src/main/java/io/odpf/stencil/StencilClientFactory.java +++ b/clients/java/src/main/java/io/odpf/stencil/StencilClientFactory.java @@ -1,22 +1,22 @@ -package io.odpf.stencil; +package org.raystack.stencil; -import io.odpf.stencil.cache.SchemaCacheLoader; -import io.odpf.stencil.client.ClassLoadStencilClient; -import io.odpf.stencil.client.MultiURLStencilClient; -import io.odpf.stencil.client.StencilClient; -import io.odpf.stencil.client.URLStencilClient; -import io.odpf.stencil.config.StencilConfig; -import io.odpf.stencil.http.RemoteFileImpl; -import io.odpf.stencil.http.RetryHttpClient; +import org.raystack.stencil.cache.SchemaCacheLoader; +import org.raystack.stencil.client.ClassLoadStencilClient; +import org.raystack.stencil.client.MultiURLStencilClient; +import org.raystack.stencil.client.StencilClient; +import org.raystack.stencil.client.URLStencilClient; +import org.raystack.stencil.config.StencilConfig; +import org.raystack.stencil.http.RemoteFileImpl; +import org.raystack.stencil.http.RetryHttpClient; import java.util.List; /** - * Provides static methods for the creation of {@link io.odpf.stencil.client.StencilClient} + * Provides static methods for the creation of {@link org.raystack.stencil.client.StencilClient} * object with configurations and various options like * single URLs, multiple URLs, statsd client for monitoring - * and {@link io.odpf.stencil.SchemaUpdateListener} for callback on schema change. + * and {@link org.raystack.stencil.SchemaUpdateListener} for callback on schema change. */ public class StencilClientFactory { /** diff --git a/clients/java/src/main/java/io/odpf/stencil/cache/SchemaCacheLoader.java b/clients/java/src/main/java/io/odpf/stencil/cache/SchemaCacheLoader.java index 24451711..34fbed40 100644 --- a/clients/java/src/main/java/io/odpf/stencil/cache/SchemaCacheLoader.java +++ b/clients/java/src/main/java/io/odpf/stencil/cache/SchemaCacheLoader.java @@ -1,4 +1,4 @@ -package io.odpf.stencil.cache; +package org.raystack.stencil.cache; import com.google.common.cache.CacheLoader; import com.google.common.util.concurrent.Futures; @@ -6,10 +6,10 @@ import com.google.common.util.concurrent.ListenableFutureTask; import com.google.protobuf.Descriptors; import com.timgroup.statsd.StatsDClient; -import io.odpf.stencil.DescriptorMapBuilder; -import io.odpf.stencil.SchemaUpdateListener; -import io.odpf.stencil.config.StencilConfig; -import io.odpf.stencil.http.RemoteFile; +import org.raystack.stencil.DescriptorMapBuilder; +import org.raystack.stencil.SchemaUpdateListener; +import org.raystack.stencil.config.StencilConfig; +import org.raystack.stencil.http.RemoteFile; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/clients/java/src/main/java/io/odpf/stencil/cache/SchemaRefreshStrategy.java b/clients/java/src/main/java/io/odpf/stencil/cache/SchemaRefreshStrategy.java index 6e845d25..a76fd1bc 100644 --- a/clients/java/src/main/java/io/odpf/stencil/cache/SchemaRefreshStrategy.java +++ b/clients/java/src/main/java/io/odpf/stencil/cache/SchemaRefreshStrategy.java @@ -1,4 +1,4 @@ -package io.odpf.stencil.cache; +package org.raystack.stencil.cache; import java.io.IOException; import java.util.Map; @@ -9,9 +9,9 @@ import org.json.JSONArray; import org.json.JSONObject; -import io.odpf.stencil.DescriptorMapBuilder; -import io.odpf.stencil.exception.StencilRuntimeException; -import io.odpf.stencil.http.RemoteFile; +import org.raystack.stencil.DescriptorMapBuilder; +import org.raystack.stencil.exception.StencilRuntimeException; +import org.raystack.stencil.http.RemoteFile; public interface SchemaRefreshStrategy { Map refresh(String url, RemoteFile remoteFile, final Map prevDescriptor); diff --git a/clients/java/src/main/java/io/odpf/stencil/client/ClassLoadStencilClient.java b/clients/java/src/main/java/io/odpf/stencil/client/ClassLoadStencilClient.java index 4bc9a219..d99dca2c 100644 --- a/clients/java/src/main/java/io/odpf/stencil/client/ClassLoadStencilClient.java +++ b/clients/java/src/main/java/io/odpf/stencil/client/ClassLoadStencilClient.java @@ -1,4 +1,4 @@ -package io.odpf.stencil.client; +package org.raystack.stencil.client; import com.google.protobuf.Descriptors; diff --git a/clients/java/src/main/java/io/odpf/stencil/client/MultiURLStencilClient.java b/clients/java/src/main/java/io/odpf/stencil/client/MultiURLStencilClient.java index 99481245..e43d409a 100644 --- a/clients/java/src/main/java/io/odpf/stencil/client/MultiURLStencilClient.java +++ b/clients/java/src/main/java/io/odpf/stencil/client/MultiURLStencilClient.java @@ -1,8 +1,8 @@ -package io.odpf.stencil.client; +package org.raystack.stencil.client; import com.google.protobuf.Descriptors; -import io.odpf.stencil.cache.SchemaCacheLoader; -import io.odpf.stencil.config.StencilConfig; +import org.raystack.stencil.cache.SchemaCacheLoader; +import org.raystack.stencil.config.StencilConfig; import java.io.IOException; import java.io.Serializable; diff --git a/clients/java/src/main/java/io/odpf/stencil/client/StencilClient.java b/clients/java/src/main/java/io/odpf/stencil/client/StencilClient.java index 938f1579..4a259c2e 100644 --- a/clients/java/src/main/java/io/odpf/stencil/client/StencilClient.java +++ b/clients/java/src/main/java/io/odpf/stencil/client/StencilClient.java @@ -1,10 +1,10 @@ -package io.odpf.stencil.client; +package org.raystack.stencil.client; import com.google.protobuf.Descriptors; import com.google.protobuf.DynamicMessage; import com.google.protobuf.InvalidProtocolBufferException; -import io.odpf.stencil.Parser; -import io.odpf.stencil.exception.StencilRuntimeException; +import org.raystack.stencil.Parser; +import org.raystack.stencil.exception.StencilRuntimeException; import java.io.Closeable; import java.util.Map; diff --git a/clients/java/src/main/java/io/odpf/stencil/client/URLStencilClient.java b/clients/java/src/main/java/io/odpf/stencil/client/URLStencilClient.java index 5ba67221..1b0031b4 100644 --- a/clients/java/src/main/java/io/odpf/stencil/client/URLStencilClient.java +++ b/clients/java/src/main/java/io/odpf/stencil/client/URLStencilClient.java @@ -1,13 +1,13 @@ -package io.odpf.stencil.client; +package org.raystack.stencil.client; import com.google.common.base.Ticker; import com.google.common.cache.CacheBuilder; import com.google.common.cache.LoadingCache; import com.google.common.util.concurrent.UncheckedExecutionException; import com.google.protobuf.Descriptors; -import io.odpf.stencil.cache.SchemaCacheLoader; -import io.odpf.stencil.config.StencilConfig; -import io.odpf.stencil.exception.StencilRuntimeException; +import org.raystack.stencil.cache.SchemaCacheLoader; +import org.raystack.stencil.config.StencilConfig; +import org.raystack.stencil.exception.StencilRuntimeException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/clients/java/src/main/java/io/odpf/stencil/config/StencilConfig.java b/clients/java/src/main/java/io/odpf/stencil/config/StencilConfig.java index c972335f..f231178f 100644 --- a/clients/java/src/main/java/io/odpf/stencil/config/StencilConfig.java +++ b/clients/java/src/main/java/io/odpf/stencil/config/StencilConfig.java @@ -1,4 +1,4 @@ -package io.odpf.stencil.config; +package org.raystack.stencil.config; import lombok.Builder; import lombok.Getter; @@ -9,8 +9,8 @@ import com.timgroup.statsd.StatsDClient; import com.timgroup.statsd.NoOpStatsDClient; import org.apache.http.Header; -import io.odpf.stencil.SchemaUpdateListener; -import io.odpf.stencil.cache.SchemaRefreshStrategy; +import org.raystack.stencil.SchemaUpdateListener; +import org.raystack.stencil.cache.SchemaRefreshStrategy; @Getter @Builder(toBuilder = true) @@ -62,7 +62,7 @@ public class StencilConfig { Long cacheTtlMs = TimeUnit.HOURS.toMillis(24); /** - * Strategy implementation of when schema needs to be refreshed. Default {@link io.odpf.stencil.cache.SchemaRefreshStrategy#longPollingStrategy} + * Strategy implementation of when schema needs to be refreshed. Default {@link org.raystack.stencil.cache.SchemaRefreshStrategy#longPollingStrategy} * @param refreshStrategy schema refresh strategy implementation * @return schema refresh strategy */ diff --git a/clients/java/src/main/java/io/odpf/stencil/exception/StencilRuntimeException.java b/clients/java/src/main/java/io/odpf/stencil/exception/StencilRuntimeException.java index e23f5848..3af7362b 100644 --- a/clients/java/src/main/java/io/odpf/stencil/exception/StencilRuntimeException.java +++ b/clients/java/src/main/java/io/odpf/stencil/exception/StencilRuntimeException.java @@ -1,4 +1,4 @@ -package io.odpf.stencil.exception; +package org.raystack.stencil.exception; public class StencilRuntimeException extends RuntimeException{ public StencilRuntimeException(Throwable t) { diff --git a/clients/java/src/main/java/io/odpf/stencil/http/RemoteFile.java b/clients/java/src/main/java/io/odpf/stencil/http/RemoteFile.java index dfad1ebd..ba0826e9 100644 --- a/clients/java/src/main/java/io/odpf/stencil/http/RemoteFile.java +++ b/clients/java/src/main/java/io/odpf/stencil/http/RemoteFile.java @@ -1,4 +1,4 @@ -package io.odpf.stencil.http; +package org.raystack.stencil.http; import java.io.IOException; diff --git a/clients/java/src/main/java/io/odpf/stencil/http/RemoteFileImpl.java b/clients/java/src/main/java/io/odpf/stencil/http/RemoteFileImpl.java index 337a68ba..3b8f6db8 100644 --- a/clients/java/src/main/java/io/odpf/stencil/http/RemoteFileImpl.java +++ b/clients/java/src/main/java/io/odpf/stencil/http/RemoteFileImpl.java @@ -1,4 +1,4 @@ -package io.odpf.stencil.http; +package org.raystack.stencil.http; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; diff --git a/clients/java/src/main/java/io/odpf/stencil/http/RetryHttpClient.java b/clients/java/src/main/java/io/odpf/stencil/http/RetryHttpClient.java index b03b59d6..4f408b8a 100644 --- a/clients/java/src/main/java/io/odpf/stencil/http/RetryHttpClient.java +++ b/clients/java/src/main/java/io/odpf/stencil/http/RetryHttpClient.java @@ -1,6 +1,6 @@ -package io.odpf.stencil.http; +package org.raystack.stencil.http; -import io.odpf.stencil.config.StencilConfig; +import org.raystack.stencil.config.StencilConfig; import org.apache.http.HttpResponse; import org.apache.http.client.ServiceUnavailableRetryStrategy; import org.apache.http.client.config.RequestConfig; diff --git a/clients/java/src/test/java/io/odpf/stencil/DescriptorMapBuilderTest.java b/clients/java/src/test/java/io/odpf/stencil/DescriptorMapBuilderTest.java index c01ee11e..7b33f2b5 100644 --- a/clients/java/src/test/java/io/odpf/stencil/DescriptorMapBuilderTest.java +++ b/clients/java/src/test/java/io/odpf/stencil/DescriptorMapBuilderTest.java @@ -1,4 +1,4 @@ -package io.odpf.stencil; +package org.raystack.stencil; import com.google.protobuf.Descriptors; import org.junit.Test; @@ -20,7 +20,7 @@ public void testStore() throws IOException, Descriptors.DescriptorValidationExce InputStream fileInputStream = new FileInputStream(Objects.requireNonNull(classLoader.getResource(descriptorFilePath)).getFile()); Map descriptorMap = DescriptorMapBuilder.buildFrom(fileInputStream); assertNotNull(descriptorMap); - assertNotNull(descriptorMap.get("io.odpf.stencil.TestMessage")); + assertNotNull(descriptorMap.get("org.raystack.stencil.TestMessage")); } @Test @@ -30,13 +30,13 @@ public void TestNestedDescriptors() throws IOException, Descriptors.DescriptorVa InputStream fileInputStream = new FileInputStream(Objects.requireNonNull(classLoader.getResource(descriptorFilePath)).getFile()); Map descriptorMap = DescriptorMapBuilder.buildFrom(fileInputStream); - final Descriptors.Descriptor account_db_accounts = descriptorMap.get("io.odpf.stencil.account_db_accounts"); + final Descriptors.Descriptor account_db_accounts = descriptorMap.get("org.raystack.stencil.account_db_accounts"); assertNotNull(account_db_accounts.findFieldByName("id")); - final Descriptors.Descriptor ID = descriptorMap.get("io.odpf.stencil.account_db_accounts.ID"); + final Descriptors.Descriptor ID = descriptorMap.get("org.raystack.stencil.account_db_accounts.ID"); assertNotNull(ID.findFieldByName("data")); - final Descriptors.Descriptor fullDocument = descriptorMap.get("io.odpf.stencil.account_db_accounts.FULLDOCUMENT"); + final Descriptors.Descriptor fullDocument = descriptorMap.get("org.raystack.stencil.account_db_accounts.FULLDOCUMENT"); assertNotNull(fullDocument.findFieldByName("customerid")); - final Descriptors.Descriptor accounts_item = descriptorMap.get("io.odpf.stencil.account_db_accounts.FULLDOCUMENT.ACCOUNTS_ITEM"); + final Descriptors.Descriptor accounts_item = descriptorMap.get("org.raystack.stencil.account_db_accounts.FULLDOCUMENT.ACCOUNTS_ITEM"); assertNotNull(accounts_item.findFieldByName("monthlyaveragebalance")); } @@ -47,9 +47,9 @@ public void TestDescriptorsWithRecursiveFields() throws IOException, Descriptors InputStream fileInputStream = new FileInputStream(Objects.requireNonNull(classLoader.getResource(descriptorFilePath)).getFile()); Map descriptorMap = DescriptorMapBuilder.buildFrom(fileInputStream); - final Descriptors.Descriptor RecursiveLogMessage = descriptorMap.get("io.odpf.stencil.RecursiveLogMessage"); + final Descriptors.Descriptor RecursiveLogMessage = descriptorMap.get("org.raystack.stencil.RecursiveLogMessage"); assertNotNull(RecursiveLogMessage.findFieldByName("id")); - final Descriptors.Descriptor RECORD = descriptorMap.get("io.odpf.stencil.RecursiveLogMessage.RECORD"); + final Descriptors.Descriptor RECORD = descriptorMap.get("org.raystack.stencil.RecursiveLogMessage.RECORD"); assertNotNull(RECORD.findFieldByName("id")); assertNotNull(RECORD.findFieldByName("record")); } @@ -61,7 +61,7 @@ public void TestDescriptorsWithoutPackageName() throws IOException, Descriptors. InputStream fileInputStream = new FileInputStream(Objects.requireNonNull(classLoader.getResource(descriptorFilePath)).getFile()); Map descriptorMap = DescriptorMapBuilder.buildFrom(fileInputStream); - final Descriptors.Descriptor protoWithoutPackage = descriptorMap.get("io.odpf.stencil.RootField"); + final Descriptors.Descriptor protoWithoutPackage = descriptorMap.get("org.raystack.stencil.RootField"); assertEquals(".RootField", String.format(".%s", protoWithoutPackage.getFullName())); } @@ -72,9 +72,9 @@ public void TestDescriptorsByProtoFullName() throws IOException, Descriptors.Des InputStream fileInputStream = new FileInputStream(Objects.requireNonNull(classLoader.getResource(descriptorFilePath)).getFile()); Map descriptorMap = DescriptorMapBuilder.buildFrom(fileInputStream); - final Descriptors.Descriptor protoWithoutJavaPackage = descriptorMap.get("io.odpf.stencil.ImplicitOuterClass"); + final Descriptors.Descriptor protoWithoutJavaPackage = descriptorMap.get("org.raystack.stencil.ImplicitOuterClass"); assertNotNull(protoWithoutJavaPackage); - assertEquals("io.odpf.stencil.ImplicitOuterClass", protoWithoutJavaPackage.getFullName()); + assertEquals("org.raystack.stencil.ImplicitOuterClass", protoWithoutJavaPackage.getFullName()); } @Test @@ -84,7 +84,7 @@ public void TestDescriptorsByProtoFullNameOrJavaName() throws IOException, Descr InputStream fileInputStream = new FileInputStream(Objects.requireNonNull(classLoader.getResource(descriptorFilePath)).getFile()); Map descriptorMap = DescriptorMapBuilder.buildFrom(fileInputStream); - Descriptors.Descriptor protoWithoutPackage = descriptorMap.get("io.odpf.stencil.RootField"); + Descriptors.Descriptor protoWithoutPackage = descriptorMap.get("org.raystack.stencil.RootField"); assertEquals("RootField", protoWithoutPackage.getFullName()); Descriptors.Descriptor descriptorByProtoName = descriptorMap.get("RootField"); assertNotNull(descriptorByProtoName); diff --git a/clients/java/src/test/java/io/odpf/stencil/MultiURLStencilClientTest.java b/clients/java/src/test/java/io/odpf/stencil/MultiURLStencilClientTest.java index edb88163..381e88ea 100644 --- a/clients/java/src/test/java/io/odpf/stencil/MultiURLStencilClientTest.java +++ b/clients/java/src/test/java/io/odpf/stencil/MultiURLStencilClientTest.java @@ -1,10 +1,10 @@ -package io.odpf.stencil; +package org.raystack.stencil; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; import com.google.protobuf.Descriptors; -import io.odpf.stencil.client.StencilClient; -import io.odpf.stencil.config.StencilConfig; +import org.raystack.stencil.client.StencilClient; +import org.raystack.stencil.config.StencilConfig; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -37,7 +37,7 @@ public void shouldReturnDescriptor() { StencilClient c = StencilClientFactory.getClient(urls, StencilConfig.builder().build()); Map descMap = c.getAll(); assertNotNull(descMap); - Descriptors.Descriptor desc = c.get("io.odpf.stencil.TestMessage"); + Descriptors.Descriptor desc = c.get("org.raystack.stencil.TestMessage"); assertNotNull(desc); } } diff --git a/clients/java/src/test/java/io/odpf/stencil/URLStencilClientTest.java b/clients/java/src/test/java/io/odpf/stencil/URLStencilClientTest.java index 32a867fc..8eb0ec60 100644 --- a/clients/java/src/test/java/io/odpf/stencil/URLStencilClientTest.java +++ b/clients/java/src/test/java/io/odpf/stencil/URLStencilClientTest.java @@ -1,10 +1,10 @@ -package io.odpf.stencil; +package org.raystack.stencil; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; import com.google.protobuf.Descriptors; -import io.odpf.stencil.client.StencilClient; -import io.odpf.stencil.config.StencilConfig; +import org.raystack.stencil.client.StencilClient; +import org.raystack.stencil.config.StencilConfig; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -35,7 +35,7 @@ public void downloadFile() throws IOException { StencilClient c = StencilClientFactory.getClient(url, StencilConfig.builder().build()); Map descMap = c.getAll(); assertNotNull(descMap); - Descriptors.Descriptor desc = c.get("io.odpf.stencil.TestMessage"); + Descriptors.Descriptor desc = c.get("org.raystack.stencil.TestMessage"); assertNotNull(desc); c.refresh(); c.close(); diff --git a/clients/java/src/test/java/io/odpf/stencil/cache/SchemaCacheLoaderTest.java b/clients/java/src/test/java/io/odpf/stencil/cache/SchemaCacheLoaderTest.java index 1d0d6bc4..877a26fa 100644 --- a/clients/java/src/test/java/io/odpf/stencil/cache/SchemaCacheLoaderTest.java +++ b/clients/java/src/test/java/io/odpf/stencil/cache/SchemaCacheLoaderTest.java @@ -1,14 +1,14 @@ -package io.odpf.stencil.cache; +package org.raystack.stencil.cache; import com.google.common.io.ByteStreams; import com.google.protobuf.Descriptors; import com.timgroup.statsd.NoOpStatsDClient; import com.timgroup.statsd.StatsDClient; -import io.odpf.stencil.SchemaUpdateListener; -import io.odpf.stencil.TestKey; -import io.odpf.stencil.config.StencilConfig; -import io.odpf.stencil.exception.StencilRuntimeException; -import io.odpf.stencil.http.RemoteFile; +import org.raystack.stencil.SchemaUpdateListener; +import org.raystack.stencil.TestKey; +import org.raystack.stencil.config.StencilConfig; +import org.raystack.stencil.exception.StencilRuntimeException; +import org.raystack.stencil.http.RemoteFile; import org.apache.http.client.ClientProtocolException; import org.junit.After; import org.junit.Test; @@ -25,7 +25,7 @@ public class SchemaCacheLoaderTest { private SchemaCacheLoader cacheLoader; private static final String DESCRIPTOR_FILE_PATH = "__files/descriptors.bin"; - private static final String LOOKUP_KEY = "io.odpf.stencil.TestMessage"; + private static final String LOOKUP_KEY = "org.raystack.stencil.TestMessage"; private StencilConfig config = StencilConfig.builder().build(); private final StatsDClient statsDClient = new NoOpStatsDClient(); diff --git a/clients/java/src/test/java/io/odpf/stencil/cache/SchemaRefreshStrategyTest.java b/clients/java/src/test/java/io/odpf/stencil/cache/SchemaRefreshStrategyTest.java index 7efa2d0f..5c7306cf 100644 --- a/clients/java/src/test/java/io/odpf/stencil/cache/SchemaRefreshStrategyTest.java +++ b/clients/java/src/test/java/io/odpf/stencil/cache/SchemaRefreshStrategyTest.java @@ -1,4 +1,4 @@ -package io.odpf.stencil.cache; +package org.raystack.stencil.cache; import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertSame; @@ -17,10 +17,10 @@ import org.junit.Test; -import io.odpf.stencil.http.RemoteFile; +import org.raystack.stencil.http.RemoteFile; public class SchemaRefreshStrategyTest { - private static final String TYPENAME_KEY = "io.odpf.stencil.TestMessage"; + private static final String TYPENAME_KEY = "org.raystack.stencil.TestMessage"; private static final String DESCRIPTOR_FILE_PATH = "__files/descriptors.bin"; private static final String baseURL = "http://localhost:8000/v1beta1/namespaces/protobuf-test/schemas/esb-log-entities"; private static final String versionsURL = String.format("%s/versions", baseURL); diff --git a/clients/java/src/test/java/io/odpf/stencil/client/ClassLoadStencilClientTest.java b/clients/java/src/test/java/io/odpf/stencil/client/ClassLoadStencilClientTest.java index 85f748c4..e7459c8d 100644 --- a/clients/java/src/test/java/io/odpf/stencil/client/ClassLoadStencilClientTest.java +++ b/clients/java/src/test/java/io/odpf/stencil/client/ClassLoadStencilClientTest.java @@ -1,7 +1,7 @@ -package io.odpf.stencil.client; +package org.raystack.stencil.client; import com.google.protobuf.Descriptors; -import io.odpf.stencil.StencilClientFactory; +import org.raystack.stencil.StencilClientFactory; import org.junit.Test; import java.io.ByteArrayOutputStream; @@ -13,7 +13,7 @@ public class ClassLoadStencilClientTest { - private static final String LOOKUP_KEY = "io.odpf.stencil.TestMessage"; + private static final String LOOKUP_KEY = "org.raystack.stencil.TestMessage"; @Test public void getDescriptorFromClassPath() { diff --git a/clients/java/src/test/java/io/odpf/stencil/client/URLStencilClientWithCacheTest.java b/clients/java/src/test/java/io/odpf/stencil/client/URLStencilClientWithCacheTest.java index 9517d175..5d902f82 100644 --- a/clients/java/src/test/java/io/odpf/stencil/client/URLStencilClientWithCacheTest.java +++ b/clients/java/src/test/java/io/odpf/stencil/client/URLStencilClientWithCacheTest.java @@ -1,16 +1,16 @@ -package io.odpf.stencil.client; +package org.raystack.stencil.client; import com.google.common.testing.FakeTicker; import com.google.protobuf.Descriptors; import com.google.protobuf.DynamicMessage; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.Struct; -import io.odpf.stencil.DescriptorMapBuilder; -import io.odpf.stencil.NestedField; -import io.odpf.stencil.account_db_accounts.FULLDOCUMENT; -import io.odpf.stencil.cache.SchemaCacheLoader; -import io.odpf.stencil.config.StencilConfig; -import io.odpf.stencil.exception.StencilRuntimeException; +import org.raystack.stencil.DescriptorMapBuilder; +import org.raystack.stencil.NestedField; +import org.raystack.stencil.account_db_accounts.FULLDOCUMENT; +import org.raystack.stencil.cache.SchemaCacheLoader; +import org.raystack.stencil.config.StencilConfig; +import org.raystack.stencil.exception.StencilRuntimeException; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -30,7 +30,7 @@ public class URLStencilClientWithCacheTest { private Map descriptorMap; private StencilClient stencilClient; private static final String DESCRIPTOR_FILE_PATH = "__files/descriptors.bin"; - private static final String LOOKUP_KEY = "io.odpf.stencil.TestMessage"; + private static final String LOOKUP_KEY = "org.raystack.stencil.TestMessage"; @Before public void setup() throws IOException, Descriptors.DescriptorValidationException { @@ -114,7 +114,7 @@ public void shouldThrowExceptionOnDescriptorNotFound() throws InvalidProtocolBuf stencilClient = new URLStencilClient(LOOKUP_KEY, stencilConfig, cacheLoader, fakeTicker); NestedField msg = NestedField.newBuilder().setStringField("stencil").setIntField(10).build(); - stencilClient.parse("io.odpf.stencil.invalid", msg.toByteArray()); + stencilClient.parse("org.raystack.stencil.invalid", msg.toByteArray()); } @Test(expected = InvalidProtocolBufferException.class) @@ -141,8 +141,8 @@ public void parseShouldCreateDynamicMessageOnValidData() throws InvalidProtocolB stencilClient = new URLStencilClient(LOOKUP_KEY, stencilConfig, cacheLoader, fakeTicker); FULLDOCUMENT msg = FULLDOCUMENT.newBuilder().setCif("cifvalue").setId("idvalue").build(); - DynamicMessage newMsg = stencilClient.parse("io.odpf.stencil.account_db_accounts.FULLDOCUMENT", msg.toByteArray()); - Descriptors.Descriptor desc = stencilClient.get("io.odpf.stencil.account_db_accounts.FULLDOCUMENT"); + DynamicMessage newMsg = stencilClient.parse("org.raystack.stencil.account_db_accounts.FULLDOCUMENT", msg.toByteArray()); + Descriptors.Descriptor desc = stencilClient.get("org.raystack.stencil.account_db_accounts.FULLDOCUMENT"); assertNotNull(newMsg); Object value = newMsg.getField(desc.findFieldByNumber(1)); assertEquals("idvalue", value); diff --git a/clients/java/src/test/java/io/odpf/stencil/http/RemoteFileImplTest.java b/clients/java/src/test/java/io/odpf/stencil/http/RemoteFileImplTest.java index 7d07a296..76f43cd5 100644 --- a/clients/java/src/test/java/io/odpf/stencil/http/RemoteFileImplTest.java +++ b/clients/java/src/test/java/io/odpf/stencil/http/RemoteFileImplTest.java @@ -1,4 +1,4 @@ -package io.odpf.stencil.http; +package org.raystack.stencil.http; import org.apache.http.HttpEntity; import org.apache.http.StatusLine; diff --git a/clients/java/src/test/java/io/odpf/stencil/http/RetryHttpClientTest.java b/clients/java/src/test/java/io/odpf/stencil/http/RetryHttpClientTest.java index 5dc7e0d5..d5271bb1 100644 --- a/clients/java/src/test/java/io/odpf/stencil/http/RetryHttpClientTest.java +++ b/clients/java/src/test/java/io/odpf/stencil/http/RetryHttpClientTest.java @@ -1,7 +1,7 @@ -package io.odpf.stencil.http; +package org.raystack.stencil.http; import com.github.tomakehurst.wiremock.junit.WireMockRule; -import io.odpf.stencil.config.StencilConfig; +import org.raystack.stencil.config.StencilConfig; import org.apache.http.Header; import org.apache.http.HttpHeaders; diff --git a/clients/java/src/test/proto/NestedProtoMessage.proto b/clients/java/src/test/proto/NestedProtoMessage.proto index d3a175ea..c60c3a00 100644 --- a/clients/java/src/test/proto/NestedProtoMessage.proto +++ b/clients/java/src/test/proto/NestedProtoMessage.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package io.odpf.stencil; +package org.raystack.stencil; option java_multiple_files = true; -option java_package = "io.odpf.stencil"; +option java_package = "org.raystack.stencil"; option java_outer_classname = "AccountDbAccounts"; diff --git a/clients/java/src/test/proto/ProtoWithoutJavaPackage.proto b/clients/java/src/test/proto/ProtoWithoutJavaPackage.proto index 7e178998..e437ac65 100644 --- a/clients/java/src/test/proto/ProtoWithoutJavaPackage.proto +++ b/clients/java/src/test/proto/ProtoWithoutJavaPackage.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package io.odpf.stencil; +package org.raystack.stencil; message ImplicitOuterClass { string sample_string = 1; diff --git a/clients/java/src/test/proto/ProtoWithoutPackage.proto b/clients/java/src/test/proto/ProtoWithoutPackage.proto index 303a76bd..513fb16d 100644 --- a/clients/java/src/test/proto/ProtoWithoutPackage.proto +++ b/clients/java/src/test/proto/ProtoWithoutPackage.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option java_package = "io.odpf.stencil"; +option java_package = "org.raystack.stencil"; option java_multiple_files = true; option java_outer_classname = "ProtoWithoutPackage"; diff --git a/clients/java/src/test/proto/RecursiveProtoMessage.proto b/clients/java/src/test/proto/RecursiveProtoMessage.proto index b2b8ed7c..962891af 100644 --- a/clients/java/src/test/proto/RecursiveProtoMessage.proto +++ b/clients/java/src/test/proto/RecursiveProtoMessage.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package io.odpf.stencil; +package org.raystack.stencil; option java_multiple_files = true; -option java_package = "io.odpf.stencil"; +option java_package = "org.raystack.stencil"; option java_outer_classname = "Recursive"; diff --git a/clients/java/src/test/proto/TestMessage.proto b/clients/java/src/test/proto/TestMessage.proto index 12c2c969..29c904a3 100644 --- a/clients/java/src/test/proto/TestMessage.proto +++ b/clients/java/src/test/proto/TestMessage.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package io.odpf.stencil; +package org.raystack.stencil; option java_multiple_files = true; -option java_package = "io.odpf.stencil"; +option java_package = "org.raystack.stencil"; option java_outer_classname = "TestMessageProto"; message TestKey { diff --git a/clients/js/README.md b/clients/js/README.md index 2a4939e8..5d868f77 100644 --- a/clients/js/README.md +++ b/clients/js/README.md @@ -10,7 +10,7 @@ It has following features ## Installation ```sh -npm install --save @odpf/stencil +npm install --save @raystack/stencil ``` ## Usage @@ -96,7 +96,7 @@ console.log(decodedType.toObject()) 1. Clone the repo ```sh - $ git clone https://github.com/odpf/stencil + $ git clone https://github.com/raystack/stencil $ cd stencil/clients/js ``` @@ -114,7 +114,7 @@ console.log(decodedType.toObject()) ## Versioning -We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags](https://github.com/odpf/stencil/tags). +We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags](https://github.com/raystack/stencil/tags). ## License diff --git a/clients/js/package-lock.json b/clients/js/package-lock.json index 13eb9d5f..68432a02 100644 --- a/clients/js/package-lock.json +++ b/clients/js/package-lock.json @@ -1,5 +1,5 @@ { - "name": "@odpf/stencil", + "name": "@raystack/stencil", "version": "0.1.7", "lockfileVersion": 1, "requires": true, diff --git a/clients/js/package.json b/clients/js/package.json index 3ae27675..ed2e3376 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -1,5 +1,5 @@ { - "name": "@odpf/stencil", + "name": "@raystack/stencil", "version": "0.3.3", "description": "Stencil js client package provides a store to lookup protobuf descriptors and options to keep the protobuf descriptors upto date.", "main": "main.js", diff --git a/cmd/check.go b/cmd/check.go index 449a0e77..1333f959 100644 --- a/cmd/check.go +++ b/cmd/check.go @@ -7,9 +7,9 @@ import ( "os" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/printer" - "github.com/odpf/salt/term" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/salt/printer" + "github.com/raystack/salt/term" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" "google.golang.org/grpc/status" ) @@ -26,7 +26,7 @@ func checkSchemaCmd(cdk *CDK) *cobra.Command { Check schema compatibility of a local schema against a remote schema(against) on stencil server.`), Example: heredoc.Doc(` - $ stencil schema check -n odpf -c COMPATIBILITY_BACKWARD -F ./booking.desc + $ stencil schema check -n raystack -c COMPATIBILITY_BACKWARD -F ./booking.desc `), RunE: func(cmd *cobra.Command, args []string) error { spinner := printer.Spin("") diff --git a/cmd/client.go b/cmd/client.go index 980834f9..2d19881b 100644 --- a/cmd/client.go +++ b/cmd/client.go @@ -5,9 +5,9 @@ import ( "errors" "time" - "github.com/odpf/salt/cmdx" - "github.com/odpf/salt/config" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/salt/cmdx" + "github.com/raystack/salt/config" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" diff --git a/cmd/create.go b/cmd/create.go index 1bf4641b..91fccd37 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -7,9 +7,9 @@ import ( "os" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/printer" - "github.com/odpf/salt/term" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/salt/printer" + "github.com/raystack/salt/term" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -24,8 +24,8 @@ func createSchemaCmd(cdk *CDK) *cobra.Command { Short: "Create a schema", Args: cobra.ExactArgs(1), Example: heredoc.Doc(` - $ stencil schema create booking -n odpf –F booking.json - $ stencil schema create booking -n odpf -f FORMAT_JSON –c COMPATIBILITY_BACKWARD –F ./booking.json + $ stencil schema create booking -n raystack –F booking.json + $ stencil schema create booking -n raystack -f FORMAT_JSON –c COMPATIBILITY_BACKWARD –F ./booking.json `), RunE: func(cmd *cobra.Command, args []string) error { fileData, err := os.ReadFile(file) diff --git a/cmd/delete.go b/cmd/delete.go index 57bb52d4..e59495b5 100644 --- a/cmd/delete.go +++ b/cmd/delete.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/printer" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/salt/printer" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" ) @@ -21,7 +21,7 @@ func deleteSchemaCmd(cdk *CDK) *cobra.Command { Short: "Delete a schema", Args: cobra.ExactArgs(1), Example: heredoc.Doc(` - $ stencil schema delete booking -n odpf + $ stencil schema delete booking -n raystack `), RunE: func(cmd *cobra.Command, args []string) error { spinner := printer.Spin("") diff --git a/cmd/diff.go b/cmd/diff.go index 8e78390c..4620ff81 100644 --- a/cmd/diff.go +++ b/cmd/diff.go @@ -6,8 +6,8 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/printer" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/salt/printer" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" "github.com/yudai/gojsondiff" "github.com/yudai/gojsondiff/formatter" @@ -67,7 +67,7 @@ func diffSchemaCmd(cdk *CDK) *cobra.Command { Short: "Diff(s) of two schema versions", Args: cobra.ExactArgs(1), Example: heredoc.Doc(` - $ stencil schema diff booking -n=odpf --later-version=2 --earlier-version=1 --fullname= + $ stencil schema diff booking -n=raystack --later-version=2 --earlier-version=1 --fullname= `), RunE: func(cmd *cobra.Command, args []string) error { spinner := printer.Spin("") @@ -151,6 +151,6 @@ func diffSchemaCmd(cdk *CDK) *cobra.Command { cmd.MarkFlagRequired("earlier-version") cmd.Flags().Int32Var(&laterVersion, "later-version", 0, "Later version of the schema") cmd.MarkFlagRequired("later-version") - cmd.Flags().StringVar(&fullname, "fullname", "", "Only applicable for FORMAT_PROTO. fullname of proto schema eg: odpf.common.v1.Version") + cmd.Flags().StringVar(&fullname, "fullname", "", "Only applicable for FORMAT_PROTO. fullname of proto schema eg: raystack.common.v1.Version") return cmd } diff --git a/cmd/download.go b/cmd/download.go index 50df96c1..e6d4edfc 100644 --- a/cmd/download.go +++ b/cmd/download.go @@ -5,8 +5,8 @@ import ( "os" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/printer" - "github.com/odpf/salt/term" + "github.com/raystack/salt/printer" + "github.com/raystack/salt/term" "github.com/spf13/cobra" ) @@ -20,7 +20,7 @@ func downloadSchemaCmd(cdk *CDK) *cobra.Command { Short: "Download a schema", Args: cobra.ExactArgs(1), Example: heredoc.Doc(` - $ stencil schema download customer -n=odpf --version 1 + $ stencil schema download customer -n=raystack --version 1 `), RunE: func(cmd *cobra.Command, args []string) error { spinner := printer.Spin("") diff --git a/cmd/edit.go b/cmd/edit.go index 4ecda9d4..8b8688bd 100644 --- a/cmd/edit.go +++ b/cmd/edit.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/printer" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/salt/printer" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" ) @@ -19,7 +19,7 @@ func editSchemaCmd(cdk *CDK) *cobra.Command { Short: "Edit a schema", Args: cobra.ExactArgs(1), Example: heredoc.Doc(` - $ stencil schema edit booking -n odpf -c COMPATIBILITY_BACKWARD + $ stencil schema edit booking -n raystack -c COMPATIBILITY_BACKWARD `), RunE: func(cmd *cobra.Command, args []string) error { spinner := printer.Spin("") diff --git a/cmd/graph.go b/cmd/graph.go index 47356c02..0755b2a7 100644 --- a/cmd/graph.go +++ b/cmd/graph.go @@ -5,8 +5,8 @@ import ( "os" "github.com/MakeNowJust/heredoc" - "github.com/odpf/stencil/pkg/graph" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/stencil/pkg/graph" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/descriptorpb" @@ -22,7 +22,7 @@ func graphSchemaCmd(cdk *CDK) *cobra.Command { Short: "View schema dependencies graph", Args: cobra.ExactArgs(1), Example: heredoc.Doc(` - $ stencil schema graph booking -n odpf -v 1 -o ./vis.dot + $ stencil schema graph booking -n raystack -v 1 -o ./vis.dot `), RunE: func(cmd *cobra.Command, args []string) error { client, cancel, err := createClient(cmd, cdk) diff --git a/cmd/help.go b/cmd/help.go index 6f1fbfe3..aaa3b99e 100644 --- a/cmd/help.go +++ b/cmd/help.go @@ -8,7 +8,7 @@ var envHelp = map[string]string{ "short": "List of supported environment variables", "long": heredoc.Doc(` ODPF_CONFIG_DIR: the directory where stencil will store configuration files. Default: - "$XDG_CONFIG_HOME/odpf" or "$HOME/.config/odpf". + "$XDG_CONFIG_HOME/raystack" or "$HOME/.config/raystack". NO_COLOR: set to any value to avoid printing ANSI escape sequences for color output. diff --git a/cmd/info.go b/cmd/info.go index 8e400e37..8fbcc20d 100644 --- a/cmd/info.go +++ b/cmd/info.go @@ -7,9 +7,9 @@ import ( "strconv" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/printer" - "github.com/odpf/salt/term" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/salt/printer" + "github.com/raystack/salt/term" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -24,7 +24,7 @@ func infoSchemaCmd(cdk *CDK) *cobra.Command { Long: "Display the information about a schema.", Args: cobra.ExactArgs(1), Example: heredoc.Doc(` - $ stencil schema info events -n odpf + $ stencil schema info events -n raystack `), RunE: func(cmd *cobra.Command, args []string) error { spinner := printer.Spin("") @@ -75,7 +75,7 @@ func versionSchemaCmd(cdk *CDK) *cobra.Command { Short: "View versions of a schema", Args: cobra.ExactArgs(1), Example: heredoc.Doc(` - $ stencil schema version booking -n odpf + $ stencil schema version booking -n raystack `), RunE: func(cmd *cobra.Command, args []string) error { spinner := printer.Spin("") diff --git a/cmd/list.go b/cmd/list.go index 62924d7a..c6724da6 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -6,9 +6,9 @@ import ( "os" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/printer" - "github.com/odpf/salt/term" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/salt/printer" + "github.com/raystack/salt/term" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" ) @@ -24,7 +24,7 @@ func listSchemaCmd(cdk *CDK) *cobra.Command { `), Args: cobra.ExactArgs(0), Example: heredoc.Doc(` - $ stencil schema list -n odpf + $ stencil schema list -n raystack `), RunE: func(cmd *cobra.Command, args []string) error { spinner := printer.Spin("") diff --git a/cmd/namespace.go b/cmd/namespace.go index 2ae2287e..a0d07088 100644 --- a/cmd/namespace.go +++ b/cmd/namespace.go @@ -7,10 +7,10 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/dustin/go-humanize" - "github.com/odpf/salt/printer" - "github.com/odpf/salt/prompt" - "github.com/odpf/salt/term" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/salt/printer" + "github.com/raystack/salt/prompt" + "github.com/raystack/salt/term" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -24,8 +24,8 @@ func NamespaceCmd(cdk *CDK) *cobra.Command { Long: "Work with namespaces.", Example: heredoc.Doc(` $ stencil namespace list - $ stencil namespace create -n odpf - $ stencil namespace view odpf + $ stencil namespace create -n raystack + $ stencil namespace view raystack `), Annotations: map[string]string{ "group": "core", @@ -108,7 +108,7 @@ func createNamespaceCmd(cdk *CDK) *cobra.Command { Args: cobra.ExactArgs(0), Example: heredoc.Doc(` $ stencil namespace create - $ stencil namespace create -n=odpf -f=FORMAT_PROTOBUF -c=COMPATIBILITY_BACKWARD -d="Event schemas" + $ stencil namespace create -n=raystack -f=FORMAT_PROTOBUF -c=COMPATIBILITY_BACKWARD -d="Event schemas" `), RunE: func(cmd *cobra.Command, args []string) error { prompter := prompt.New() @@ -181,7 +181,7 @@ func editNamespaceCmd(cdk *CDK) *cobra.Command { Short: "Edit a namespace", Args: cobra.ExactArgs(1), Example: heredoc.Doc(` - $ stencil namespace edit odpf -f FORMAT_JSON -c COMPATIBILITY_BACKWARD -d "Hello message" + $ stencil namespace edit raystack -f FORMAT_JSON -c COMPATIBILITY_BACKWARD -d "Hello message" `), RunE: func(cmd *cobra.Command, args []string) error { spinner := printer.Spin("") @@ -240,7 +240,7 @@ func viewNamespaceCmd(cdk *CDK) *cobra.Command { Short: "View a namespace", Args: cobra.ExactArgs(1), Example: heredoc.Doc(` - $ stencil namespace view odpf + $ stencil namespace view raystack `), RunE: func(cmd *cobra.Command, args []string) error { spinner := printer.Spin("") @@ -286,7 +286,7 @@ func deleteNamespaceCmd(cdk *CDK) *cobra.Command { Short: "Delete a namespace", Args: cobra.ExactArgs(1), Example: heredoc.Doc(` - $ stencil namespace delete odpf + $ stencil namespace delete raystack `), RunE: func(cmd *cobra.Command, args []string) error { id := args[0] diff --git a/cmd/print.go b/cmd/print.go index 02f7f2f4..56d64cba 100644 --- a/cmd/print.go +++ b/cmd/print.go @@ -8,9 +8,9 @@ import ( "github.com/alecthomas/chroma/quick" "github.com/jhump/protoreflect/desc" "github.com/jhump/protoreflect/desc/protoprint" - "github.com/odpf/salt/printer" - "github.com/odpf/salt/term" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/salt/printer" + "github.com/raystack/salt/term" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/descriptorpb" @@ -26,8 +26,8 @@ func printSchemaCmd(cdk *CDK) *cobra.Command { Args: cobra.ExactArgs(1), Aliases: []string{"print"}, Example: heredoc.Doc(` - $ stencil schema view booking -n odpf - $ stencil schema view booking -n odpf -v 2 + $ stencil schema view booking -n raystack + $ stencil schema view booking -n raystack -v 2 `), RunE: func(cmd *cobra.Command, args []string) error { spinner := printer.Spin("") diff --git a/cmd/root.go b/cmd/root.go index 438589ee..3d1d2d72 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -2,7 +2,7 @@ package cmd import ( "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/cmdx" + "github.com/raystack/salt/cmdx" "github.com/spf13/cobra" ) @@ -22,10 +22,10 @@ func New() *cobra.Command { "group": "core", "help:learn": heredoc.Doc(` Use 'stencil --help' for info about a command. - Read the manual at https://odpf.github.io/stencil/ + Read the manual at https://raystack.github.io/stencil/ `), "help:feedback": heredoc.Doc(` - Open an issue here https://github.com/odpf/stencil/issues + Open an issue here https://github.com/raystack/stencil/issues `), }, } diff --git a/cmd/schema.go b/cmd/schema.go index 06367ed3..e81a2444 100644 --- a/cmd/schema.go +++ b/cmd/schema.go @@ -3,7 +3,7 @@ package cmd import ( "context" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" ) diff --git a/cmd/search.go b/cmd/search.go index 172d8e3f..d21427f4 100644 --- a/cmd/search.go +++ b/cmd/search.go @@ -8,9 +8,9 @@ import ( "strings" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/printer" - "github.com/odpf/salt/term" - stencilv1beta1 "github.com/odpf/stencil/proto/odpf/stencil/v1beta1" + "github.com/raystack/salt/printer" + "github.com/raystack/salt/term" + stencilv1beta1 "github.com/raystack/stencil/proto/raystack/stencil/v1beta1" "github.com/spf13/cobra" ) @@ -29,8 +29,8 @@ func SearchCmd(cdk *CDK) *cobra.Command { Example: heredoc.Doc(` $ stencil search email $ stencil search email -s human - $ stencil search name -n odpf -s person -v 2 - $ stencil search address -n odpf -s person -h true + $ stencil search name -n raystack -s person -v 2 + $ stencil search address -n raystack -s person -h true `), Annotations: map[string]string{ "group": "core", diff --git a/cmd/server.go b/cmd/server.go index 23c82707..401686e2 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -2,9 +2,9 @@ package cmd import ( "github.com/MakeNowJust/heredoc" - "github.com/odpf/stencil/config" - "github.com/odpf/stencil/internal/server" - "github.com/odpf/stencil/internal/store/postgres" + "github.com/raystack/stencil/config" + "github.com/raystack/stencil/internal/server" + "github.com/raystack/stencil/internal/store/postgres" "github.com/spf13/cobra" // Importing postgres driver diff --git a/config/load.go b/config/load.go index 36d73dbd..b3ca3ce8 100644 --- a/config/load.go +++ b/config/load.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/odpf/salt/config" + "github.com/raystack/salt/config" ) func Load(configFile string) (Config, error) { diff --git a/core/schema/mocks/namespace_service.go b/core/schema/mocks/namespace_service.go index 514608fd..0e33a6f7 100644 --- a/core/schema/mocks/namespace_service.go +++ b/core/schema/mocks/namespace_service.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - namespace "github.com/odpf/stencil/core/namespace" + namespace "github.com/raystack/stencil/core/namespace" mock "github.com/stretchr/testify/mock" testing "testing" diff --git a/core/schema/mocks/schema_parsed.go b/core/schema/mocks/schema_parsed.go index e1df3de6..748aa550 100644 --- a/core/schema/mocks/schema_parsed.go +++ b/core/schema/mocks/schema_parsed.go @@ -3,7 +3,7 @@ package mocks import ( - schema "github.com/odpf/stencil/core/schema" + schema "github.com/raystack/stencil/core/schema" mock "github.com/stretchr/testify/mock" testing "testing" diff --git a/core/schema/mocks/schema_provider.go b/core/schema/mocks/schema_provider.go index 3d94ae21..568173ac 100644 --- a/core/schema/mocks/schema_provider.go +++ b/core/schema/mocks/schema_provider.go @@ -3,7 +3,7 @@ package mocks import ( - schema "github.com/odpf/stencil/core/schema" + schema "github.com/raystack/stencil/core/schema" mock "github.com/stretchr/testify/mock" testing "testing" diff --git a/core/schema/mocks/schema_repository.go b/core/schema/mocks/schema_repository.go index a27b06d0..b89afd05 100644 --- a/core/schema/mocks/schema_repository.go +++ b/core/schema/mocks/schema_repository.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - schema "github.com/odpf/stencil/core/schema" + schema "github.com/raystack/stencil/core/schema" mock "github.com/stretchr/testify/mock" ) diff --git a/core/schema/provider/provider.go b/core/schema/provider/provider.go index 29460bf8..8657cb5c 100644 --- a/core/schema/provider/provider.go +++ b/core/schema/provider/provider.go @@ -3,10 +3,10 @@ package provider import ( "errors" - "github.com/odpf/stencil/core/schema" - "github.com/odpf/stencil/formats/avro" - "github.com/odpf/stencil/formats/json" - "github.com/odpf/stencil/formats/protobuf" + "github.com/raystack/stencil/core/schema" + "github.com/raystack/stencil/formats/avro" + "github.com/raystack/stencil/formats/json" + "github.com/raystack/stencil/formats/protobuf" ) type parseFn func([]byte) (schema.ParsedSchema, error) diff --git a/core/schema/service.go b/core/schema/service.go index ce137524..65af2761 100644 --- a/core/schema/service.go +++ b/core/schema/service.go @@ -6,8 +6,8 @@ import ( "fmt" "github.com/google/uuid" - "github.com/odpf/stencil/core/namespace" - "github.com/odpf/stencil/internal/store" + "github.com/raystack/stencil/core/namespace" + "github.com/raystack/stencil/internal/store" ) func NewService(repo Repository, provider Provider, nsSvc NamespaceService, cache Cache) *Service { diff --git a/core/schema/service_test.go b/core/schema/service_test.go index 0d015bdf..587b8cbc 100644 --- a/core/schema/service_test.go +++ b/core/schema/service_test.go @@ -5,10 +5,10 @@ import ( "errors" "testing" - "github.com/odpf/stencil/core/namespace" - "github.com/odpf/stencil/core/schema" - "github.com/odpf/stencil/core/schema/mocks" - "github.com/odpf/stencil/internal/store" + "github.com/raystack/stencil/core/namespace" + "github.com/raystack/stencil/core/schema" + "github.com/raystack/stencil/core/schema/mocks" + "github.com/raystack/stencil/internal/store" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/docs/blog/2021-08-20-stenciil-launch.md b/docs/blog/2021-08-20-stenciil-launch.md index d09fb28e..295116fb 100644 --- a/docs/blog/2021-08-20-stenciil-launch.md +++ b/docs/blog/2021-08-20-stenciil-launch.md @@ -5,7 +5,7 @@ authors: name: Ravi Suhag title: Maintainer url: https://github.com/ravisuhag -tags: [odpf, stencil] +tags: [raystack, stencil] --- We are live! diff --git a/docs/docs/clients/clojure.md b/docs/docs/clients/clojure.md index bb2f597f..ec2cf1a3 100644 --- a/docs/docs/clients/clojure.md +++ b/docs/docs/clients/clojure.md @@ -7,7 +7,7 @@ A Clojure library designed to easily encode and decode protobuf messages by usin Add the below dependency to your `project.clj` file: ```clj -[io.odpf/stencil-clj "0.3.3"] +[org.raystack/stencil-clj "0.3.3"] ``` ## Usage @@ -20,7 +20,7 @@ syntax = "proto3"; package example; option java_multiple_files = true; -option java_package = "io.odpf.CljTest"; +option java_package = "org.raystack.CljTest"; message Address { string city = 1; @@ -60,7 +60,7 @@ message Person { (:require [stencil.core :refer [serialize]]) (def serialized-data - (serialize client "io.odpf.CljTest" {:name "Foo" + (serialize client "org.raystack.CljTest" {:name "Foo" :address {:street "bar"} :email-list ["a@example.com" "b@b.com"] :gender :NON-BINARY @@ -72,7 +72,7 @@ message Person { ```clojure (:require [stencil.core :refer [deserialize]]) -(deserialize client "io.odpf.CljTest" serialized-data) +(deserialize client "org.raystack.CljTest" serialized-data) ;; prints ;; {:name "Foo" ;; :address {:street "bar"} @@ -88,7 +88,7 @@ message Person { | field names | keywords in kebab case | `name` -> `:name`, `field_name` -> `:field-name` | | scalar fields | Values follow [protobuf-java scalar value mappings](https://developers.google.com/protocol-buffers/docs/proto3#scalar) | | | enums | Values converted as keywords of enum's original value | `UNKNOWN` -> `:UNKNOWN` | -| messages | clojure map | `message Hello {string name = 1;}` -> {:name "odpf"} | +| messages | clojure map | `message Hello {string name = 1;}` -> {:name "raystack"} | | repeated fields | clojure vector | | | one-of fields | treated as regular fields | if two fields are set that are part of one-of, last seen value is considered while serializing data | | map | map values follow it's [wire representation](https://developers.google.com/protocol-buffers/docs/proto3#backwards_compatibility) | for `map` type, example value will be `[{:key "key" :value "value"}]` | @@ -155,7 +155,7 @@ Serialize will throw error in following cases ```clojure (let [client (create-client sample-client-config) - proto-package "io.odpf.stencil_clj_test" + proto-package "org.raystack.stencil_clj_test" proto-class-name "Scalar" fully-qualified-proto-name (str proto-package "." proto-class-name)] (get-descriptor client fully-qualified-proto-name)) @@ -183,7 +183,7 @@ Serialize will throw error in following cases ```clojure (let [client (create-client sample-client-config) - proto-package "io.odpf.stencil_clj_test" + proto-package "org.raystack.stencil_clj_test" proto-class-name "Scalar" fully-qualified-proto-name (str proto-package "." proto-class-name) proto-desc (get-descriptor client fully-qualified-proto-name) @@ -213,7 +213,7 @@ Serialize will throw error in following cases ```clojure (let [client (create-client sample-client-config) - proto-package "io.odpf.stencil_clj_test" + proto-package "org.raystack.stencil_clj_test" proto-class-name "Scalar" fully-qualified-proto-name (str proto-package "." proto-class-name) proto-desc (get-descriptor client fully-qualified-proto-name)] diff --git a/docs/docs/clients/go.md b/docs/docs/clients/go.md index d2119a79..4438581b 100644 --- a/docs/docs/clients/go.md +++ b/docs/docs/clients/go.md @@ -1,6 +1,6 @@ # Go -[![Go Reference](https://pkg.go.dev/badge/github.com/odpf/stencil/clients/go.svg)](https://pkg.go.dev/github.com/odpf/stencil/clients/go) +[![Go Reference](https://pkg.go.dev/badge/github.com/raystack/stencil/clients/go.svg)](https://pkg.go.dev/github.com/raystack/stencil/clients/go) Stencil go client package provides a store to lookup protobuf descriptors and options to keep the protobuf descriptors upto date. @@ -20,13 +20,13 @@ It has following features Use `go get` ``` -go get github.com/odpf/stencil/clients/go +go get github.com/raystack/stencil/clients/go ``` Then import the stencil package into your own code as mentioned below ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" ``` ## Usage @@ -34,7 +34,7 @@ import stencil "github.com/odpf/stencil/clients/go" ### Creating a client ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://localhost:8000/v1beta1/namespaces/{test-namespace}/schemas/{schema-name}" client, err := stencil.NewClient([]string{url}, stencil.Options{}) @@ -43,7 +43,7 @@ client, err := stencil.NewClient([]string{url}, stencil.Options{}) ### Get Descriptor ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://localhost:8000/v1beta1/namespaces/{test-namespace}/schemas/{schema-name}" client, err := stencil.NewClient([]string{url}, stencil.Options{}) @@ -56,7 +56,7 @@ desc, err := client.GetDescriptor("google.protobuf.DescriptorProto") ### Parse protobuf message. ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://localhost:8000/v1beta1/namespaces/{test-namespace}/schemas/{schema-name}" client, err := stencil.NewClient([]string{url}, stencil.Options{}) @@ -70,7 +70,7 @@ parsedMsg, err := client.Parse("google.protobuf.DescriptorProto", data) ### Serialize data. ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://url/to/proto/descriptorset/file" client, err := stencil.NewClient([]string{url}, stencil.Options{}) @@ -84,7 +84,7 @@ serializedMsg, err := client.Serialize("google.protobuf.DescriptorProto", data) ### Enable auto refresh of schemas ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://localhost:8000/v1beta1/namespaces/{test-namespace}/schemas/{schema-name}" // Configured to refresh schema every 12 hours @@ -98,7 +98,7 @@ desc, err := client.GetDescriptor("google.protobuf.DescriptorProto") ### Using VersionBasedRefresh strategy ```go -import stencil "github.com/odpf/stencil/clients/go" +import stencil "github.com/raystack/stencil/clients/go" url := "http://localhost:8000/v1beta1/namespaces/{test-namespace}/schemas/{schema-name}" // Configured to refresh schema every 12 hours @@ -109,4 +109,4 @@ if err != nil { desc, err := client.GetDescriptor("google.protobuf.DescriptorProto") ``` -Refer to [go documentation](https://pkg.go.dev/github.com/odpf/stencil/clients/go) for all available methods and options. +Refer to [go documentation](https://pkg.go.dev/github.com/raystack/stencil/clients/go) for all available methods and options. diff --git a/docs/docs/clients/java.md b/docs/docs/clients/java.md index 858b8213..9114c515 100644 --- a/docs/docs/clients/java.md +++ b/docs/docs/clients/java.md @@ -16,14 +16,14 @@ Protobuf allows you to define a protobuf file using DescriptorSet. A FileDescrip #### Gradle ```groovy - implementation group: 'io.odpf', name: 'stencil', version: '0.3.3' + implementation group: 'org.raystack', name: 'stencil', version: '0.3.3' ``` #### Maven ```xml - io.odpf + org.raystack stencil 0.3.3 @@ -36,8 +36,8 @@ Stencil client can be created in different modes. #### Loading Descriptor from Protobuf Class available in the classpath ```java -import io.odpf.stencil.client.StencilClient; -import io.odpf.stencil.StencilClientFactory; +import org.raystack.stencil.client.StencilClient; +import org.raystack.stencil.StencilClientFactory; StencilClient stencilClient = StencilClientFactory.getClient(); ``` @@ -45,7 +45,7 @@ StencilClient stencilClient = StencilClientFactory.getClient(); #### Create client with remote URL ```java -import io.odpf.stencil.config.StencilConfig; +import org.raystack.stencil.config.StencilConfig; String url = "http://url/to/proto/descriptor-set/file"; StencilClient stencilClient = StencilClientFacorty.getClient(url, StencilConfig.builder().build()); @@ -54,7 +54,7 @@ StencilClient stencilClient = StencilClientFacorty.getClient(url, StencilConfig. #### Creating MultiURL client ```java -import io.odpf.stencil.config.StencilConfig; +import org.raystack.stencil.config.StencilConfig; ArrayList urls = new ArrayList(); urls.add("http://localhost:8082/v1beta1/..."); @@ -77,7 +77,7 @@ StencilClient stencilClient = StencilClientFactory.getClient(url, StencilConfig. Whenever schema has changed this listener will be called. ```java -import io.odpf.stencil.SchemaUpdateListener; +import org.raystack.stencil.SchemaUpdateListener; SchemaUpdateListener updateListener = new SchemaUpdateListenerImpl(); StencilClient stencilClient = StencilClientFactory.getClient(url, StencilConfig.builder().updateListener(updateListener).build()); @@ -88,7 +88,7 @@ StencilClient stencilClient = StencilClientFactory.getClient(url, StencilConfig. If url belongs to stencil server, client can choose to refresh schema data only if there is a new version available. ```java -import io.odpf.stencil.cache.SchemaRefreshStrategy; +import org.raystack.stencil.cache.SchemaRefreshStrategy; StencilConfig config = StencilConfig.builder().refreshStrategy(SchemaRefreshStrategy.versionBasedRefresh()).build(); StencilClient stencilClient = StencilClientFactory.getClient(url, config); @@ -134,7 +134,7 @@ DynamicMessage message = DynamicMessage.parseFrom(descriptor, bytes); #### Using Parser interface ```java -import io.odpf.stencil.Parser; +import org.raystack.stencil.Parser; import com.google.protobuf.DynamicMessage; Parser protoParser = stencilClient.getParser("com.example.proto.schema"); diff --git a/docs/docs/clients/js.md b/docs/docs/clients/js.md index 457abfdc..3c55303d 100644 --- a/docs/docs/clients/js.md +++ b/docs/docs/clients/js.md @@ -10,7 +10,7 @@ It has following features ## Installation ```sh -npm install --save @odpf/stencil +npm install --save @raystack/stencil ``` ## Usage @@ -96,7 +96,7 @@ console.log(decodedType.toObject()) 1. Clone the repo ```sh - $ git clone https://github.com/odpf/stencil + $ git clone https://github.com/raystack/stencil $ cd stencil/clients/js ``` @@ -114,4 +114,4 @@ console.log(decodedType.toObject()) ## Versioning -We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags](https://github.com/odpf/stencil/tags). +We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags](https://github.com/raystack/stencil/tags). diff --git a/docs/docs/guides/1_quickstart.md b/docs/docs/guides/1_quickstart.md index cdff65a2..73d56dab 100644 --- a/docs/docs/guides/1_quickstart.md +++ b/docs/docs/guides/1_quickstart.md @@ -40,10 +40,10 @@ Note: Below command assumes `stencil_dev` db present in your postgres instance. ```bash # Run database migrations -$ docker run -e PORT=8000 -e DB_CONNECTIONSTRING=postgres://postgres@host.docker.internal:5432/stencil_dev?sslmode=disable -p 8000:8000 odpf/stencil server migrate +$ docker run -e PORT=8000 -e DB_CONNECTIONSTRING=postgres://postgres@host.docker.internal:5432/stencil_dev?sslmode=disable -p 8000:8000 raystack/stencil server migrate # Stencil server at port 8000 -$ docker run -e PORT=8000 -e DB_CONNECTIONSTRING=postgres://postgres@host.docker.internal:5432/stencil_dev?sslmode=disable -p 8000:8000 odpf/stencil server start +$ docker run -e PORT=8000 -e DB_CONNECTIONSTRING=postgres://postgres@host.docker.internal:5432/stencil_dev?sslmode=disable -p 8000:8000 raystack/stencil server start # Check if server running $ curl -X GET http://localhost:8000/ping @@ -183,7 +183,7 @@ package main import ( "log" - stencil "github.com/odpf/stencil/clients/go" + stencil "github.com/raystack/stencil/clients/go" ) func main() { diff --git a/docs/docs/installation.md b/docs/docs/installation.md index 13fbcb8c..5708a825 100644 --- a/docs/docs/installation.md +++ b/docs/docs/installation.md @@ -9,16 +9,16 @@ Stencil installation is simple. You can install Stencil on macOS, Windows, Linux ### Binary (Cross-platform) -Download the appropriate version for your platform from [releases](https://github.com/odpf/stencil/releases) page. Once downloaded, the binary can be run from anywhere. +Download the appropriate version for your platform from [releases](https://github.com/raystack/stencil/releases) page. Once downloaded, the binary can be run from anywhere. You don’t need to install it into a global location. This works well for shared hosts and other systems where you don’t have a privileged account. Ideally, you should install it somewhere in your `PATH` for easy use. `/usr/local/bin` is the most probable location. ### MacOS -`stencil` is available via a Homebrew Tap, and as downloadable binary from the [releases](https://github.com/odpf/stencil/releases/latest) page: +`stencil` is available via a Homebrew Tap, and as downloadable binary from the [releases](https://github.com/raystack/stencil/releases/latest) page: ```sh -brew install odpf/tap/stencil +brew install raystack/tap/stencil ``` To upgrade to the latest version: @@ -29,14 +29,14 @@ brew upgrade stencil #### Linux -`stencil` is available as downloadable binaries from the [releases](https://github.com/odpf/stencil/releases/latest) page. Download the `.deb` or `.rpm` from the releases page and install with `sudo dpkg -i` and `sudo rpm -i` respectively. +`stencil` is available as downloadable binaries from the [releases](https://github.com/raystack/stencil/releases/latest) page. Download the `.deb` or `.rpm` from the releases page and install with `sudo dpkg -i` and `sudo rpm -i` respectively. ### Windows -`stencil` is available via [scoop](https://scoop.sh/), and as a downloadable binary from the [releases](https://github.com/odpf/stencil/releases/latest) page: +`stencil` is available via [scoop](https://scoop.sh/), and as a downloadable binary from the [releases](https://github.com/raystack/stencil/releases/latest) page: ``` -scoop bucket add stencil https://github.com/odpf/scoop-bucket.git +scoop bucket add stencil https://github.com/raystack/scoop-bucket.git ``` To upgrade to the latest version: @@ -50,13 +50,13 @@ scoop update stencil We provide ready to use Docker container images. To pull the latest image: ``` -docker pull odpf/stencil:latest +docker pull raystack/stencil:latest ``` To pull a specific version: ``` -docker pull odpf/stencil:v0.3.3 +docker pull raystack/stencil:v0.3.3 ``` ### Building from source @@ -65,7 +65,7 @@ To compile from source, you will need [Go](https://golang.org/) installed and a ```bash # Clone the repo -$ git clone git@github.com:odpf/stencil.git +$ git clone git@github.com:raystack/stencil.git # Check all build comamnds available $ make help diff --git a/docs/docs/reference/cli.md b/docs/docs/reference/cli.md index 08597f30..35a51690 100644 --- a/docs/docs/reference/cli.md +++ b/docs/docs/reference/cli.md @@ -87,7 +87,7 @@ Diff(s) of two schema versions ``` --earlier-version int32 earlier version of the schema - --fullname string only required for FORMAT_PROTO. fullname of proto schema eg: odpf.common.v1.Version + --fullname string only required for FORMAT_PROTO. fullname of proto schema eg: raystack.common.v1.Version --host string stencil host address eg: localhost:8000 --later-version int32 later version of the schema diff --git a/docs/docs/server/overview.md b/docs/docs/server/overview.md index 9444b972..aef29b46 100644 --- a/docs/docs/server/overview.md +++ b/docs/docs/server/overview.md @@ -19,13 +19,13 @@ Stencil is dynamic protobuf schema registry. It provides REST interface for stor Run the following commands to run from docker image ```bash -$ docker pull odpf/stencil +$ docker pull raystack/stencil ``` Run the following commands to compile from source ```bash -$ git clone git@github.com:odpf/stencil.git +$ git clone git@github.com:raystack/stencil.git $ cd stencil $ go build -o stencil $ ./stencil --help diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 1c2a7c0f..4e11d6f9 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -6,7 +6,7 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula'); (module.exports = { title: 'Stencil', tagline: 'Schema registry engineered for scale', - url: 'https://odpf.github.io/', + url: 'https://raystack.github.io/', baseUrl: '/stencil/', onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', @@ -23,13 +23,13 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula'); }, docs: { sidebarPath: require.resolve('./sidebars.js'), - editUrl: 'https://github.com/odpf/stencil/edit/master/docs/', + editUrl: 'https://github.com/raystack/stencil/edit/master/docs/', sidebarCollapsed: true, }, blog: { showReadingTime: true, editUrl: - 'https://github.com/odpf/stencil/edit/master/docs/blog/', + 'https://github.com/raystack/stencil/edit/master/docs/blog/', }, theme: { customCss: [ @@ -67,7 +67,7 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula'); className: 'header-slack-link', }, { - href: 'https://github.com/odpf/stencil', + href: 'https://github.com/raystack/stencil', className: 'navbar-item-github', position: 'right', }, @@ -79,10 +79,10 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula'); { title: 'Products', items: [ - { label: 'Optimus', href: 'https://github.com/odpf/optimus' }, - { label: 'Firehose', href: 'https://github.com/odpf/firehose' }, - { label: 'Raccoon', href: 'https://github.com/odpf/raccoon' }, - { label: 'Dagger', href: 'https://odpf.github.io/dagger/' }, + { label: 'Optimus', href: 'https://github.com/raystack/optimus' }, + { label: 'Firehose', href: 'https://github.com/raystack/firehose' }, + { label: 'Raccoon', href: 'https://github.com/raystack/raccoon' }, + { label: 'Dagger', href: 'https://raystack.github.io/dagger/' }, ], }, { @@ -97,7 +97,7 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula'); title: 'Community', items: [ { label: 'Slack', href: 'https://bit.ly/2RzPbtn' }, - { label: 'GitHub', href: 'https://github.com/odpf/stencil' } + { label: 'GitHub', href: 'https://github.com/raystack/stencil' } ], }, ], @@ -108,7 +108,7 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula'); }, announcementBar: { id: 'star-repo', - content: '⭐️ If you like Stencil, give it a star on GitHub! ⭐', + content: '⭐️ If you like Stencil, give it a star on GitHub! ⭐', backgroundColor: '#222', textColor: '#eee', isCloseable: true, diff --git a/docs/src/pages/help.js b/docs/src/pages/help.js index f4de77e8..c7a75f06 100644 --- a/docs/src/pages/help.js +++ b/docs/src/pages/help.js @@ -25,7 +25,7 @@ export default function Home() {
The Stencil team has an open source slack workspace to discuss development and support. Most of the Stencil discussions happen in #stencil channel. -
Join us on Slack +
Join us on Slack
) }, { @@ -33,7 +33,7 @@ export default function Home() { content: (
Have a general issue or bug that you've found? We'd love to hear about it in our GitHub issues. This can be feature requests too! -
Go to issues +
Go to issues
) }, @@ -42,7 +42,7 @@ export default function Home() { content: (
For help and questions about best practices, join our GitHub discussions. Browse and ask questions. -
Go to discussions +
Go to discussions
) } diff --git a/docs/static/assets/swagger.yml b/docs/static/assets/swagger.yml index 4eec3cd1..a5a00251 100644 --- a/docs/static/assets/swagger.yml +++ b/docs/static/assets/swagger.yml @@ -1,6 +1,6 @@ -swagger: '2.0' +swagger: "2.0" info: - title: odpf/stencil/v1beta1/stencil.proto + title: raystack/stencil/v1beta1/stencil.proto version: 0.1.4 tags: - name: StencilService @@ -16,34 +16,34 @@ paths: summary: List names of namespaces operationId: StencilService_ListNamespaces responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1ListNamespacesResponse' + $ref: "#/definitions/v1beta1ListNamespacesResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" tags: - namespace post: summary: Create namespace entry operationId: StencilService_CreateNamespace responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1CreateNamespaceResponse' + $ref: "#/definitions/v1beta1CreateNamespaceResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: body in: body required: true schema: - $ref: '#/definitions/v1beta1CreateNamespaceRequest' + $ref: "#/definitions/v1beta1CreateNamespaceRequest" tags: - namespace /v1beta1/namespaces/{id}: @@ -51,14 +51,14 @@ paths: summary: Get namespace by id operationId: StencilService_GetNamespace responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1GetNamespaceResponse' + $ref: "#/definitions/v1beta1GetNamespaceResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: id in: path @@ -71,14 +71,14 @@ paths: description: Ensure all schemas under this namespace is deleted, otherwise it will throw error operationId: StencilService_DeleteNamespace responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1DeleteNamespaceResponse' + $ref: "#/definitions/v1beta1DeleteNamespaceResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: id in: path @@ -90,14 +90,14 @@ paths: summary: Update namespace entity by id operationId: StencilService_UpdateNamespace responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1UpdateNamespaceResponse' + $ref: "#/definitions/v1beta1UpdateNamespaceResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: id in: path @@ -110,9 +110,9 @@ paths: type: object properties: format: - $ref: '#/definitions/SchemaFormat' + $ref: "#/definitions/SchemaFormat" compatibility: - $ref: '#/definitions/SchemaCompatibility' + $ref: "#/definitions/SchemaCompatibility" description: type: string tags: @@ -122,14 +122,14 @@ paths: summary: List schemas under the namespace operationId: StencilService_ListSchemas responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1ListSchemasResponse' + $ref: "#/definitions/v1beta1ListSchemasResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: id in: path @@ -146,12 +146,12 @@ paths: - application/octet-stream - application/json responses: - '200': + "200": description: A successful schema response. Based on schema format, response will return different content types. For avro and json schemas response type is `application/json`. For protobuf response type is `application/octet-stream`. default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: namespaceId in: path @@ -169,14 +169,14 @@ paths: consumes: - application/octet-stream responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1CreateSchemaResponse' + $ref: "#/definitions/v1beta1CreateSchemaResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: namespaceId in: path @@ -198,14 +198,14 @@ paths: summary: Delete specified schema operationId: StencilService_DeleteSchema responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1DeleteSchemaResponse' + $ref: "#/definitions/v1beta1DeleteSchemaResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: namespaceId in: path @@ -221,14 +221,14 @@ paths: summary: Update only schema metadata operationId: StencilService_UpdateSchemaMetadata responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1UpdateSchemaMetadataResponse' + $ref: "#/definitions/v1beta1UpdateSchemaMetadataResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: namespaceId in: path @@ -245,7 +245,7 @@ paths: type: object properties: compatibility: - $ref: '#/definitions/SchemaCompatibility' + $ref: "#/definitions/SchemaCompatibility" tags: - schema /v1beta1/namespaces/{namespaceId}/schemas/{schemaId}/check: @@ -256,14 +256,14 @@ paths: consumes: - application/octet-stream responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1CreateSchemaResponse' + $ref: "#/definitions/v1beta1CreateSchemaResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: namespaceId in: path @@ -281,8 +281,14 @@ paths: format: binary - name: X-Compatibility in: header - type: 'string' - enum: ['COMPATIBILITY_UNSPECIFIED', 'COMPATIBILITY_BACKWARD', 'COMPATIBILITY_FORWARD', 'COMPATIBILITY_FULL'] + type: "string" + enum: + [ + "COMPATIBILITY_UNSPECIFIED", + "COMPATIBILITY_BACKWARD", + "COMPATIBILITY_FORWARD", + "COMPATIBILITY_FULL", + ] tags: - schema /v1beta1/namespaces/{namespaceId}/schemas/{schemaId}/meta: @@ -290,14 +296,14 @@ paths: summary: Create schema under the namespace. Returns version number, unique ID and location operationId: StencilService_GetSchemaMetadata responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1GetSchemaMetadataResponse' + $ref: "#/definitions/v1beta1GetSchemaMetadataResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: namespaceId in: path @@ -314,14 +320,14 @@ paths: summary: List all version numbers for schema operationId: StencilService_ListVersions responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1ListVersionsResponse' + $ref: "#/definitions/v1beta1ListVersionsResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: namespaceId in: path @@ -339,14 +345,14 @@ paths: summary: Delete specified version of the schema operationId: StencilService_DeleteVersion responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1DeleteVersionResponse' + $ref: "#/definitions/v1beta1DeleteVersionResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: namespaceId in: path @@ -369,14 +375,14 @@ paths: summary: Global Search API operationId: StencilService_Search responses: - '200': + "200": description: A successful response. schema: - $ref: '#/definitions/v1beta1SearchResponse' + $ref: "#/definitions/v1beta1SearchResponse" default: description: An unexpected error response. schema: - $ref: '#/definitions/rpcStatus' + $ref: "#/definitions/rpcStatus" parameters: - name: namespaceId in: query @@ -440,7 +446,7 @@ definitions: details: type: array items: - $ref: '#/definitions/protobufAny' + $ref: "#/definitions/protobufAny" v1beta1CheckCompatibilityResponse: type: object v1beta1CreateNamespaceRequest: @@ -451,9 +457,9 @@ definitions: required: - id format: - $ref: '#/definitions/SchemaFormat' + $ref: "#/definitions/SchemaFormat" compatibility: - $ref: '#/definitions/SchemaCompatibility' + $ref: "#/definitions/SchemaCompatibility" description: type: string required: @@ -462,7 +468,7 @@ definitions: type: object properties: namespace: - $ref: '#/definitions/v1beta1Namespace' + $ref: "#/definitions/v1beta1Namespace" v1beta1CreateSchemaResponse: type: object properties: @@ -498,14 +504,14 @@ definitions: type: object properties: namespace: - $ref: '#/definitions/v1beta1Namespace' + $ref: "#/definitions/v1beta1Namespace" v1beta1GetSchemaMetadataResponse: type: object properties: format: - $ref: '#/definitions/SchemaFormat' + $ref: "#/definitions/SchemaFormat" compatibility: - $ref: '#/definitions/SchemaCompatibility' + $ref: "#/definitions/SchemaCompatibility" authority: type: string v1beta1GetSchemaResponse: @@ -542,9 +548,9 @@ definitions: id: type: string format: - $ref: '#/definitions/SchemaFormat' + $ref: "#/definitions/SchemaFormat" Compatibility: - $ref: '#/definitions/SchemaCompatibility' + $ref: "#/definitions/SchemaCompatibility" description: type: string createdAt: @@ -585,20 +591,20 @@ definitions: hits: type: array items: - $ref: '#/definitions/v1beta1SearchHits' + $ref: "#/definitions/v1beta1SearchHits" meta: - $ref: '#/definitions/v1beta1SearchMeta' + $ref: "#/definitions/v1beta1SearchMeta" v1beta1UpdateNamespaceResponse: type: object properties: namespace: - $ref: '#/definitions/v1beta1Namespace' + $ref: "#/definitions/v1beta1Namespace" v1beta1UpdateSchemaMetadataResponse: type: object properties: format: - $ref: '#/definitions/SchemaFormat' + $ref: "#/definitions/SchemaFormat" compatibility: - $ref: '#/definitions/SchemaCompatibility' + $ref: "#/definitions/SchemaCompatibility" authority: type: string diff --git a/docs/static/img/banner.svg b/docs/static/img/banner.svg index d76f97ba..b2e5c690 100644 --- a/docs/static/img/banner.svg +++ b/docs/static/img/banner.svg @@ -1,4 +1,4 @@ -