function

package
Version: v0.0.0-...-f1c27b4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 10 Imported by: 0

README

garbage-collect

This function takes a Git owner / repo and list of functions.

The function queries the functions for the owner using the list-functions function - parses the result and then reconciles the differences by deleting any functions which are not in the deployment list but that also match the repo.

Scenario 1:

Event: initial push

owner: alexellis repo: alexa-skill functions: fn1, fn2

Event: second push with fn2 removed

owner: alexellis repo: alexa-skill functions: fn1

fn2 is now orphaned so the garbage-collect will remove it.

Event: third push with fn1 renamed to fn3

owner: alexellis repo: alexa-skill functions: fn3

fn1 is now orphaned so will be deleted

Documentation

Index

Constants

View Source
const Source = "garbage-collect"

Variables

This section is empty.

Functions

func Handle

func Handle(req []byte) string

Handle function cleans up functions which were removed or renamed within the repo for the given user.

Types

type GarbageRequest

type GarbageRequest struct {
	Functions []string `json:"functions"`
	Repo      string   `json:"repo"`
	Owner     string   `json:"owner"`
}

Source Files

Jump to

Keyboard shortcuts

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