Skip to content

Commit d5221b3

Browse files
authored
Merge pull request #17 from ecordell/expose-clients
feat(client): expose underlying clients
2 parents 9e81ad2 + b4f2036 commit d5221b3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pkg/client/client.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,31 @@ type Interface interface {
1717
}
1818

1919
type Client struct {
20-
client api.RegistryClient
21-
health grpc_health_v1.HealthClient
22-
conn *grpc.ClientConn
20+
Registry api.RegistryClient
21+
Health grpc_health_v1.HealthClient
22+
Conn *grpc.ClientConn
2323
}
2424

2525
var _ Interface = &Client{}
2626

2727
func (c *Client) GetBundleInPackageChannel(ctx context.Context, packageName, channelName string) (*registry.Bundle, error) {
28-
bundle, err := c.client.GetBundleForChannel(ctx, &api.GetBundleInChannelRequest{PkgName: packageName, ChannelName: channelName})
28+
bundle, err := c.Registry.GetBundleForChannel(ctx, &api.GetBundleInChannelRequest{PkgName: packageName, ChannelName: channelName})
2929
if err != nil {
3030
return nil, err
3131
}
3232
return registry.NewBundleFromStrings(bundle.CsvName, packageName, channelName, bundle.Object)
3333
}
3434

3535
func (c *Client) GetReplacementBundleInPackageChannel(ctx context.Context, currentName, packageName, channelName string) (*registry.Bundle, error) {
36-
bundle, err := c.client.GetBundleThatReplaces(ctx, &api.GetReplacementRequest{CsvName: currentName, PkgName: packageName, ChannelName: channelName})
36+
bundle, err := c.Registry.GetBundleThatReplaces(ctx, &api.GetReplacementRequest{CsvName: currentName, PkgName: packageName, ChannelName: channelName})
3737
if err != nil {
3838
return nil, err
3939
}
4040
return registry.NewBundleFromStrings(bundle.CsvName, packageName, channelName, bundle.Object)
4141
}
4242

4343
func (c *Client) GetBundleThatProvides(ctx context.Context, group, version, kind string) (*registry.Bundle, error) {
44-
bundle, err := c.client.GetDefaultBundleThatProvides(ctx, &api.GetDefaultProviderRequest{Group: group, Version: version, Kind: kind})
44+
bundle, err := c.Registry.GetDefaultBundleThatProvides(ctx, &api.GetDefaultProviderRequest{Group: group, Version: version, Kind: kind})
4545
if err != nil {
4646
return nil, err
4747
}
@@ -58,8 +58,8 @@ func NewClient(address string) (*Client, error) {
5858
return nil, err
5959
}
6060
return &Client{
61-
client: api.NewRegistryClient(conn),
62-
health: grpc_health_v1.NewHealthClient(conn),
63-
conn: conn,
61+
Registry: api.NewRegistryClient(conn),
62+
Health: grpc_health_v1.NewHealthClient(conn),
63+
Conn: conn,
6464
}, nil
6565
}

0 commit comments

Comments
 (0)