grid

package module
v0.0.0-...-f6f3f6c Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

grid

Main Build Status Develop Build Status Documentation GitHub Issues License Release

Grid adapter for converting faas platforms into a predictable pool of homogonized compute resources.

Architecture

This service runs along side function instances and is implicitly available at 127.0.0.1:1111. The API presented is a lazily-populated intersection of feature sets provided by supported platforms.

Utilized during the build process of buildpacks, and transparent to a function developer insofar as implementation.

Status

This is currently a work in progress, with merely stub implementations of some example endpoints. These will be expanded as we settle on use cases we would like to be available to "Portable Functions" (Functions which will be able to run on multiple cloud platforms presuming they are built and packaged using Boson buildpacks).

Documentation

Index

Constants

View Source
const DefaultAddress = "127.0.0.1:1111"

DefaultAddress of the server is to listen only on the loopback interface.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Instances() (int, error)
	SubscriptionManager() SubscriptionManager
	EventManager() EventManager
}

type EventManager

type EventManager interface {
	// Create an event registration
	Create(string) error
	// Delete an event registration (must have been created by this service).
	Delete(string) error
	// List all available events
	List() ([]string, error)
}

EventManager for registering emitted events

type Grid

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

Grid service.

func New

func New(options ...Option) *Grid

New grid service instance.

func (*Grid) Addr

func (g *Grid) Addr() net.Addr

Addr is the current listening address, or nil if not yet listening

func (*Grid) Serve

func (g *Grid) Serve(ctx context.Context) (err error)

type Option

type Option func(*Grid)

func WithAdapter

func WithAdapter(a Adapter) Option

func WithAddress

func WithAddress(a string) Option

func WithOnListen

func WithOnListen(f func()) Option

func WithVerbose

func WithVerbose(v bool) Option

func WithVersion

func WithVersion(v string) Option

type SubscriptionManager

type SubscriptionManager interface {
	// Create a new subscription
	Create(string) error
	// Delete a subscription
	Delete(string) error
	// List all active subscriptions
	List() ([]string, error)
}

Subscription manager

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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