mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-30 18:48:39 -04:00
Document exported funcs,types,interfaces and enable check. (#475)
* Include EXC0014 and fix issues. * Include EXC0012 and fix issues. Signed-off-by: Fabian Kammel <fk@edgeless.systems> Co-authored-by: Otto Bittner <cobittner@posteo.net>
This commit is contained in:
parent
c9873f2bfb
commit
0d12e37c96
74 changed files with 337 additions and 78 deletions
|
@ -16,12 +16,14 @@ import (
|
|||
computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
|
||||
)
|
||||
|
||||
// Client for GCP Image API.
|
||||
type Client struct {
|
||||
client *compute.ImagesClient
|
||||
log *logger.Logger
|
||||
opts Options
|
||||
}
|
||||
|
||||
// NewClient creates a new Client.
|
||||
func NewClient(ctx context.Context, log *logger.Logger, opts Options) *Client {
|
||||
client, err := compute.NewImagesRESTClient(ctx)
|
||||
if err != nil {
|
||||
|
@ -35,10 +37,12 @@ func NewClient(ctx context.Context, log *logger.Logger, opts Options) *Client {
|
|||
}
|
||||
}
|
||||
|
||||
// Close the GCP client.
|
||||
func (c *Client) Close() error {
|
||||
return c.client.Close()
|
||||
}
|
||||
|
||||
// FetchImages for the given client options.
|
||||
func (c *Client) FetchImages(ctx context.Context) (map[string]string, error) {
|
||||
imgIterator := c.client.List(ctx, &computepb.ListImagesRequest{
|
||||
Project: c.opts.ProjectID,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue