runtime

package
v0.0.0-...-9c1c3c2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProjectOrDefault

func ProjectOrDefault(project string) string

func Serve

func Serve(symbols map[string]interface{})

Consider allowing HTTP handler functions to be directly detectable and turned into an HttpFunction(-like thing) with default options. This would require reimplementing a shim type because we can't have a circular reference between the https package and this package.

Types

type ApiVersion

type ApiVersion int
const GCFv1 ApiVersion = 1
const GCFv2 ApiVersion = 2

type Backend

type Backend struct {
	SpecVersion    string            `yaml:"specVersion"`
	RequiredAPIs   map[string]string `yaml:"requiredAPIs,omitempty"`
	CloudFunctions []FunctionSpec    `yaml:"cloudFunctions"`
	Topics         []PubSubSpec      `yaml:"topics,omitempty"`
	Schedules      []ScheduleSpec    `yaml:"schedules,omitempty"`
}

type EventFilter

type EventFilter struct {
	Attribute string `yaml:"attribute"`
	Value     string `yaml:"value"`
}

type EventFilters

type EventFilters []EventFilter

func (EventFilters) MarshalYAML

func (f EventFilters) MarshalYAML() (interface{}, error)

type EventTrigger

type EventTrigger struct {
	EventType           string       `yaml:"eventType,omitempty"`
	EventFilters        EventFilters `yaml:"eventFilters,omitempty"`
	ServiceAccountEmail string       `yaml:"serviceAccountEmail,omitempty"`
}

type FunctionSpec

type FunctionSpec struct {
	ApiVersion ApiVersion `yaml:"apiVersion"`
	EntryPoint string     `yaml:"entryPoint"`
	Id         string     `yaml:"id"`
	Region     string     `yaml:"region,omitempty"`
	Project    string     `yaml:"project,omitempty"`
	// NOTE: In the current schema this is a union between
	// an HTTP and an EventTrigger. Since HTTP triggers have
	// no options in GCFv2 we can just use an empty EventTrigger
	// for now.
	Trigger           EventTrigger `yaml:"trigger"`
	MinInstances      int          `yaml:"minInstances,omitempty"`
	MaxInstances      int          `yaml:"maxInstances,omitempty"`
	AvailableMemoryMB int          `yaml:"availableMemoryMb,omitempty"`
}

type PubSubSpec

type PubSubSpec struct {
	Id            string        `yaml:"id"`
	Project       string        `yaml:"project,omitempty"`
	TargetService TargetService `yaml:"targetService"`
}

type ScheduleRetryConfig

type ScheduleRetryConfig struct {
	RetryCount int `yaml:"retryCount,omitempty"`
}

type ScheduleSpec

type ScheduleSpec struct {
	Id            string              `yaml:"id"`
	Project       string              `yaml:"project"`
	Schedule      string              `yaml:"schedule"`
	TimeZone      string              `yaml:"timeZone,omitempty"`
	RetryConfig   ScheduleRetryConfig `yaml:"retryConfig"`
	Transport     Transport           `yaml:"transport"`
	TargetService TargetService       `yaml:"targetService"`
}

type TargetService

type TargetService struct {
	Id      string `yaml:"id"`
	Region  string `yaml:"region,omitempty"`
	Project string `yaml:"project,omitempty"`
}

type Transport

type Transport string
const HttpsTransport Transport = "https"
const PubSubTransport Transport = "pubsub"

Jump to

Keyboard shortcuts

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