Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maliaga-pantoja/golang-appwrite-demo
golang demo using appwrite
https://github.com/maliaga-pantoja/golang-appwrite-demo
appwrite golang guide
Last synced: 3 months ago
JSON representation
golang demo using appwrite
- Host: GitHub
- URL: https://github.com/maliaga-pantoja/golang-appwrite-demo
- Owner: maliaga-pantoja
- Created: 2021-10-08T04:20:16.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-09T07:12:14.000Z (over 3 years ago)
- Last Synced: 2024-10-10T19:22:30.420Z (4 months ago)
- Topics: appwrite, golang, guide
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-appwrite - Source Code
README
Golang demo using appwrite. This is a guide about how to use appwrite rest api for database resource with golang.
## AppWrite
First, you need to run appwrite. I recommend to you to follow the official [appwrite guide](https://appwrite.io) in the getting start section.
Its a shortcut ussing docker:
```
docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
appwrite/appwrite:0.10.4
```
## How to
run the script
```
/bin/sh run.sh
```
## What i need to modify?
You need to to modify env vars set in run.sh using your own
- BASEPATH
- PORT
- PROJECT_ID
- TOKEN
## How it works ?
It project use the appwrite provided apis. Fow now, only database endpoint are implement in this project.
### Procedures
- Create new collection
- List all avaiable collections
- Create a new document using the id of inserted collection
## Tips
Is required to set payload for create collection in the format below
```
{
"data": {
"key": "value3"
}
}
```
The data key is mandatory. *key* is the registered key in Collection.CollectionCreateInputRule.
If you modify the value of key, modify it in the create collection payload too.### Example
```
inputRule := Collection.CollectionCreateInputRule{
Label: "label",
Key: "myKey",
Type: "text",
Default: "no set",
Required: false,
Array: false,
}{
"data": {
"myKey": "value4"
}
}
```
The value of Label is for web interface