Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2021-10-29 10:44:29 +00:00
parent 4e64b77e47
commit eb73d115f2
212 changed files with 970 additions and 970 deletions

View File

@@ -4,6 +4,37 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/File/api](http
Endpoints:
## Save
Save a file
[https://m3o.com/file/api#Save](https://m3o.com/file/api#Save)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/file"
)
// Save a file
func SaveFile() {
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
rsp, err := fileService.Save(&file.SaveRequest{
File: &file.Record{
Content: "file content example",
Path: "/document/text-files/file.txt",
Project: "examples",
},
})
fmt.Println(rsp, err)
}
```
## List
List files by their project and optionally a path.
@@ -18,7 +49,7 @@ import(
"fmt"
"os"
"github.com/go.m3o.com/file"
"go.m3o.com/file"
)
// List files by their project and optionally a path.
@@ -45,7 +76,7 @@ import(
"fmt"
"os"
"github.com/go.m3o.com/file"
"go.m3o.com/file"
)
// Delete a file by project name/path
@@ -73,7 +104,7 @@ import(
"fmt"
"os"
"github.com/go.m3o.com/file"
"go.m3o.com/file"
)
// Read a file by path
@@ -87,34 +118,3 @@ Project: "examples",
fmt.Println(rsp, err)
}
```
## Save
Save a file
[https://m3o.com/file/api#Save](https://m3o.com/file/api#Save)
```go
package example
import(
"fmt"
"os"
"github.com/go.m3o.com/file"
)
// Save a file
func SaveFile() {
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
rsp, err := fileService.Save(&file.SaveRequest{
File: &file.Record{
Content: "file content example",
Path: "/document/text-files/file.txt",
Project: "examples",
},
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"os"
"github.com/go.m3o.com/file"
"go.m3o.com/file"
)
// Delete a file by project name/path

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"os"
"github.com/go.m3o.com/file"
"go.m3o.com/file"
)
// List files by their project and optionally a path.

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"os"
"github.com/go.m3o.com/file"
"go.m3o.com/file"
)
// Read a file by path

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"os"
"github.com/go.m3o.com/file"
"go.m3o.com/file"
)
// Save a file