gce

package
v0.0.0-...-bb15e6e Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package gce configures hooks for running Perkeep for Google Compute Engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlobpackedRecoveryValue

func BlobpackedRecoveryValue() int

BlobpackedRecoveryValue returns the blobpacked recovery level (0, 1, 2) from the GCE instance metadata.

The return type here is logically a blobpacked.RecoveryMode, but we're not importing that here to save a dependency.

func FixUserDataForPerkeepRename

func FixUserDataForPerkeepRename()

FixUserDataForPerkeepRename checks whether the value of "user-data" in the GCE metadata is up to date with the correct systemd service and docker image tarball based on the "perkeep" name. If not (i.e. they're the old "camlistore" based ones), it fixes said metadata. It returns whether the metadata was indeed changed, which indicates that the instance should be restarted for the change to take effect.

func LogWriter

func LogWriter() (w io.WriteCloser, err error)

LogWriter returns an environment-specific io.WriteCloser suitable for passing to log.SetOutput. It will also include writing to os.Stderr as well. Since it might be writing to a Google Cloud Logger, it is the responsibility of the caller to Close it when needed, to flush the last log entries.

func SetInstanceHostname

func SetInstanceHostname(camliNetHostName string) error

SetInstanceHostname sets the "camlistore-hostname" metadata on the GCE instance where perkeepd is running. The value set is the same as the one we register with the camlistore.net DNS, i.e. "<gpgKeyId>.camlistore.net", where <gpgKeyId> is the short form (8 trailing chars) of Perkeep's keyId.

Types

This section is empty.

Jump to

Keyboard shortcuts

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