Skip to content

Commit 3e10b12

Browse files
committed
Initial commit
0 parents  commit 3e10b12

File tree

163 files changed

+7182
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+7182
-0
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# VS code
2+
.vscode
3+
4+
# IntelliJ
5+
.idea
6+
7+
# macOS
8+
.DS_Store
9+
10+
# vim
11+
*.swp
12+
13+
# docker
14+
*dockerfile*

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# **CHANGELOG**
2+
3+
## 0.0.1
4+

LICENSE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Appwrite Go SDK
2+
3+
![License](https://img.shields.io/github/license/appwrite/sdk-for-go.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.2.1-blue.svg?style=flat-square)
5+
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
6+
7+
**WORK IN PROGRESS - NOT READY FOR USAGE**
8+
9+
This repository is maintained solely to support [illa-builder](https://github.com/illacloud/illa-builder). It should not be used in production environments.
10+
11+
## Installation
12+
13+
To install using `go get`:
14+
15+
```bash
16+
go get github.com/illacloud/appwrite-sdk-go
17+
```
18+
19+
## Testing the SDK
20+
21+
* clone this repo.
22+
* create a project and within this project a collection.
23+
* configure the documents in the collection to have a _key_ = __hello__.
24+
* Then inject these environment variables:
25+
26+
```bash
27+
export YOUR_ENDPOINT=https://appwrite.io/v1
28+
export YOUR_PROJECT_ID=6…8
29+
export YOUR_KEY="7055781…cd95"
30+
export COLLECTION_ID=616a095b20180
31+
```
32+
33+
Create `main.go` file with:
34+
35+
```go
36+
package main
37+
38+
import (
39+
"log"
40+
"os"
41+
"time"
42+
43+
"github.com/illacloud/appwrite-sdk-go/appwrite"
44+
)
45+
46+
func main() {
47+
client := appwrite.NewClient(10 * time.Second)
48+
client.SetEndpoint(os.Getenv("YOUR_ENDPOINT"))
49+
client.SetProject(os.Getenv("YOUR_PROJECT_ID"))
50+
client.SetKey(os.Getenv("YOUR_KEY"))
51+
52+
db := appwrite.NewDatabase(client)
53+
data := map[string]string{
54+
"hello": "world",
55+
}
56+
var EmptyArray = []interface{}{}
57+
doc, err := db.CreateDocument(
58+
os.Getenv("COLLECTION_ID"),
59+
data,
60+
EmptyArray,
61+
EmptyArray,
62+
"",
63+
"",
64+
"",
65+
)
66+
if err != nil {
67+
log.Printf("Error creating document: %v", err)
68+
}
69+
log.Printf("Created document: %v", doc)
70+
}
71+
```
72+
73+
* After that, run the following
74+
75+
> % go run main.go
76+
> 2021/10/16 03:41:17 Created document: map[$collection:616a095b20180 $id:616a2dbd4df16 $permissions:map[read:[] write:[]] hello:world]
77+
78+
79+
## Contribution
80+
81+
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). This repository is maintained solely to support [illa-builder](https://github.com/illacloud/illa-builder). External contributions are not accepted at this time. To learn more about how you can help us improve this SDK, please check the Appwrite SDK Generator [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md).
82+
83+
## License
84+
85+
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.

0 commit comments

Comments
 (0)