handler

package
v0.0.0-...-2af310e Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IDFormat   = regexp.MustCompilePOSIX("^[a-z0-9-]+$")
	NameFormat = regexp.MustCompilePOSIX("^[a-z0-9]+$")

	FunctionKey    = "function/func/"
	OwnerKey       = "function/owner/"
	ReservationKey = "function/reservation/"
	BuildLogsKey   = "function/buildlogs/"
)
View Source
var (
	GoogleRuntimes = []string{
		"nodejs16",
		"python39",
		"go116",
		"java11",
		"dotnet3",
		"ruby27",
		"php74",
	}

	// hardcoded list of supported regions
	GoogleRegions = []string{"europe-west1", "us-central1", "us-east1", "us-west1", "asia-east1"}

	SourceFile = map[string]string{
		"nodejs16": "index.js",
		"nodejs14": "index.js",
		"nodejs12": "index.js",
		"nodejs10": "index.js",
		"nodejs8":  "index.js",
		"nodejs6":  "index.js",
		"python39": "main.py",
		"python38": "main.py",
		"python37": "main.py",
		"go116":    "main.go",
		"go113":    "main.go",
		"go111":    "main.go",
		"java11":   "main.java",
		"dotnet3":  "main.cs",
		"ruby27":   "app.rb",
		"ruby26":   "app.rb",
		"php74":    "index.php",
	}

	GitIgnore = []string{
		".git",
		"dist",
		"node_modules",
		"vendor",
		"*.jar",
	}
)

Functions

This section is empty.

Types

type Function

type Function struct{}

func (*Function) Reserve

func (f *Function) Reserve(ctx context.Context, req *pb.ReserveRequest, rsp *pb.ReserveResponse) error

Call is a single request handler called via client.Call or the generated client code

func (*Function) Usage

func (a *Function) Usage(ctx context.Context, request *adminpb.UsageRequest, response *adminpb.UsageResponse) error

type GoogleFunction

type GoogleFunction struct {
	*Function
	// contains filtered or unexported fields
}

func NewFunction

func NewFunction(svc *service.Service) *GoogleFunction

func (*GoogleFunction) Call

func (*GoogleFunction) Delete

func (*GoogleFunction) DeleteData

func (e *GoogleFunction) DeleteData(ctx context.Context, request *adminpb.DeleteDataRequest, response *adminpb.DeleteDataResponse) error

func (*GoogleFunction) Deploy

func (*GoogleFunction) Describe

func (*GoogleFunction) List

func (*GoogleFunction) Logs

func (*GoogleFunction) Proxy

func (*GoogleFunction) Regions

func (*GoogleFunction) Runtimes

func (*GoogleFunction) Update

func (*GoogleFunction) Usage

func (e *GoogleFunction) Usage(ctx context.Context, request *adminpb.UsageRequest, response *adminpb.UsageResponse) error

func (*GoogleFunction) WriteGcloudIgnore

func (e *GoogleFunction) WriteGcloudIgnore(dir string) error

type Reservation

type Reservation struct {
	// The function name
	Name string `json:"name"`
	// The owner e.g tenant id
	Owner string `json:"owner"`
	// Uniq associated token
	Token string `json:"token"`
	// Time of creation
	Created time.Time `json:"created"`
	// The expiry time
	Expires time.Time `json:"expires"`
}

Jump to

Keyboard shortcuts

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