Documentation
¶
Index ¶
- func ToString(arg interface{}) string
- type Attribute
- type AttributeList
- type AttributeOptions
- 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 Bucket
- type BucketListResponse
- type Client
- func (clt *Client) AddHeader(key string, value string)
- func (srv *Client) CacheHealth() (*HealthStatus, error)
- func (clt *Client) Call(method string, path string, headers map[string]interface{}, ...) (map[string]interface{}, error)
- func (clt *Client) CallAPI(method string, path string, headers map[string]interface{}, ...) ([]byte, error)
- func (srv *Client) DBHealth() (*HealthStatus, error)
- func (srv *Client) FunctionsQueue() (*HealthQueue, error)
- func (srv *Client) Health() (*HealthStatus, error)
- func (srv *Client) LocalStorageHealth() (*HealthStatus, error)
- func (srv *Client) LogsQueue() (*HealthQueue, 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)
- func (srv *Client) TimeHealth() (*HealthTime, error)
- func (srv *Client) WebHooksQueue() (*HealthQueue, error)
- type Collection
- type CollectionList
- type Database
- func (srv *Database) CreateCollection(Name string, Read []interface{}, Write []interface{}, Rules []interface{}) (map[string]interface{}, error)
- func (srv *Database) CreateDocument(CollectionId string, Data map[string]interface{}, Read []interface{}, ...) (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(databaseId, collectionId string) (*Collection, error)
- func (srv *Database) GetDatabase(databaseId string) (*DatabaseObject, error)
- func (srv *Database) GetDocument(CollectionId string, DocumentId string) (map[string]interface{}, error)
- func (srv *Database) ListCollections(databaseId, Search string, Queries []string) (*CollectionList, error)
- func (srv *Database) ListDatabases(Search string, Queries []string) (*DatabaseList, error)
- func (srv *Database) ListDocuments(databaseId, collectionId string, Filters []interface{}, Offset int, Limit int, ...) (*DocumentList, 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 map[string]interface{}, ...) (map[string]interface{}, error)
- type DatabaseList
- type DatabaseObject
- type DeploymentListResponse
- type DeploymentObject
- type Document
- type DocumentList
- type ExecutionListResponse
- type ExecutionObject
- type File
- type FileListResponse
- type Function
- func (srv *Function) GetDeployment(functionId, deploymentId string) (*DeploymentObject, error)
- func (srv *Function) GetExecution(functionId, executionId string) (*ExecutionObject, error)
- func (srv *Function) GetFunction(functionId string) (*FunctionObject, error)
- func (srv *Function) GetVariable(functionId, variableId string) (*Variable, error)
- func (srv *Function) ListDeployments(functionId, Search string, Queries []string) (*DeploymentListResponse, error)
- func (srv *Function) ListExecutions(functionId, Search string, Queries []string) (*ExecutionListResponse, error)
- func (srv *Function) ListFunctions(Search string, Queries []string) (*FunctionListResponse, error)
- func (srv *Function) ListVariables(functionId, Search string, Queries []string) (*VariableListResponse, error)
- type FunctionListResponse
- type FunctionObject
- type HealthQueue
- type HealthStatus
- type HealthTime
- type Index
- 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 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) GetBucket(bucketId string) (*Bucket, error)
- func (srv *Storage) GetFile(bucketId, fileId string) (*File, 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) ListBuckets(Search string, Limit int, Offset int, OrderType string) (*BucketListResponse, error)
- func (srv *Storage) ListFiles(bucketId, Search string, Limit int, Offset int, OrderType string) (*FileListResponse, 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 UserListResponse
- type UserObject
- 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) ([]UserObject, error)
- func (srv *Users) UpdatePrefs(UserId string, Prefs map[string]interface{}) (map[string]interface{}, error)
- func (srv *Users) UpdateStatus(UserId string, Status string) (map[string]interface{}, error)
- type Variable
- type VariableListResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attribute ¶
type Attribute struct {
AttributeOptions
}
type AttributeList ¶
type AttributeOptions ¶
type Avatars ¶
type Avatars struct {
Client Client
}
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 Bucket ¶
type Bucket struct { Id string `json:"$id"` Name string `json:"name,omitempty"` CreatedAt string `json:"$createdAt"` UpdatedAt string `json:"$updatedAt"` Permissions []string `json:"permissions"` FileSecurity bool `json:"fileSecurity"` Enabled bool `json:"enabled"` MaximumFileSize int `json:"maximumFileSize"` AllowedFileExtensions []string `json:"allowedFileExtensions"` CompressionType string `json:"compression"` Encryption bool `json:"encryption"` Antivirus bool `json:"antivirus"` }
type BucketListResponse ¶
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) CacheHealth ¶
func (srv *Client) CacheHealth() (*HealthStatus, error)
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) DBHealth ¶
func (srv *Client) DBHealth() (*HealthStatus, error)
func (*Client) FunctionsQueue ¶
func (srv *Client) FunctionsQueue() (*HealthQueue, error)
func (*Client) Health ¶
func (srv *Client) Health() (*HealthStatus, error)
func (*Client) LocalStorageHealth ¶
func (srv *Client) LocalStorageHealth() (*HealthStatus, error)
func (*Client) LogsQueue ¶
func (srv *Client) LogsQueue() (*HealthQueue, error)
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
func (*Client) TimeHealth ¶
func (srv *Client) TimeHealth() (*HealthTime, error)
func (*Client) WebHooksQueue ¶
func (srv *Client) WebHooksQueue() (*HealthQueue, error)
type Collection ¶
type Collection struct { Id string `json:"$id"` Name string `json:"name"` CreatedAt string `json:"$createdAt"` UpdatedAt string `json:"$updatedAt"` DatabaseId string `json:"databaseId"` Permissions []string `json:"permissions"` Enabled bool `json:"enabled"` DocumentSecurity bool `json:"documentSecurity"` Attributes []Attribute `json:"attributes"` Indexes []Index `json:"indexes"` }
type CollectionList ¶
type CollectionList struct { Total int `json:"total"` Collections []Collection `json:"collections"` }
type Database ¶
type Database struct {
Client Client
}
Database service
func NewDatabase ¶
func (*Database) CreateCollection ¶
func (srv *Database) CreateCollection(Name string, Read []interface{}, Write []interface{}, Rules []interface{}) (map[string]interface{}, error)
CreateCollection create a new Collection.
func (*Database) CreateDocument ¶
func (srv *Database) CreateDocument(CollectionId string, Data map[string]interface{}, Read []interface{}, Write []interface{}, ParentDocument string, ParentProperty string, ParentPropertyType string) (map[string]interface{}, error)
CreateDocument create a new Document.
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 ¶
func (srv *Database) GetCollection(databaseId, collectionId string) (*Collection, error)
GetCollection get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.
func (*Database) GetDatabase ¶
func (srv *Database) GetDatabase(databaseId string) (*DatabaseObject, error)
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(databaseId, Search string, Queries []string) (*CollectionList, 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) ListDatabases ¶
func (srv *Database) ListDatabases(Search string, Queries []string) (*DatabaseList, error)
func (*Database) ListDocuments ¶
func (srv *Database) ListDocuments(databaseId, collectionId string, Filters []interface{}, Offset int, Limit int, OrderField string, OrderType string, OrderCast string, Search string, First int, Last int) (*DocumentList, 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 DatabaseList ¶
type DatabaseList struct { Total int64 `json:"total"` Databases []DatabaseObject `json:"databases"` }
type DatabaseObject ¶
type DeploymentListResponse ¶
type DeploymentListResponse struct { Total int `json:"total"` Deployments []DeploymentObject `json:"deployments"` }
type DeploymentObject ¶
type DeploymentObject struct { Id string `json:"$id"` CreatedAt string `json:"$createdAt"` UpdatedAt string `json:"$updatedAt"` ResourceId string `json:"resourceId"` ResourceType string `json:"resourceType"` EntryPoint string `json:"entryPoint"` Size int `json:"size"` BuildId string `json:"buildId"` Activate bool `json:"activate"` Status string `json:"status"` BuildStdout string `json:"buildStdout"` BuildStderr string `json:"buildStderr"` BuildTime string `json:"buildTime"` }
type DocumentList ¶
type ExecutionListResponse ¶
type ExecutionListResponse struct { Total int `json:"total"` Executions []ExecutionObject `json:"executions"` }
type ExecutionObject ¶
type ExecutionObject struct { Id string `json:"$id"` CreatedAt string `json:"$createdAt"` UpdatedAt string `json:"$updatedAt"` Permissions []string `json:"permissions"` FunctionId string `json:"functionId"` Trigger string `json:"trigger"` Status string `json:"status"` StatusCode int `json:"statusCode"` Response string `json:"response"` Stdout string `json:"stdout"` Stderr string `json:"stderr"` Duration string `json:"duration"` }
type File ¶
type File struct { Id string `json:"$id"` BucketId string `json:"bucketId"` CreatedAt string `json:"$createdAt"` UpdatedAt string `json:"$updatedAt"` Permissions []string `json:"permissions"` Name string `json:"name"` Signature string `json:"signature"` MimeType string `json:"mimeType"` SizeOriginal int `json:"sizeOriginal"` ChunksTotal int `json:"chunksTotal"` ChunksUploaded int `json:"chunksUploaded"` }
type FileListResponse ¶
type Function ¶
type Function struct {
Client Client
}
Functions service
func NewFunctions ¶
func (*Function) GetDeployment ¶
func (srv *Function) GetDeployment(functionId, deploymentId string) (*DeploymentObject, error)
func (*Function) GetExecution ¶
func (srv *Function) GetExecution(functionId, executionId string) (*ExecutionObject, error)
func (*Function) GetFunction ¶
func (srv *Function) GetFunction(functionId string) (*FunctionObject, error)
func (*Function) GetVariable ¶
func (*Function) ListDeployments ¶
func (srv *Function) ListDeployments(functionId, Search string, Queries []string) (*DeploymentListResponse, error)
func (*Function) ListExecutions ¶
func (srv *Function) ListExecutions(functionId, Search string, Queries []string) (*ExecutionListResponse, error)
func (*Function) ListFunctions ¶
func (srv *Function) ListFunctions(Search string, Queries []string) (*FunctionListResponse, error)
func (*Function) ListVariables ¶
func (srv *Function) ListVariables(functionId, Search string, Queries []string) (*VariableListResponse, error)
type FunctionListResponse ¶
type FunctionListResponse struct { Total int `json:"total"` Functions []FunctionObject `json:"functions"` }
type FunctionObject ¶
type FunctionObject struct { Id string `json:"$id"` Name string `json:"name,omitempty"` CreatedAt string `json:"$createdAt"` UpdatedAt string `json:"$updatedAt"` Execute []string `json:"execute"` Enabled bool `json:"enabled"` Variable []Variable `json:"variable"` Runtime string `json:"runtime"` Deployment string `json:"deployment"` Events []string `json:"events"` Schedule string `json:"schedule"` ScheduleNext string `json:"scheduleNext"` SchedulePrevious string `json:"schedulePrevious"` Timeout int `json:"timeout"` }
type HealthQueue ¶
type HealthQueue struct {
Size int `json:"size"`
}
type HealthStatus ¶
type HealthTime ¶
type Locale ¶
type Locale struct {
Client Client
}
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 {
Client Client
}
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) GetBucket ¶
GetBucket get bucket by its unique ID. This endpoint response returns a JSON object with the bucket metadata.
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) ListBuckets ¶
func (srv *Storage) ListBuckets(Search string, Limit int, Offset int, OrderType string) (*BucketListResponse, error)
ListBuckets get all the bucket in the project. This endpoint response returns a JSON object with the list of bucket objects.
func (*Storage) ListFiles ¶
func (srv *Storage) ListFiles(bucketId, Search string, Limit int, Offset int, OrderType string) (*FileListResponse, 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 {
Client Client
}
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 UserListResponse ¶
type UserListResponse struct { Sum int `json:"sum"` Offset int `json:"offset"` Limit int `json:"limit"` Users []UserObject `json:"users"` }
type UserObject ¶
type UserObject struct { Id string `json:"$id"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` Status bool `json:"status,omitempty"` Phone string `json:"phone,omitempty"` CreatedAt string `json:"$createdAt"` UpdatedAt string `json:"$updatedAt"` EmailVerification bool `json:"emailVerification"` PhoneVerification bool `json:"phoneVerification"` Registration string `json:"registration"` Prefs map[string]interface{} `json:"prefs"` PasswordUpdatedAt string `json:"passwordUpdated"` Password string `json:"password"` HashOptions map[string]int `json:"hashOptions"` Hash string `json:"hash"` }
type Users ¶
type Users struct {
Client Client
}
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) ([]UserObject, error)
List get a list of all the project users. You can use the query params to filter your results.