mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 11:15:12 +00:00
22 lines
397 B
Go
Executable File
22 lines
397 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/micro/services/clients/go/file"
|
|
)
|
|
|
|
// Save a file
|
|
func SaveFile() {
|
|
fileService := file.NewFileService(os.Getenv("MICRO_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)
|
|
}
|