mirror of
https://github.com/appwrite/appwrite
synced 2026-05-13 03:59:07 +00:00
832 B
832 B
package main
import ( "fmt" "github.com/appwrite/sdk-for-go/client" "github.com/appwrite/sdk-for-go/databases" )
func main() { client := client.New( client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint client.WithProject("<YOUR_PROJECT_ID>") // Your project ID client.WithKey("<YOUR_API_KEY>") // Your secret API key )
service := databases.New(client)
response, error := service.CreateCollection(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"<NAME>",
databases.WithCreateCollectionPermissions(interface{}{"read("any")"}),
databases.WithCreateCollectionDocumentSecurity(false),
databases.WithCreateCollectionEnabled(false),
)
if error != nil {
panic(error)
}
fmt.Println(response)
}