Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-03-01 15:48:51 +00:00
parent 818f632239
commit 2485a8b887
29 changed files with 1605 additions and 1547 deletions

View File

@@ -13,6 +13,7 @@ type Function interface {
Proxy(*ProxyRequest) (*ProxyResponse, error)
Regions(*RegionsRequest) (*RegionsResponse, error)
Reserve(*ReserveRequest) (*ReserveResponse, error)
Runtimes(*RuntimesRequest) (*RuntimesResponse, error)
Update(*UpdateRequest) (*UpdateResponse, error)
}
@@ -92,6 +93,14 @@ func (t *FunctionService) Reserve(request *ReserveRequest) (*ReserveResponse, er
}
// Return a list of supported runtimes
func (t *FunctionService) Runtimes(request *RuntimesRequest) (*RuntimesResponse, error) {
rsp := &RuntimesResponse{}
return rsp, t.client.Call("function", "Runtimes", request, rsp)
}
// Update a function. Downloads the source, builds and redeploys
func (t *FunctionService) Update(request *UpdateRequest) (*UpdateResponse, error) {
@@ -238,6 +247,13 @@ type ReserveResponse struct {
Reservation *Reservation `json:"reservation"`
}
type RuntimesRequest struct {
}
type RuntimesResponse struct {
Runtimes []string `json:"runtimes"`
}
type UpdateRequest struct {
// function name
Name string `json:"name"`