function

package
v1.0.0-percom23 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOW               ServiceClass = 0
	HIGH_PERFORMANCE               = 1
	HIGH_AVAILABILITY              = 2
)

Variables

This section is empty.

Functions

func GetAll

func GetAll() ([]string, error)

Types

type AsyncResponse

type AsyncResponse struct {
	ReqId string
}

type ExecutionReport

type ExecutionReport struct {
	Result         string
	ResponseTime   float64
	IsWarmStart    bool
	InitTime       float64
	OffloadLatency float64
	Duration       float64
	SchedAction    string
}

type Function

type Function struct {
	Name            string
	Runtime         string  // example: python310
	MemoryMB        int64   // MB
	CPUDemand       float64 // 1.0 -> 1 core
	Handler         string  // example: "module.function_name"
	TarFunctionCode string  // input is .tar
	CustomImage     string  // used if custom runtime is chosen
}

A serverless Function.

func GetFunction

func GetFunction(name string) (*Function, bool)

GetFunction retrieves a Function given its name.

func (*Function) Delete

func (f *Function) Delete() error

Delete removes a function from Etcd and the local cache.

func (*Function) SaveToEtcd

func (f *Function) SaveToEtcd() error

func (*Function) String

func (f *Function) String() string

type Request

type Request struct {
	ReqId      string
	Fun        *Function
	Params     map[string]interface{}
	Arrival    time.Time
	ExecReport ExecutionReport
	RequestQoS
	CanDoOffloading bool
	Async           bool
}

Request represents a single function invocation.

func (*Request) String

func (r *Request) String() string

type RequestQoS

type RequestQoS struct {
	Class    ServiceClass
	MaxRespT float64
}

type Response

type Response struct {
	Success bool
	ExecutionReport
}

type ServiceClass

type ServiceClass int64

Jump to

Keyboard shortcuts

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