Documentation
¶
Index ¶
- func ToString(arg interface{}) string
- type Avatars
- func (srv *Avatars) GetBrowser(Code string, Width int, Height int, Quality int) (map[string]interface{}, error)
- func (srv *Avatars) GetCreditCard(Code string, Width int, Height int, Quality int) (map[string]interface{}, error)
- func (srv *Avatars) GetFavicon(Url string) (map[string]interface{}, error)
- func (srv *Avatars) GetFlag(Code string, Width int, Height int, Quality int) (map[string]interface{}, error)
- func (srv *Avatars) GetImage(Url string, Width int, Height int) (map[string]interface{}, error)
- func (srv *Avatars) GetQR(Text string, Size int, Margin int, Download int) (map[string]interface{}, error)
- type Client
- func (clt *Client) AddHeader(key string, value string)
- func (clt *Client) Call(method string, path string, headers map[string]interface{}, ...) (map[string]interface{}, error)
- func (clt *Client) SetEndpoint(endpoint string)
- func (clt *Client) SetKey(value string)
- func (clt *Client) SetLocale(value string)
- func (clt *Client) SetMode(value string)
- func (clt *Client) SetProject(value string)
- func (clt *Client) SetSelfSigned(status bool)
- type Database
- func (srv *Database) CreateBooleanAttribute(CollectionId string, key string, required bool, ...) (map[string]interface{}, error)
- func (srv *Database) CreateCollection(CollectionId string, Name string, Permission string, Read []string, ...) (map[string]interface{}, error)
- func (srv *Database) CreateDocument(CollectionId string, Data interface{}, Read []interface{}, Write []interface{}, ...) (map[string]interface{}, error)
- func (srv *Database) CreateEmailAttribute(CollectionId string, key string, required bool, xdefault Optional[string], ...) (map[string]interface{}, error)
- func (srv *Database) CreateEnumAttribute(CollectionId string, key string, elements []string, required bool, ...) (map[string]interface{}, error)
- func (srv *Database) CreateFloatAttribute(CollectionId string, key string, required bool, ...) (map[string]interface{}, error)
- func (srv *Database) CreateIntegerAttribute(CollectionId string, key string, required bool, ...) (map[string]interface{}, error)
- func (srv *Database) CreateIpAttribute(CollectionId string, key string, required bool, ...) (map[string]interface{}, error)
- func (srv *Database) CreateStringAttribute(CollectionId string, key string, size int, required bool, ...) (map[string]interface{}, error)
- func (srv *Database) CreateUrlAttribute(CollectionId string, key string, required bool, xdefault Optional[string], ...) (map[string]interface{}, error)
- func (srv *Database) DeleteCollection(CollectionId string) (map[string]interface{}, error)
- func (srv *Database) DeleteDocument(CollectionId string, DocumentId string) (map[string]interface{}, error)
- func (srv *Database) GetCollection(CollectionId string) (map[string]interface{}, error)
- func (srv *Database) GetDocument(CollectionId string, DocumentId string) (map[string]interface{}, error)
- func (srv *Database) ListCollections(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error)
- func (srv *Database) ListDocuments(CollectionId string, Filters []interface{}, Offset int, Limit int, ...) (map[string]interface{}, error)
- func (srv *Database) UpdateCollection(CollectionId string, Name string, Read []interface{}, Write []interface{}, ...) (map[string]interface{}, error)
- func (srv *Database) UpdateDocument(CollectionId string, DocumentId string, Data interface{}, Read []interface{}, ...) (map[string]interface{}, error)
- type Locale
- func (srv *Locale) Get() (map[string]interface{}, error)
- func (srv *Locale) GetContinents() (map[string]interface{}, error)
- func (srv *Locale) GetCountries() (map[string]interface{}, error)
- func (srv *Locale) GetCountriesEU() (map[string]interface{}, error)
- func (srv *Locale) GetCountriesPhones() (map[string]interface{}, error)
- func (srv *Locale) GetCurrencies() (map[string]interface{}, error)
- type Optional
- type Storage
- func (srv *Storage) CreateFile(File string, Read []interface{}, Write []interface{}) (map[string]interface{}, error)
- func (srv *Storage) DeleteFile(FileId string) (map[string]interface{}, error)
- func (srv *Storage) GetFile(FileId string) (map[string]interface{}, error)
- func (srv *Storage) GetFileDownload(FileId string) (map[string]interface{}, error)
- func (srv *Storage) GetFilePreview(FileId string, Width int, Height int, Quality int, Background string, ...) (map[string]interface{}, error)
- func (srv *Storage) GetFileView(FileId string, As string) (map[string]interface{}, error)
- func (srv *Storage) ListFiles(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error)
- func (srv *Storage) UpdateFile(FileId string, Read []interface{}, Write []interface{}) (map[string]interface{}, error)
- type Teams
- func (srv *Teams) Create(Name string, Roles []interface{}) (map[string]interface{}, error)
- func (srv *Teams) CreateMembership(TeamId string, Email string, Roles []interface{}, Url string, Name string) (map[string]interface{}, error)
- func (srv *Teams) Delete(TeamId string) (map[string]interface{}, error)
- func (srv *Teams) DeleteMembership(TeamId string, InviteId string) (map[string]interface{}, error)
- func (srv *Teams) Get(TeamId string) (map[string]interface{}, error)
- func (srv *Teams) GetMemberships(TeamId string) (map[string]interface{}, error)
- func (srv *Teams) List(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error)
- func (srv *Teams) Update(TeamId string, Name string) (map[string]interface{}, error)
- type Users
- func (srv *Users) Create(Email string, Password string, Name string) (map[string]interface{}, error)
- func (srv *Users) DeleteSession(UserId string, SessionId string) (map[string]interface{}, error)
- func (srv *Users) DeleteSessions(UserId string) (map[string]interface{}, error)
- func (srv *Users) Get(UserId string) (map[string]interface{}, error)
- func (srv *Users) GetLogs(UserId string) (map[string]interface{}, error)
- func (srv *Users) GetPrefs(UserId string) (map[string]interface{}, error)
- func (srv *Users) GetSessions(UserId string) (map[string]interface{}, error)
- func (srv *Users) List(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error)
- func (srv *Users) UpdatePrefs(UserId string, Prefs []interface{}) (map[string]interface{}, error)
- func (srv *Users) UpdateStatus(UserId string, Status string) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Avatars ¶
type Avatars struct {
// contains filtered or unexported fields
}
Avatars service
func NewAvatars ¶
func (*Avatars) GetBrowser ¶
func (srv *Avatars) GetBrowser(Code string, Width int, Height int, Quality int) (map[string]interface{}, error)
GetBrowser you can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user /account/sessions endpoint. Use width, height and quality arguments to change the output settings.
func (*Avatars) GetCreditCard ¶
func (srv *Avatars) GetCreditCard(Code string, Width int, Height int, Quality int) (map[string]interface{}, error)
GetCreditCard need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
func (*Avatars) GetFavicon ¶
GetFavicon use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.
func (*Avatars) GetFlag ¶
func (srv *Avatars) GetFlag(Code string, Width int, Height int, Quality int) (map[string]interface{}, error)
GetFlag you can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.
func (*Avatars) GetImage ¶
GetImage use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the client struct to access Appwrite services
func (*Client) AddHeader ¶
AddHeader add a new custom header that the Client should send on each request
func (*Client) Call ¶
func (clt *Client) Call(method string, path string, headers map[string]interface{}, params map[string]interface{}) (map[string]interface{}, error)
Call an API using Client
func (*Client) SetEndpoint ¶
SetEndpoint sets the default endpoint to which the Client connects to
func (*Client) SetSelfSigned ¶
SetSelfSigned sets the condition that specify if the Client should allow connections to a server using a self-signed certificate
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database service
func NewDatabase ¶
func (*Database) CreateBooleanAttribute ¶
func (*Database) CreateCollection ¶
func (srv *Database) CreateCollection(CollectionId string, Name string, Permission string, Read []string, Write []string) (map[string]interface{}, error)
CreateCollection create a new Collection.
func (*Database) CreateDocument ¶
func (srv *Database) CreateDocument(CollectionId string, Data interface{}, Read []interface{}, Write []interface{}, ParentDocument string, ParentProperty string, ParentPropertyType string) (map[string]interface{}, error)
CreateDocument create a new Document.
func (*Database) CreateEmailAttribute ¶
func (*Database) CreateEnumAttribute ¶
func (*Database) CreateFloatAttribute ¶
func (*Database) CreateIntegerAttribute ¶
func (*Database) CreateIpAttribute ¶
func (*Database) CreateStringAttribute ¶
func (*Database) CreateUrlAttribute ¶
func (srv *Database) CreateUrlAttribute(CollectionId string, key string, required bool, xdefault Optional[string], isArray Optional[bool]) (map[string]interface{}, error)
Url Layout url://something
func (*Database) DeleteCollection ¶
DeleteCollection delete a collection by its unique ID. Only users with write permissions have access to delete this resource.
func (*Database) DeleteDocument ¶
func (srv *Database) DeleteDocument(CollectionId string, DocumentId string) (map[string]interface{}, error)
DeleteDocument delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.
func (*Database) GetCollection ¶
GetCollection get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.
func (*Database) GetDocument ¶
func (srv *Database) GetDocument(CollectionId string, DocumentId string) (map[string]interface{}, error)
GetDocument get document by its unique ID. This endpoint response returns a JSON object with the document data.
func (*Database) ListCollections ¶
func (srv *Database) ListCollections(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error)
ListCollections get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](/docs/admin).
func (*Database) ListDocuments ¶
func (srv *Database) ListDocuments(CollectionId string, Filters []interface{}, Offset int, Limit int, OrderField string, OrderType string, OrderCast string, Search string, First int, Last int) (map[string]interface{}, error)
ListDocuments get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/admin).
type Locale ¶
type Locale struct {
// contains filtered or unexported fields
}
Locale service
func (*Locale) Get ¶
Get get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
([IP Geolocation by DB-IP](https://db-ip.com))
func (*Locale) GetContinents ¶
GetContinents list of all continents. You can use the locale header to get the data in a supported language.
func (*Locale) GetCountries ¶
GetCountries list of all countries. You can use the locale header to get the data in a supported language.
func (*Locale) GetCountriesEU ¶
GetCountriesEU list of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
func (*Locale) GetCountriesPhones ¶
GetCountriesPhones list of all countries phone codes. You can use the locale header to get the data in a supported language.
func (*Locale) GetCurrencies ¶
GetCurrencies list of all currencies, including currency symol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage service
func NewStorage ¶
func (*Storage) CreateFile ¶
func (srv *Storage) CreateFile(File string, Read []interface{}, Write []interface{}) (map[string]interface{}, error)
CreateFile create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.
func (*Storage) DeleteFile ¶
DeleteFile delete a file by its unique ID. Only users with write permissions have access to delete this resource.
func (*Storage) GetFile ¶
GetFile get file by its unique ID. This endpoint response returns a JSON object with the file metadata.
func (*Storage) GetFileDownload ¶
GetFileDownload get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
func (*Storage) GetFilePreview ¶
func (srv *Storage) GetFilePreview(FileId string, Width int, Height int, Quality int, Background string, Output string) (map[string]interface{}, error)
GetFilePreview get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.
func (*Storage) GetFileView ¶
GetFileView get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
func (*Storage) ListFiles ¶
func (srv *Storage) ListFiles(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error)
ListFiles get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/admin).
type Teams ¶
type Teams struct {
// contains filtered or unexported fields
}
Teams service
func (*Teams) Create ¶
Create create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.
func (*Teams) CreateMembership ¶
func (srv *Teams) CreateMembership(TeamId string, Email string, Roles []interface{}, Url string, Name string) (map[string]interface{}, error)
CreateMembership use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.
Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.
func (*Teams) Delete ¶
Delete delete team by its unique ID. Only team owners have write access for this resource.
func (*Teams) DeleteMembership ¶
DeleteMembership this endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.
func (*Teams) Get ¶
Get get team by its unique ID. All team members have read access for this resource.
func (*Teams) GetMemberships ¶
GetMemberships get team members by the team unique ID. All team members have read access for this list of resources.
func (*Teams) List ¶
func (srv *Teams) List(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error)
List get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/admin).
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users service
func (*Users) Create ¶
func (srv *Users) Create(Email string, Password string, Name string) (map[string]interface{}, error)
Create create a new user.
func (*Users) DeleteSession ¶
DeleteSession delete user sessions by its unique ID.
func (*Users) DeleteSessions ¶
DeleteSessions delete all user sessions by its unique ID.
func (*Users) GetSessions ¶
GetSessions get user sessions list by its unique ID.
func (*Users) List ¶
func (srv *Users) List(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error)
List get a list of all the project users. You can use the query params to filter your results.
func (*Users) UpdatePrefs ¶
UpdatePrefs update user preferences by its unique ID. You can pass only the specific settings you wish to update.