metadata

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: Apache-2.0 Imports: 12 Imported by: 10

Documentation

Overview

Package metadata provides methods to deal with a metadata container server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(r runner.Runner, metadataImage string) error

StartServer starts the metadata server container.

The container is mapped to hostPort 8082, which is where RealUpdater POSTs to.

Types

type ProjectInfo

type ProjectInfo struct {
	ProjectID  string `json:"project_id"`
	ProjectNum int64  `json:"project_num"`
}

ProjectInfo represents an incoming build request containing the project ID and number to make available as metadata.

type RealUpdater

type RealUpdater struct{}

RealUpdater actually sends POST requests to update spoofed metadata.

func (RealUpdater) SetProjectInfo

func (RealUpdater) SetProjectInfo(b ProjectInfo) error

SetBuild updates the spoofed metadata server's project information.

func (RealUpdater) SetToken

func (RealUpdater) SetToken(tok oauth2.Token) error

SetToken updates the spoofed metadata server's credentials.

func (RealUpdater) Stop

func (RealUpdater) Stop(r runner.Runner) error

Stop stops the metadata server container.

type Token

type Token struct {
	AccessToken string    `json:"access_token"`
	Expiry      time.Time `json:"expiry"`
	Scopes      []string
}

Token represents the OAuth token request containing the access token and the time it expires.

type Updater

type Updater interface {
	SetToken(oauth2.Token) error
	SetProjectInfo(ProjectInfo) error
}

Updater encapsulates updating the spoofed metadata server.

Jump to

Keyboard shortcuts

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