google

package
v0.0.0-...-22b0e53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Copyright 2017 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

This is adapted from https://github.com/kelseyhightower/gcscache/, which is MIT-licensed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	// contains filtered or unexported fields
}

func NewBucket

func NewBucket(name string) *Bucket

func (*Bucket) DeleteService

func (b *Bucket) DeleteService(ctx context.Context, name string) error

func (*Bucket) GetService

func (b *Bucket) GetService(
	ctx context.Context,
	name string,
) (yeoman.ServiceOpts, error)

func (*Bucket) GetServices

func (b *Bucket) GetServices(
	ctx context.Context,
) (map[string]yeoman.ServiceOpts, error)

func (*Bucket) SetService

func (b *Bucket) SetService(
	ctx context.Context,
	serviceOpts yeoman.ServiceOpts,
) error

func (*Bucket) SetServices

func (b *Bucket) SetServices(
	ctx context.Context,
	opts map[string]yeoman.ServiceOpts,
) error

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache implements the autocert.Cache interface using Google Cloud Storage.

func NewCache

func NewCache(ctx context.Context, bucket string) (*Cache, error)

NewCache creates and initializes a new Cache backed by the given Google Cloud Storage bucket.

func (*Cache) Delete

func (c *Cache) Delete(ctx context.Context, name string) error

Delete removes the specified object name.

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, name string) ([]byte, error)

Get reads a certificate data from the specified object name.

func (*Cache) Put

func (c *Cache) Put(ctx context.Context, name string, data []byte) error

Put writes the certificate data to the specified object name.

type GCP

type GCP struct {
	// contains filtered or unexported fields
}

GCP implements yeoman.VMStore and yeoman.IPStore.

func NewGCP

func NewGCP(
	client *http.Client,
	projectName, region, zone, serviceAccount string,
	registryName, registryPath string,
) (*GCP, error)

func (*GCP) CreateStaticIP

func (g *GCP) CreateStaticIP(
	ctx context.Context,
	log *slog.Logger,
	name string,
	typ yeoman.IPType,
) (yeoman.IP, error)

func (*GCP) CreateVM

func (g *GCP) CreateVM(
	ctx context.Context,
	log *slog.Logger,
	vm yeoman.VM,
) error

func (*GCP) DeleteVM

func (g *GCP) DeleteVM(
	ctx context.Context,
	log *slog.Logger,
	name string,
) error

func (*GCP) GetAllVMs

func (g *GCP) GetAllVMs(
	ctx context.Context,
	log *slog.Logger,
) ([]yeoman.VM, error)

func (*GCP) GetStaticIPs

func (g *GCP) GetStaticIPs(
	ctx context.Context,
	log *slog.Logger,
) (yeoman.StaticIPs, error)

func (*GCP) GetVM

func (g *GCP) GetVM(
	ctx context.Context,
	log *slog.Logger,
	name string,
) (yeoman.VM, error)

func (*GCP) RestartVM

func (g *GCP) RestartVM(
	ctx context.Context,
	log *slog.Logger,
	vm yeoman.VM,
) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL