Documentation ¶
Index ¶
- func Call(rsp Response, synology *Synology, session string, url string, ...) (err error)
- func CallApi(rsp Response, synology *Synology, session string, method MethodCall, ...) (err error)
- type BaseRequest
- type BaseResponse
- type Code
- type LoginRequest
- type LoginResponse
- type MethodCall
- type Response
- type Synology
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseRequest ¶
BaseRequest 请求基类
func NewBaseRequest ¶
func NewBaseRequest(api string, method string, version int) BaseRequest
NewBaseRequest 创建基础请求
type BaseResponse ¶
BaseResponse 返回基类
func NewSuccessResponse ¶ added in v1.1.4
func NewSuccessResponse() *BaseResponse
NewSuccessResponse 创建新的成功的响应
func (*BaseResponse) Code ¶
func (rsp *BaseResponse) Code() Code
func (*BaseResponse) IsSuccess ¶
func (rsp *BaseResponse) IsSuccess() bool
type LoginRequest ¶
type LoginRequest struct { BaseRequest Account string Passwd string Session string Format string }
LoginRequest 登录请求
func NewDSLoginRequest ¶
func NewDSLoginRequest(username string, password string) LoginRequest
NewDSLoginRequest 创建新的DownloadStation登录请求
func NewLoginRequest ¶
func NewLoginRequest(username string, password string, session string) LoginRequest
NewLoginRequest 创建登录请求
type LoginResponse ¶
type LoginResponse struct { BaseResponse Data struct { Sid string } }
LoginResponse 登录响应
type MethodCall ¶ added in v1.2.0
type MethodCall string
Call 统一请求,增加重试机制等
const ( MethodGet MethodCall = "GET" MethodPost MethodCall = "POST" )
Click to show internal directories.
Click to hide internal directories.