Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto sqlite-improv
  • Loading branch information
ItalyPaleAle committed Oct 10, 2023
2 parents 3779972 + 9f2cc5c commit 1db6a06
Show file tree
Hide file tree
Showing 24 changed files with 772 additions and 716 deletions.
4 changes: 2 additions & 2 deletions .build-tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/invopop/jsonschema v0.6.0
github.com/spf13/cobra v1.6.1
github.com/xeipuuv/gojsonschema v1.2.1-0.20201027075954-b076d39a02e5
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
gopkg.in/yaml.v3 v3.0.1
sigs.k8s.io/yaml v1.3.0
)
Expand All @@ -24,7 +24,7 @@ require (
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apimachinery v0.26.3 // indirect
k8s.io/apimachinery v0.26.9 // indirect
)

replace github.com/dapr/components-contrib => ../
8 changes: 4 additions & 4 deletions .build-tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ=
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand Down Expand Up @@ -80,7 +80,7 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/apimachinery v0.26.3 h1:dQx6PNETJ7nODU3XPtrwkfuubs6w7sX0M8n61zHIV/k=
k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I=
k8s.io/apimachinery v0.26.9 h1:5yAV9cFR7Z4gIorKcAjWnx4uxtxiFsERwq4Pvmx0CCg=
k8s.io/apimachinery v0.26.9/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ run:
# list of build tags, all linters use it. Default is empty list.
build-tags:
- certtests
- conftests
- metadata

# which dirs to skip: they won't be analyzed;
Expand Down Expand Up @@ -301,3 +302,4 @@ linters:
- deadcode
- nosnakecase
- varcheck
- goconst
32 changes: 16 additions & 16 deletions bindings/azure/openai/openai.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ func (p *AzOpenAI) completion(ctx context.Context, message []byte, metadata map[
}

resp, err := p.client.GetCompletions(ctx, azopenai.CompletionsOptions{
DeploymentID: prompt.DeploymentID,
Prompt: []string{prompt.Prompt},
MaxTokens: &prompt.MaxTokens,
Temperature: &prompt.Temperature,
TopP: &prompt.TopP,
N: &prompt.N,
Stop: prompt.Stop,
Deployment: prompt.DeploymentID,
Prompt: []string{prompt.Prompt},
MaxTokens: &prompt.MaxTokens,
Temperature: &prompt.Temperature,
TopP: &prompt.TopP,
N: &prompt.N,
Stop: prompt.Stop,
}, nil)
if err != nil {
return nil, fmt.Errorf("error getting completion api: %w", err)
Expand Down Expand Up @@ -304,13 +304,13 @@ func (p *AzOpenAI) chatCompletion(ctx context.Context, messageRequest []byte, me
}

res, err := p.client.GetChatCompletions(ctx, azopenai.ChatCompletionsOptions{
DeploymentID: messages.DeploymentID,
MaxTokens: maxTokens,
Temperature: &messages.Temperature,
TopP: &messages.TopP,
N: &messages.N,
Messages: messageReq,
Stop: messages.Stop,
Deployment: messages.DeploymentID,
MaxTokens: maxTokens,
Temperature: &messages.Temperature,
TopP: &messages.TopP,
N: &messages.N,
Messages: messageReq,
Stop: messages.Stop,
}, nil)
if err != nil {
return nil, fmt.Errorf("error getting chat completion api: %w", err)
Expand Down Expand Up @@ -342,8 +342,8 @@ func (p *AzOpenAI) getEmbedding(ctx context.Context, messageRequest []byte, meta
}

res, err := p.client.GetEmbeddings(ctx, azopenai.EmbeddingsOptions{
DeploymentID: message.DeploymentID,
Input: []string{message.Message},
Deployment: message.DeploymentID,
Input: []string{message.Message},
}, nil)
if err != nil {
return nil, fmt.Errorf("error getting embedding api: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion configuration/azure/appconfig/appconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const (

type azAppConfigClient interface {
GetSetting(ctx context.Context, key string, options *azappconfig.GetSettingOptions) (azappconfig.GetSettingResponse, error)
NewListSettingsPager(selector azappconfig.SettingSelector, options *azappconfig.ListSettingsOptions) *runtime.Pager[azappconfig.ListSettingsPage]
NewListSettingsPager(selector azappconfig.SettingSelector, options *azappconfig.ListSettingsOptions) *runtime.Pager[azappconfig.ListSettingsPageResponse]
}

// ConfigurationStore is a Azure App Configuration store.
Expand Down
10 changes: 5 additions & 5 deletions configuration/azure/appconfig/appconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (m *MockConfigurationStore) GetSetting(ctx context.Context, key string, opt
return resp, nil
}

func (m *MockConfigurationStore) NewListSettingsPager(selector azappconfig.SettingSelector, options *azappconfig.ListSettingsOptions) *runtime.Pager[azappconfig.ListSettingsPage] {
func (m *MockConfigurationStore) NewListSettingsPager(selector azappconfig.SettingSelector, options *azappconfig.ListSettingsOptions) *runtime.Pager[azappconfig.ListSettingsPageResponse] {
settings := make([]azappconfig.Setting, 2)

setting1 := azappconfig.Setting{}
Expand All @@ -65,12 +65,12 @@ func (m *MockConfigurationStore) NewListSettingsPager(selector azappconfig.Setti
settings[0] = setting1
settings[1] = setting2

return runtime.NewPager(runtime.PagingHandler[azappconfig.ListSettingsPage]{
More: func(azappconfig.ListSettingsPage) bool {
return runtime.NewPager(runtime.PagingHandler[azappconfig.ListSettingsPageResponse]{
More: func(azappconfig.ListSettingsPageResponse) bool {
return false
},
Fetcher: func(ctx context.Context, cur *azappconfig.ListSettingsPage) (azappconfig.ListSettingsPage, error) {
listSettingPage := azappconfig.ListSettingsPage{}
Fetcher: func(ctx context.Context, cur *azappconfig.ListSettingsPageResponse) (azappconfig.ListSettingsPageResponse, error) {
listSettingPage := azappconfig.ListSettingsPageResponse{}
listSettingPage.Settings = settings
return listSettingPage, nil
},
Expand Down
74 changes: 37 additions & 37 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ require (
cloud.google.com/go/datastore v1.14.0
cloud.google.com/go/pubsub v1.33.0
cloud.google.com/go/secretmanager v1.11.1
cloud.google.com/go/storage v1.32.0
cloud.google.com/go/storage v1.33.0
dubbo.apache.org/dubbo-go/v3 v3.0.3-0.20230118042253-4f159a2b38f3
github.com/Azure/azure-sdk-for-go/sdk/ai/azopenai v0.1.1
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1
github.com/Azure/azure-sdk-for-go/sdk/ai/azopenai v0.3.0
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.2
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1
github.com/Azure/azure-sdk-for-go/sdk/data/azappconfig v0.5.0
github.com/Azure/azure-sdk-for-go/sdk/data/azappconfig v0.6.0
github.com/Azure/azure-sdk-for-go/sdk/data/azcosmos v0.3.6
github.com/Azure/azure-sdk-for-go/sdk/data/aztables v1.0.2
github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs v1.0.1
github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus v1.4.0
github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus v1.4.1
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2 v2.1.1
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.1.1
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.0.1
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.1.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue v1.0.0
github.com/Azure/go-amqp v1.0.1
github.com/Azure/go-amqp v1.0.2
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/IBM/sarama v1.41.1
github.com/aerospike/aerospike-client-go/v6 v6.12.0
Expand All @@ -39,8 +39,8 @@ require (
github.com/apache/pulsar-client-go v0.11.0
github.com/apache/rocketmq-client-go/v2 v2.1.2-0.20230412142645-25003f6f083d
github.com/apache/thrift v0.13.0
github.com/aws/aws-sdk-go v1.44.333
github.com/bradfitz/gomemcache v0.0.0-20230611145640-acc696258285
github.com/aws/aws-sdk-go v1.45.19
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874
github.com/camunda/zeebe/clients/go/v8 v8.2.12
github.com/cenkalti/backoff/v4 v4.2.1
github.com/chebyrash/promise v0.0.0-20230709133807-42ec49ba1459
Expand All @@ -65,8 +65,8 @@ require (
github.com/gorilla/mux v1.8.0
github.com/grandcat/zeroconf v1.0.0
github.com/hamba/avro/v2 v2.15.0
github.com/hashicorp/consul/api v1.24.0
github.com/hashicorp/golang-lru/v2 v2.0.6
github.com/hashicorp/consul/api v1.25.1
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/hazelcast/hazelcast-go-client v0.0.0-20190530123621-6cf767c2f31a
github.com/http-wasm/http-wasm-host-go v0.5.1
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible
Expand All @@ -77,23 +77,23 @@ require (
github.com/kubemq-io/kubemq-go v1.7.9
github.com/labd/commercetools-go-sdk v1.3.1
github.com/lestrrat-go/httprc v1.0.4
github.com/lestrrat-go/jwx/v2 v2.0.12
github.com/lestrrat-go/jwx/v2 v2.0.13
github.com/machinebox/graphql v0.2.2
github.com/matoous/go-nanoid/v2 v2.0.0
github.com/microsoft/go-mssqldb v1.5.0
github.com/microsoft/go-mssqldb v1.6.0
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4
github.com/mrz1836/postmark v1.6.1
github.com/nats-io/nats-server/v2 v2.9.21
github.com/nats-io/nats.go v1.28.0
github.com/nats-io/nkeys v0.4.4
github.com/open-policy-agent/opa v0.55.0
github.com/oracle/oci-go-sdk/v54 v54.0.0
github.com/pashagolub/pgxmock/v2 v2.11.0
github.com/pashagolub/pgxmock/v2 v2.12.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/rabbitmq/amqp091-go v1.8.1
github.com/redis/go-redis/v9 v9.1.0
github.com/redis/go-redis/v9 v9.2.1
github.com/sendgrid/sendgrid-go v3.13.0+incompatible
github.com/sijms/go-ora/v2 v2.7.17
github.com/sijms/go-ora/v2 v2.7.18
github.com/spf13/cast v1.5.1
github.com/stealthrocket/wasi-go v0.8.1-0.20230912180546-8efbab50fb58
github.com/stretchr/testify v1.8.4
Expand All @@ -110,23 +110,23 @@ require (
go.temporal.io/sdk v1.21.1
go.uber.org/multierr v1.11.0
go.uber.org/ratelimit v0.3.0
golang.org/x/crypto v0.12.0
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
golang.org/x/crypto v0.13.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/mod v0.12.0
golang.org/x/net v0.14.0
golang.org/x/oauth2 v0.11.0
golang.org/x/net v0.15.0
golang.org/x/oauth2 v0.12.0
google.golang.org/api v0.138.0
google.golang.org/grpc v1.57.0
google.golang.org/protobuf v1.31.0
gopkg.in/couchbase/gocb.v1 v1.6.7
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.26.3
k8s.io/apiextensions-apiserver v0.26.3
k8s.io/apimachinery v0.26.3
k8s.io/client-go v0.26.3
k8s.io/api v0.26.9
k8s.io/apiextensions-apiserver v0.26.9
k8s.io/apimachinery v0.26.9
k8s.io/client-go v0.26.9
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
modernc.org/sqlite v1.25.0
modernc.org/sqlite v1.26.0
sigs.k8s.io/yaml v1.3.0
)

Expand Down Expand Up @@ -253,7 +253,7 @@ require (
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/serf v0.10.1 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/imkira/go-interpol v1.1.0 // indirect
Expand All @@ -279,7 +279,7 @@ require (
github.com/kubemq-io/protobuf v1.3.1 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
Expand All @@ -289,7 +289,7 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matryer/is v1.4.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/microcosm-cc/bluemonday v1.0.21 // indirect
github.com/miekg/dns v1.1.43 // indirect
Expand Down Expand Up @@ -369,13 +369,13 @@ require (
go.uber.org/zap v1.24.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20230821184602-ccc8af3d0e93 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect
Expand All @@ -394,13 +394,13 @@ require (
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
lukechampine.com/uint128 v1.3.0 // indirect
modernc.org/cc/v3 v3.40.0 // indirect
modernc.org/ccgo/v3 v3.16.13 // indirect
modernc.org/cc/v3 v3.41.0 // indirect
modernc.org/ccgo/v3 v3.16.15 // indirect
modernc.org/libc v1.24.1 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.6.0 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.7.2 // indirect
modernc.org/opt v0.1.3 // indirect
modernc.org/strutil v1.1.3 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/token v1.1.0 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
Expand Down
Loading

0 comments on commit 1db6a06

Please sign in to comment.