mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
Commit from m3o/m3o action
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user