function

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

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 12 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 FaaSAuth

type FaaSAuth struct {
}

FaaSAuth Authentication type for OpenFaaS

func (*FaaSAuth) Set

func (auth *FaaSAuth) Set(req *http.Request) error

Set add basic authentication to the request

type GarbageRequest

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

Jump to

Keyboard shortcuts

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