godsm

package module
v0.0.0-...-156dbb0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Download

type Download interface {
	Tasks(offset, limit int) (map[string]interface{}, error)
}

type Dsm

type Dsm interface {
	APIInfo(api string) (*DsmAPIInfo, error)
	Login(user string, passwd string, sid bool) error
	LoadAllAPIInfo() error
	Logout() error
	System() System
	Download() Download
}

GoDsm define interface

func NewDSM

func NewDSM(dsmURL string) (Dsm, error)

NewDSM Build a new DSM - dsmURL : URL of DSM.

type DsmAPIInfo

type DsmAPIInfo struct {
	Key           string
	Path          string
	RequestFormat string
	MinVersion    int
	MaxVersion    int
}

DsmAPIInfo memorize Api info

type DsmError

type DsmError struct {
	// Error Code
	Code int
	// Error Message
	Msg string
}

DsmError error

func (*DsmError) Error

func (d *DsmError) Error() string

Error Interface implementation

type GoDsmImpl

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

GoDsmImpl implements GoDsm interface

func (*GoDsmImpl) APIInfo

func (c *GoDsmImpl) APIInfo(api string) (*DsmAPIInfo, error)

APIInfo return an API Info, call LoadAllAPIInfo if needed

func (*GoDsmImpl) DlInfo

func (c *GoDsmImpl) DlInfo() (map[string]interface{}, error)

DlInfo get downloadStation info.

func (*GoDsmImpl) DlInfoConfig

func (c *GoDsmImpl) DlInfoConfig() (map[string]interface{}, error)

DlInfoConfig get downloadStation info.

func (*GoDsmImpl) DlSchedConfig

func (c *GoDsmImpl) DlSchedConfig() (map[string]interface{}, error)

DlSchedConfig get downloadStation Schedule Config.

func (*GoDsmImpl) DlSchedSetConfig

func (c *GoDsmImpl) DlSchedSetConfig(cfg map[string]bool) error

DlSchedSetConfig set server config can only be used by admin users. cfg should contains one or more of : - enabled if download schedule is enabled - emule_enabled if eMule download schedule is enabled.

func (*GoDsmImpl) DlSetServer

func (c *GoDsmImpl) DlSetServer(cfg map[string]string) error

DlSetServer set downloadStation info. can only be used by admin users. available configs, one or more of : - bt_max_download (in KB/s, 0 means unlimited) - bt_max_upload (in KB/s, 0 means unlimited) - emule_max_download (in KB/s, 0 means unlimited) - emule_max_upload (in KB/s, 0 means unlimited) - nzb_max_download (in KB/s, 0 means unlimited) - http_max_download (in KB/s, 0 means unlimited) - ftp_max_download (in KB/s, 0 means unlimited) - emule_enabled - unzip_service_enabled - default_destination - emule_default_destination

func (*GoDsmImpl) Download

func (c *GoDsmImpl) Download() Download

Session return current Download item

func (*GoDsmImpl) DsmInfo

func (c *GoDsmImpl) DsmInfo() (map[string]interface{}, error)

DsmInfo return Generic System info

func (*GoDsmImpl) LoadAllAPIInfo

func (c *GoDsmImpl) LoadAllAPIInfo() error

LoadAllAPIInfo load all DsmAPIInfo in cache.

func (*GoDsmImpl) Login

func (c *GoDsmImpl) Login(account string, passwd string, sid bool) error

Login Try to connect given user. if sid is true, use sid for session tracking, otherwise use cookie

func (*GoDsmImpl) Logout

func (c *GoDsmImpl) Logout() error

Logout logout current session.

func (*GoDsmImpl) Network

func (c *GoDsmImpl) Network() (map[string]interface{}, error)

Network return Network Configuration

func (*GoDsmImpl) Session

func (c *GoDsmImpl) Session() string

Session return current session name, empty string if not set.

func (*GoDsmImpl) SetSession

func (c *GoDsmImpl) SetSession(s string)

SetSession set session name Set Session <em>before</em> Login.

func (*GoDsmImpl) StorageInfo

func (c *GoDsmImpl) StorageInfo() (map[string]interface{}, error)

StorageInfo get system utilization infos

func (*GoDsmImpl) System

func (c *GoDsmImpl) System() System

Session return current System item

func (*GoDsmImpl) SystemUtilization

func (c *GoDsmImpl) SystemUtilization() (map[string]interface{}, error)

SystemUtilization get system utilization infos

func (*GoDsmImpl) Tasks

func (c *GoDsmImpl) Tasks(offset, limit int) (map[string]interface{}, error)

Tasks get Tasks List

func (*GoDsmImpl) User

func (c *GoDsmImpl) User(name string) (map[string]interface{}, error)

User return User id

func (*GoDsmImpl) Users

func (c *GoDsmImpl) Users(offset, limit int) (map[string]interface{}, error)

Users return Users list set offset and limit to 0 to get all users

type System

type System interface {
	DsmInfo() (map[string]interface{}, error)
	Network() (map[string]interface{}, error)
	StorageInfo() (map[string]interface{}, error)
	SystemUtilization() (map[string]interface{}, error)
	Users(offset, limit int) (map[string]interface{}, error)
	User(name string) (map[string]interface{}, error)
}

System get System informations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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