grafeas / voucher

🎟 Voucher creates attestations for Binary Authorization
Apache License 2.0
73 stars 24 forks source link

client: functional opts for constructor #54

Closed thepwagner closed 2 years ago

thepwagner commented 2 years ago

Update the client package to prefer NewClient() with functional options.

This removes the need for multiple constructors (we were up to 3):

This removes the need for SetFooBar() post-construction intializers (we were up to 2):

The highest risk change here is to the voucher-client binary, where getVoucherClient() is refactored to build []client.Options and fall-through.

Related