gapi

package
v0.0.0-...-81daf10 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package gapi defines the interface that graph API generators must meet.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Hostname      string // uuid for the host, required for GAPI
	World         resources.World
	Noop          bool
	NoConfigWatch bool
	NoStreamWatch bool
}

Data is the set of input values passed into the GAPI structs via Init.

type GAPI

type GAPI interface {
	Init(Data) error               // initializes the GAPI and passes in useful data
	Graph() (*pgraph.Graph, error) // returns the most recent pgraph
	Next() chan Next               // returns a stream of switch events
	Close() error                  // shutdown the GAPI
}

GAPI is a Graph API that represents incoming graphs and change streams.

type Next

type Next struct {
	// FIXME: the Fast pause parameter should eventually get replaced with a
	// "SwitchMethod" parameter or similar that instead lets the implementer
	// choose between fast pause, slow pause, and interrupt. Interrupt could
	// be a future extension to the Resource API that lets an Interrupt() be
	// called if we want to exit immediately from the CheckApply part of the
	// resource for some reason. For now we'll keep this simple with a bool.
	Fast bool  // run a fast pause to switch?
	Exit bool  // should we cause the program to exit? (specify err or not)
	Err  error // if something goes wrong (use with or without exit!)
}

Next describes the particular response the GAPI implementer wishes to emit.

Jump to

Keyboard shortcuts

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