Titan Network(EN)
🌟【中文】🌟Official Website
TWS
TWS
  • 👋Welcome to Titan Web Services (TWS)
  • Titan Storage
    • Welcome
    • Quickstart
    • Developer Guides
      • Command Line Interface (CLI)
      • SDK Documentation
        • JS SDK
        • GO SDK
    • How-To Guides
      • Build Examples
      • API Integration
  • Titan container
    • Quick Start Guide
  • Titan PCDN
    • Quick Start Guide
  • Support & Feedback
Powered by GitBook
On this page
  1. Titan Storage
  2. Developer Guides
  3. SDK Documentation

GO SDK

PreviousJS SDKNextHow-To Guides

Last updated 2 months ago

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

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

Retrieve the list of area IDs from the scheduler

Create directories, including root and subdirectories

Retrieve a list of all folders and files

Rename a specific folder

Rename a specific file

Delete a specific folder

Delete a specific file

Retrieve user-related information

Get detailed information about files/folders

Share file/folder data

Upload files/folders

Download files/folders

TitanStorage.ListRegions
TitanStorage.CreateFolder
TitanStorage.ListDirectoryContents
TitanStorage.RenameFolder
TitanStorage.RenameAsset
TitanStorage.DeleteFolder
TitanStorage.DeleteAsset
TitanStorage.GetUserProfile
TitanStorage.GetltemDetails
TitanStorage.CreateSharedLink
TitanStorage.UploadAsset
TitanStorage.DownloadAsset