Skip to content

nikitaksv/yandex-disk-sdk-go

Repository files navigation

Yandex.Disk Yandex.Disk

Yandex Disk SDK on GoLand

It is a fast, safe and efficient tool that works immediately after installation.

Build Status Coverage Status CodeFactor

Installation

Use module (recommended)

import "github.com/nikitaksv/yandex-disk-sdk-go"

Use vendor

go get github.com/nikitaksv/yandex-disk-sdk-go

Documentation

Useful links on official docs:

Create new instance Yandex.Disk

yaDisk,err := yadisk.NewYaDisk(ctx.Background(),http.DefaultClient, &yadisk.Token{AccessToken: "YOUR_TOKEN"})
if err != nil {
    panic(err.Error())
}
disk,err := yaDisk.GetDisk([]string{})
if err != nil {
    // If response get error
    e, ok := err.(*yadisk.Error)
    if !ok {
        panic(err.Error())
    }
    // e.ErrorID
    // e.Message
}