# 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="https://743115216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS3G37Grl2vDniwEyDc23%2Fuploads%2FvbkBF5AG9rO2ycZac5ff%2Faccess_key.jpg?alt=media&#x26;token=14b50d15-07c5-4b73-ae2b-a5aea5e0bc7d" 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
