mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-12 02:45:11 +00:00
20 lines
520 B
Go
Executable File
20 lines
520 B
Go
Executable File
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"go.m3o.com/space"
|
|
)
|
|
|
|
// Create an object. Returns error if object with this name already exists. Max object size of 10MB, see Upload endpoint for larger objects. If you want to update an existing object use the `Update` endpoint
|
|
func main() {
|
|
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
|
|
rsp, err := spaceService.Create(&space.CreateRequest{
|
|
Name: "images/file.jpg",
|
|
Object: "<file bytes>",
|
|
Visibility: "public",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|