config

package
v0.0.0-...-55c649e Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Overview

Package config exports functionality for storing/retrieving build step configuration on/from the local disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(r io.Reader, v interface{}) error

Load deserializes JSON formatted data into the given struct.

func LoadFromFile

func LoadFromFile(path string, v interface{}) (err error)

LoadFromFile loads JSON data from a file into the given struct.

func Save

func Save(w io.Writer, v interface{}) error

Save serializes the given struct as JSON and writes it out.

func SaveConfigToFile

func SaveConfigToFile(configFile *os.File, v interface{}) error

SaveConfigToFile clears the target config file and then saves the new config data.

func SaveConfigToPath

func SaveConfigToPath(configPath string, config interface{}) (err error)

SaveConfigToPath does the same thing as SaveConfigToFile, but updates a file system path.

Types

type Build

type Build struct {
	GCSBucket string
	GCSDir    string
	Project   string
	Zone      string
	DiskSize  int
	GPUType   string
	Timeout   string
	GCSFiles  []string
}

Build stores configuration data associated with the image build session.

type Image

type Image struct {
	*compute.Image
	Project string
}

Image stores GCE image configuration.

func NewImage

func NewImage(name string, project string) *Image

NewImage builds an Image with some initialized defaults.

func (*Image) MarshalJSON

func (i *Image) MarshalJSON() ([]byte, error)

MarshalJSON marshals the image configuration into JSON.

func (*Image) URL

func (i *Image) URL() string

URL gets the partial GCE URL of the image.

Jump to

Keyboard shortcuts

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