| 1 |
// Code generated by protoc-gen-connect-go. DO NOT EDIT. |
| 2 |
// |
| 3 |
// Source: svc/cliupdate/v1/service.proto |
| 4 |
|
| 5 |
package cliupdatev1connect |
| 6 |
|
| 7 |
import ( |
| 8 |
context "context" |
| 9 |
errors "errors" |
| 10 |
connect_go "github.com/bufbuild/connect-go" |
| 11 |
v1 "github.com/humanlogio/api/go/svc/cliupdate/v1" |
| 12 |
http "net/http" |
| 13 |
strings "strings" |
| 14 |
) |
| 15 |
|
| 16 |
// This is a compile-time assertion to ensure that this generated file and the connect package are |
| 17 |
// compatible. If you get a compiler error that this constant is not defined, this code was |
| 18 |
// generated with a version of connect newer than the one compiled into your binary. You can fix the |
| 19 |
// problem by either regenerating this code with an older version of connect or updating the connect |
| 20 |
// version compiled into your binary. |
| 21 |
const _ = connect_go.IsAtLeastVersion0_1_0 |
| 22 |
|
| 23 |
const ( |
| 24 |
// UpdateServiceName is the fully-qualified name of the UpdateService service. |
| 25 |
UpdateServiceName = "svc.cliupdate.v1.UpdateService" |
| 26 |
) |
| 27 |
|
| 28 |
// UpdateServiceClient is a client for the svc.cliupdate.v1.UpdateService service. |
| 29 |
type UpdateServiceClient interface { |
| 30 |
GetNextUpdate(context.Context, *connect_go.Request[v1.GetNextUpdateRequest]) (*connect_go.Response[v1.GetNextUpdateResponse], error) |
| 31 |
} |
| 32 |
|
| 33 |
// NewUpdateServiceClient constructs a client for the svc.cliupdate.v1.UpdateService service. By |
| 34 |
// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, |
| 35 |
// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the |
| 36 |
// connect.WithGRPC() or connect.WithGRPCWeb() options. |
| 37 |
// |
| 38 |
// The URL supplied here should be the base URL for the Connect or gRPC server (for example, |
| 39 |
// http://api.acme.com or https://acme.com/grpc). |
| 40 |
func NewUpdateServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) UpdateServiceClient { |
| 41 |
baseURL = strings.TrimRight(baseURL, "/") |
| 42 |
return &updateServiceClient{ |
| 43 |
getNextUpdate: connect_go.NewClient[v1.GetNextUpdateRequest, v1.GetNextUpdateResponse]( |
| 44 |
httpClient, |
| 45 |
baseURL+"/svc.cliupdate.v1.UpdateService/GetNextUpdate", |
| 46 |
opts..., |
| 47 |
), |
| 48 |
} |
| 49 |
} |
| 50 |
|
| 51 |
// updateServiceClient implements UpdateServiceClient. |
| 52 |
type updateServiceClient struct { |
| 53 |
getNextUpdate *connect_go.Client[v1.GetNextUpdateRequest, v1.GetNextUpdateResponse] |
| 54 |
} |
| 55 |
|
| 56 |
// GetNextUpdate calls svc.cliupdate.v1.UpdateService.GetNextUpdate. |
| 57 |
func (c *updateServiceClient) GetNextUpdate(ctx context.Context, req *connect_go.Request[v1.GetNextUpdateRequest]) (*connect_go.Response[v1.GetNextUpdateResponse], error) { |
| 58 |
return c.getNextUpdate.CallUnary(ctx, req) |
| 59 |
} |
| 60 |
|
| 61 |
// UpdateServiceHandler is an implementation of the svc.cliupdate.v1.UpdateService service. |
| 62 |
type UpdateServiceHandler interface { |
| 63 |
GetNextUpdate(context.Context, *connect_go.Request[v1.GetNextUpdateRequest]) (*connect_go.Response[v1.GetNextUpdateResponse], error) |
| 64 |
} |
| 65 |
|
| 66 |
// NewUpdateServiceHandler builds an HTTP handler from the service implementation. It returns the |
| 67 |
// path on which to mount the handler and the handler itself. |
| 68 |
// |
| 69 |
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf |
| 70 |
// and JSON codecs. They also support gzip compression. |
| 71 |
func NewUpdateServiceHandler(svc UpdateServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) { |
| 72 |
mux := http.NewServeMux() |
| 73 |
mux.Handle("/svc.cliupdate.v1.UpdateService/GetNextUpdate", connect_go.NewUnaryHandler( |
| 74 |
"/svc.cliupdate.v1.UpdateService/GetNextUpdate", |
| 75 |
svc.GetNextUpdate, |
| 76 |
opts..., |
| 77 |
)) |
| 78 |
return "/svc.cliupdate.v1.UpdateService/", mux |
| 79 |
} |
| 80 |
|
| 81 |
// UnimplementedUpdateServiceHandler returns CodeUnimplemented from all methods. |
| 82 |
type UnimplementedUpdateServiceHandler struct{} |
| 83 |
|
| 84 |
func (UnimplementedUpdateServiceHandler) GetNextUpdate(context.Context, *connect_go.Request[v1.GetNextUpdateRequest]) (*connect_go.Response[v1.GetNextUpdateResponse], error) { |
| 85 |
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("svc.cliupdate.v1.UpdateService.GetNextUpdate is not implemented")) |
| 86 |
} |