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

Migrate to buf v2 config and update deps #35

Merged
merged 3 commits into from
Jun 19, 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
310 changes: 155 additions & 155 deletions api/duros/v2/durosapiv2.pb.go

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions api/duros/v2/schedule_policy.pb.go

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

14 changes: 7 additions & 7 deletions api/duros/v2/statisticsapiv2.pb.go

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

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

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

18 changes: 3 additions & 15 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,8 @@ func init() {
hostRegex = regexp.MustCompile(`^([a-zA-Z0-9.\[\]:%-]+)$`)
}

// Dial creates a LightOS cluster client. it is a blocking call and will only
// return once the connection to [at least one of the] `targets` has been
// actually established - subject to `ctx` limitations. if `ctx` specified
// timeout or duration - dialling (and only dialling!) timeout will be set
// accordingly. `ctx` can also be used to cancel the dialling process, as per
// usual.
//
// the cluster client will make an effort to transparently reconnect to one of
// the `targets` in case of connection loss. if the process of finding a live
// and responsive target amongst `targets` and establishing the connection takes
// longer than the actual operation context timeout (as opposed to the `ctx`
// passed here) - `DeadlineExceeded` will be returned as usual, and the caller
// can retry the operation.
func Dial(ctx context.Context, config DialConfig) (durosv2.DurosAPIClient, error) {
// Dial creates a LightOS cluster client.
func Dial(config DialConfig) (durosv2.DurosAPIClient, error) {
if config.Credentials != nil && config.ByteCredentials != nil {
return nil, status.Errorf(codes.InvalidArgument,
"if you provide credentials, provide either file or byte credentials but not both")
Expand Down Expand Up @@ -185,7 +173,7 @@ func Dial(ctx context.Context, config DialConfig) (durosv2.DurosAPIClient, error
return nil, fmt.Errorf("unsupported scheme:%v", config.Scheme)
}

conn, err := grpc.DialContext(ctx, config.Endpoint, opts...)
conn, err := grpc.NewClient(config.Endpoint, opts...)
if err != nil {
log.Error("failed to connect", "endpoints", config.Endpoint, "error", err.Error())
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func main() {
dialConfig.Credentials = creds
}

durosClient, err := duros.Dial(ctx, dialConfig)
durosClient, err := duros.Dial(dialConfig)
if err != nil {
panic(err)
}
Expand Down
Loading
Loading