> For the complete documentation index, see [llms.txt](https://help.titanapp.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.titanapp.info/tws/titan-storage/developer-guides/sdk-documentation/go-sdk.md).

# GO SDK

### Titan Storage Go SDK

The Titan Storage Go SDK provides functionalities for file uploading, downloading, deleting, renaming, sharing, and creating folders.

The Go SDK consists of TitanStorage.

#### Install Go SDK And initialize the go SDK

```
go get -u github.com/utopiosphe/titan-storage-sdk
```

Retrieve the apikey and use it to initialize the go SDK

<figure><img src="/files/rSfeyoQP8SzPV5AZVQF5" alt=""><figcaption></figcaption></figure>

```
package main

import (
    storage "github.com/utopiosphe/titan-storage-sdk"
)

const (
    titanStorageURL = "https://api-test1.container1.titannet.io"
)

var TitanStorage storage.Storage

func init() {
    var err error

    TitanStorage,err = storage.Initialize(&storage.Config{
        TitanURL: titanStorageURL,
        APIKey: os.Getenv("apikey"),
    })
    if err != nil {
        panic(fmt.Errorf("new client of titan storage error:%w",err))
    }
}
```

#### Go SDK Method With Client

| Method                                                                                                                      | Description                                           |
| --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| [TitanStorage.ListRegions](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#L32)           | Retrieve the list of area IDs from the scheduler      |
| [TitanStorage.CreateFolder](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#L47)          | Create directories, including root and subdirectories |
| [TitanStorage.ListDirectoryContents](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#L56) | Retrieve a list of all folders and files              |
| [TitanStorage.RenameFolder](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#L67)          | Rename a specific folder                              |
| [TitanStorage.RenameAsset](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#L76)           | Rename a specific file                                |
| [TitanStorage.DeleteFolder](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#L85)          | Delete a specific folder                              |
| [TitanStorage.DeleteAsset](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#L94)           | Delete a specific file                                |
| [TitanStorage.GetUserProfile](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#174)        | Retrieve user-related information                     |
| [TitanStorage.GetltemDetails](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#L103)       | Get detailed information about files/folders          |
| [TitanStorage.CreateSharedLink](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#L114)     | Share file/folder data                                |
| [TitanStorage.UploadAsset](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#L126)          | Upload files/folders                                  |
| [TitanStorage.DownloadAsset](https://github.com/utopiosphe/titan-storage-sdk/blob/main/example/storage_test.go#L149)        | Download files/folders                                |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.titanapp.info/tws/titan-storage/developer-guides/sdk-documentation/go-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
