Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# Change Log

## v0.16.1

* Update SDK as per latest server specs, these include -
* Updates to Runtime enums
* `Output` is now renamed to `ImageFormat` - Note that this is a breaking change
* Introduces Backups module for managing Database backups
* Introduces Organization module

## v0.16.0

* Added ability to create columns and indexes synchronously while creating a table

## v0.15.0

* Rename `VCSDeploymentType` enum to `VCSReferenceType`
* Change `CreateTemplateDeployment` method signature: replace `Version` parameter with `Type` (TemplateReferenceType) and `Reference` parameters
* Change `CreateTemplateDeployment` method signature: replace `Version` parameter with `Type` (TemplateReferenceType)
and `Reference` parameters
* Add `GetScreenshot` method to `Avatars` service
* Add `Theme`, `Timezone` and `Output` enums

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors.
Copyright (c) 2026 Appwrite (https://appwrite.io) and individual contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Appwrite Go SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-go.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.8.1-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-go/releases).**
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-go/releases).**

Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Go SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Go SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)

Expand Down
28 changes: 26 additions & 2 deletions account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,39 @@ func (srv *Account) DeleteIdentity(IdentityId string)(*interface{}, error) {
return &parsed, nil

}

type CreateJWTOptions struct {
Duration int
enabledSetters map[string]bool
}
func (options CreateJWTOptions) New() *CreateJWTOptions {
options.enabledSetters = map[string]bool{
"Duration": false,
}
return &options
}
type CreateJWTOption func(*CreateJWTOptions)
func (srv *Account) WithCreateJWTDuration(v int) CreateJWTOption {
return func(o *CreateJWTOptions) {
o.Duration = v
o.enabledSetters["Duration"] = true
}
}

// CreateJWT use this endpoint to create a JSON Web Token. You can use the
// resulting JWT to authenticate on behalf of the current user when working
// with the Appwrite server-side API and SDKs. The JWT secret is valid for 15
// minutes from its creation and will be invalid if the user will logout in
// that time frame.
func (srv *Account) CreateJWT()(*models.Jwt, error) {
func (srv *Account) CreateJWT(optionalSetters ...CreateJWTOption)(*models.Jwt, error) {
path := "/account/jwts"
options := CreateJWTOptions{}.New()
for _, opt := range optionalSetters {
opt(options)
}
params := map[string]interface{}{}
if options.enabledSetters["Duration"] {
params["duration"] = options.Duration
}
headers := map[string]interface{}{
"content-type": "application/json",
}
Expand Down
8 changes: 8 additions & 0 deletions appwrite/appwrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import (
"github.com/appwrite/sdk-for-go/client"
"github.com/appwrite/sdk-for-go/account"
"github.com/appwrite/sdk-for-go/avatars"
"github.com/appwrite/sdk-for-go/backups"
"github.com/appwrite/sdk-for-go/databases"
"github.com/appwrite/sdk-for-go/functions"
"github.com/appwrite/sdk-for-go/graphql"
"github.com/appwrite/sdk-for-go/health"
"github.com/appwrite/sdk-for-go/locale"
"github.com/appwrite/sdk-for-go/messaging"
"github.com/appwrite/sdk-for-go/organizations"
"github.com/appwrite/sdk-for-go/sites"
"github.com/appwrite/sdk-for-go/storage"
"github.com/appwrite/sdk-for-go/tablesdb"
Expand All @@ -26,6 +28,9 @@ func NewAccount(clt client.Client) *account.Account {
func NewAvatars(clt client.Client) *avatars.Avatars {
return avatars.New(clt)
}
func NewBackups(clt client.Client) *backups.Backups {
return backups.New(clt)
}
func NewDatabases(clt client.Client) *databases.Databases {
return databases.New(clt)
}
Expand All @@ -44,6 +49,9 @@ func NewLocale(clt client.Client) *locale.Locale {
func NewMessaging(clt client.Client) *messaging.Messaging {
return messaging.New(clt)
}
func NewOrganizations(clt client.Client) *organizations.Organizations {
return organizations.New(clt)
}
func NewSites(clt client.Client) *sites.Sites {
return sites.New(clt)
}
Expand Down
Loading