1
0
Fork 0
mirror of synced 2024-07-12 01:45:54 +12:00
appwrite/app/sdks/go/docs/examples/Database/list-collections.md
2019-10-18 21:42:02 +03:00

672 B

Database Examples

ListCollections

    package appwrite-listcollections

    import (
        "fmt"
        "os"
        "github.com/appwrite/sdk-for-go"
    )

    func main() {
        // Create a Client
        var clt := appwrite.Client{}

        // Set Client required headers
        clt.SetProject("")
        clt.SetKey("")

        // Create a new Database service passing Client
        var srv := appwrite.Database{
            client: &clt
        }

        // Call ListCollections method and handle results
        var res, err := srv.ListCollections()
        if err != nil {
            panic(err)
        }

        fmt.Println(res)
    }