Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-01-28 11:38:06 +00:00
parent da1038343f
commit 3e8a881233
23 changed files with 1181 additions and 1181 deletions

View File

@@ -35,12 +35,12 @@ Request: map[string]interface{}{
}
```
## List
## Delete
List all the deployed functions
Delete a function by name
[https://m3o.com/function/api#List](https://m3o.com/function/api#List)
[https://m3o.com/function/api#Delete](https://m3o.com/function/api#Delete)
```go
package example
@@ -52,11 +52,12 @@ import(
"go.m3o.com/function"
)
// List all the deployed functions
func ListFunctions() {
// Delete a function by name
func DeleteAfunction() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.List(&function.ListRequest{
rsp, err := functionService.Delete(&function.DeleteRequest{
Name: "helloworld",
})
fmt.Println(rsp, err)
@@ -115,6 +116,34 @@ func ReserveAfunction() {
})
fmt.Println(rsp, err)
}
```
## Proxy
Return the backend url for proxying
[https://m3o.com/function/api#Proxy](https://m3o.com/function/api#Proxy)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// Return the backend url for proxying
func ProxyUrl() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Proxy(&function.ProxyRequest{
Id: "helloworld",
})
fmt.Println(rsp, err)
}
```
## Deploy
@@ -179,12 +208,12 @@ func UpdateAfunction() {
}
```
## Delete
## List
Delete a function by name
List all the deployed functions
[https://m3o.com/function/api#Delete](https://m3o.com/function/api#Delete)
[https://m3o.com/function/api#List](https://m3o.com/function/api#List)
```go
package example
@@ -196,12 +225,11 @@ import(
"go.m3o.com/function"
)
// Delete a function by name
func DeleteAfunction() {
// List all the deployed functions
func ListFunctions() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Delete(&function.DeleteRequest{
Name: "helloworld",
rsp, err := functionService.List(&function.ListRequest{
})
fmt.Println(rsp, err)
@@ -235,31 +263,3 @@ func DescribeFunctionStatus() {
}
```
## Proxy
Return the backend url for proxying
[https://m3o.com/function/api#Proxy](https://m3o.com/function/api#Proxy)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// Return the backend url for proxying
func ProxyUrl() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Proxy(&function.ProxyRequest{
Id: "helloworld",
})
fmt.Println(rsp, err)
}
```