Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync main to r1.0 to release localcache v1.0.0 #27

Merged
merged 5 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "CLA Assistant"
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize, reopened]

# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings
permissions:
actions: write
contents: write
pull-requests: write
statuses: write

jobs:
CLAAssistant:
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
uses: contributor-assistant/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_DATABASE_ACCESS_TOKEN }}
with:
remote-organization-name: trpc-group
remote-repository-name: cla-database
path-to-signatures: 'signatures/${{ github.event.repository.name }}-${{ github.repository_id }}/cla.json'
path-to-document: 'https://github.com/trpc-group/cla-database/blob/main/Tencent-Contributor-License-Agreement.md'
# branch should not be protected
branch: 'main'
allowlist: dependabot
33 changes: 33 additions & 0 deletions .github/workflows/localcache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Localcache Pull Request Check
on:
pull_request:
paths:
- 'localcache/**'
- '.github/workflows/localcache.yml'
push:
paths:
- 'localcache/**'
- '.github/workflows/localcache.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.19
- name: Build
run: cd localcache && go build -v ./...
- name: Test
run: cd localcache && go test -v -coverprofile=coverage.out ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ./localcache/coverage.out
flags: localcache
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6 changes: 6 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ Copyright (c) 2013 Shopify
10. go-sqlite3
Copyright (c) 2014 Yasuhiro Matsumoto

11. timingwheel
Copyright (c) 2022 Luo Peng

12. xxhash
Copyright (c) 2016 Caleb Spare


Terms of the MIT License:
--------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion clickhouse/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Package clickhouse 封装标准库clickhouse
package clickhouse

import (
Expand Down
6 changes: 0 additions & 6 deletions clickhouse/client_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/**
* @author aceyugong <[email protected]>
* @date 2022/7/4
*/

// Package clickhouse packages standard library clickhouse.
package clickhouse

import (
Expand Down
1 change: 0 additions & 1 deletion clickhouse/codec_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Package clickhouse packages standard library clickhouse.
package clickhouse

import (
Expand Down
6 changes: 0 additions & 6 deletions clickhouse/dsn_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/**
* @author aceyugong <[email protected]>
* @date 2022/8/19
*/

// Package clickhouse packages standard library clickhouse.
package clickhouse

import (
Expand Down
2 changes: 1 addition & 1 deletion clickhouse/mockclickhouse/clickhouse_mock.go

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

1 change: 0 additions & 1 deletion clickhouse/transport_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Package clickhouse packages standard library clickhouse.
package clickhouse

import (
Expand Down
12 changes: 11 additions & 1 deletion kafka/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# Change Log
# Change Log

## [1.1.0](https://github.com/trpc-ecosystem/go-database/releases/tag/kafka%2Fv1.1.0) (2023-12-22)

### Breaking Changes

- update sarama dependence from to github.com/Shopify/sarama v1.29.1 to github.com/IBM/sarama v1.40.1 (#21)

### Bug Fixes

- fix unit test (#21)
6 changes: 3 additions & 3 deletions kafka/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ English | [中文](README.zh_CN.md)
[![Tests](https://github.com/trpc-ecosystem/go-database/actions/workflows/kafka.yml/badge.svg)](https://github.com/trpc-ecosystem/go-database/actions/workflows/kafka.yml)
[![Coverage](https://codecov.io/gh/trpc-ecosystem/go-database/branch/main/graph/badge.svg?flag=kafka&precision=2)](https://app.codecov.io/gh/trpc-ecosystem/go-database/tree/main/kafka)

wrapping community [sarama](https://github.com/Shopify/sarama), used with trpc.
wrapping community [sarama](https://github.com/IBM/sarama), used with trpc.

## producer client

Expand Down Expand Up @@ -68,7 +68,7 @@ import (

"trpc.group/trpc-go/trpc-database/kafka"
trpc "trpc.group/trpc-go/trpc-go"
"github.com/Shopify/sarama"
"github.com/IBM/sarama"
)

func main() {
Expand Down Expand Up @@ -99,7 +99,7 @@ import (

"trpc.group/trpc-go/trpc-database/kafka"
trpc "trpc.group/trpc-go/trpc-go"
"github.com/Shopify/sarama"
"github.com/IBM/sarama"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions kafka/README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Tests](https://github.com/trpc-ecosystem/go-database/actions/workflows/kafka.yml/badge.svg)](https://github.com/trpc-ecosystem/go-database/actions/workflows/kafka.yml)
[![Coverage](https://codecov.io/gh/trpc-ecosystem/go-database/branch/main/graph/badge.svg?flag=kafka&precision=2)](https://app.codecov.io/gh/trpc-ecosystem/go-database/tree/main/kafka)

封装社区的 [sarama](https://github.com/Shopify/sarama) ,配合 trpc 使用。
封装社区的 [sarama](https://github.com/IBM/sarama) ,配合 trpc 使用。

## producer client

Expand Down Expand Up @@ -67,7 +67,7 @@ import (

"trpc.group/trpc-go/trpc-database/kafka"
trpc "trpc.group/trpc-go/trpc-go"
"github.com/Shopify/sarama"
"github.com/IBM/sarama"
)

func main() {
Expand Down Expand Up @@ -97,7 +97,7 @@ import (

"trpc.group/trpc-go/trpc-database/kafka"
trpc "trpc.group/trpc-go/trpc-go"
"github.com/Shopify/sarama"
"github.com/IBM/sarama"
)

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

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"trpc.group/trpc-go/trpc-go/client"
"trpc.group/trpc-go/trpc-go/codec"
)
Expand Down
2 changes: 1 addition & 1 deletion kafka/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"flag"
"testing"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/stretchr/testify/assert"
"trpc.group/trpc-go/trpc-go/client"
)
Expand Down
2 changes: 1 addition & 1 deletion kafka/client_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sync"
"time"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"trpc.group/trpc-go/trpc-go/codec"
"trpc.group/trpc-go/trpc-go/errs"
"trpc.group/trpc-go/trpc-go/log"
Expand Down
2 changes: 1 addition & 1 deletion kafka/client_transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"time"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/stretchr/testify/assert"
"trpc.group/trpc-go/trpc-go"
"trpc.group/trpc-go/trpc-go/codec"
Expand Down
2 changes: 1 addition & 1 deletion kafka/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"time"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"trpc.group/trpc-go/trpc-go/naming/discovery"
"trpc.group/trpc-go/trpc-go/naming/servicerouter"
)
Expand Down
2 changes: 1 addition & 1 deletion kafka/config_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
)

// configParseFunc set UserConfig property.
Expand Down
2 changes: 1 addition & 1 deletion kafka/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/stretchr/testify/assert"
"trpc.group/trpc-go/trpc-go/naming/discovery"
"trpc.group/trpc-go/trpc-go/naming/registry"
Expand Down
2 changes: 1 addition & 1 deletion kafka/examples/batchconsumer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"context"
"fmt"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"trpc.group/trpc-go/trpc-database/kafka"
"trpc.group/trpc-go/trpc-go"
"trpc.group/trpc-go/trpc-go/log"
Expand Down
2 changes: 1 addition & 1 deletion kafka/examples/consumer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package main
import (
"context"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"trpc.group/trpc-go/trpc-database/kafka"
"trpc.group/trpc-go/trpc-go"
"trpc.group/trpc-go/trpc-go/log"
Expand Down
2 changes: 1 addition & 1 deletion kafka/examples/consumer_with_mulit_service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package main
import (
"context"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"trpc.group/trpc-go/trpc-database/kafka"
"trpc.group/trpc-go/trpc-go"
"trpc.group/trpc-go/trpc-go/log"
Expand Down
19 changes: 10 additions & 9 deletions kafka/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module trpc.group/trpc-go/trpc-database/kafka
go 1.20

require (
github.com/Shopify/sarama v1.29.1
github.com/IBM/sarama v1.40.1
github.com/golang/mock v1.4.4
github.com/smartystreets/goconvey v1.8.0
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.4
github.com/xdg-go/scram v1.1.2
golang.org/x/time v0.3.0
gopkg.in/yaml.v3 v3.0.1
Expand Down Expand Up @@ -35,15 +35,16 @@ require (
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/klauspost/compress v1.15.14 // indirect
github.com/klauspost/compress v1.16.6 // indirect
github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/panjf2000/ants/v2 v2.4.6 // indirect
github.com/pierrec/lz4 v2.6.0+incompatible // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/smartystreets/assertions v1.13.1 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
Expand All @@ -54,11 +55,11 @@ require (
go.uber.org/automaxprocs v1.3.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
trpc.group/trpc-go/tnet v0.0.0-20230810071536-9d05338021cf // indirect
trpc.group/trpc/trpc-protocol/pb/go/trpc v0.0.0-20230803031059-de4168eb5952 // indirect
Expand Down
Loading
Loading