function

package
v0.0.0-...-1fe5a57 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: MIT Imports: 10 Imported by: 0

README

revshare

OpenFaaS function returns the payment pointer to send SPSP queries to based on the current balance of an OpenFaaS Cloud hosted function.

It takes function's name (i.e. myFunction [required]) from a query and is invoked by GET request to http://gateway-url:8080/function/revshare?function=myFunction

  • queries balance function for the function's current balance
  • queries the gateway for the total number of function invocations
  • returns a string response of the SPSP endpoint to proxy the SPSP query to

Environment Variables

All environment variables are required.

Environment Variable Description
gateway_url Cluster-internal URL of the OpenFaaS gateway service.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(w http.ResponseWriter, r *http.Request)

Types

type FaaSAuth

type FaaSAuth struct{}

func (*FaaSAuth) Set

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

type FunctionBalance

type FunctionBalance struct {
	Balance     uint64 `json:"balance,string"`
	Invocations uint64 `json:"remainingInvocations,string"`
}

TODO: import me

Jump to

Keyboard shortcuts

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