synoapi

package
v0.0.0-...-7f99424 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2014 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	NOT_ENCRYPTED      = 0
	ENCRYPTED_LOCKED   = 1
	ENCRYPTED_UNLOCKED = 2
)

Variables

View Source
var SYNO_ERR_CODES = map[int]string{
	402:  "This shared folder doesn't exist.",
	3308: "The password is invalid.",
}

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(base_url string) *Client

func (*Client) ListShares

func (c *Client) ListShares() ([]Share, error)

func (*Client) LockShare

func (c *Client) LockShare(name string) error

func (*Client) Login

func (c *Client) Login(user string, password string) error

func (*Client) UnlockShare

func (c *Client) UnlockShare(name string, password string) error

type ClientError

type ClientError interface {
	error
	UnderlyingError() error
}

func NewClientError

func NewClientError(context string, err error) ClientError

type EncryptionStatus

type EncryptionStatus int8

func (EncryptionStatus) String

func (e EncryptionStatus) String() string

type ListSharesResponse

type ListSharesResponse struct {
	Data struct {
		Shares []Share
	}
	// contains filtered or unexported fields
}

func (*ListSharesResponse) ErrorCode

func (s *ListSharesResponse) ErrorCode() int

func (*ListSharesResponse) Successful

func (s *ListSharesResponse) Successful() bool

type LoginResponse

type LoginResponse struct {
	Data struct {
		Sid string
	}
	// contains filtered or unexported fields
}

func (*LoginResponse) ErrorCode

func (s *LoginResponse) ErrorCode() int

func (*LoginResponse) Successful

func (s *LoginResponse) Successful() bool

type Share

type Share struct {
	Description string `json:"desc"`
	Encryption  EncryptionStatus
	Name        string
	// contains filtered or unexported fields
}

type SynoBaseResponse

type SynoBaseResponse interface {
	ErrorCode() int
	Successful() bool
}

type SynoError

type SynoError interface {
	ClientError
	Code() int
	Description() string
}

func NewSynoError

func NewSynoError(code int) SynoError

type SynoResponse

type SynoResponse struct {
	Data map[string]interface{}
	// contains filtered or unexported fields
}

func (*SynoResponse) ErrorCode

func (s *SynoResponse) ErrorCode() int

func (*SynoResponse) Successful

func (s *SynoResponse) Successful() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL