Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrGetApiInfo error = errors.New("there was a problem while getting the api spec from your synology")
)
Functions ¶
This section is empty.
Types ¶
type ApiEndpoint ¶
type AuthenticateApi ¶
type AuthenticateApi interface { Login(credential models.ApiCredential) (apiCredentialState, error) Logout(credentialState *apiCredentialState) error }
func NewAuthenticate ¶
func NewAuthenticate(baseApi *BaseApi) AuthenticateApi
type BaseApi ¶
type BaseApi struct { HttpClient *http.Client ApiEndpoint *ApiEndpoint ApiInfo models.ApiInfo // contains filtered or unexported fields }
func (*BaseApi) GetNewHttpRequest ¶
func (*BaseApi) SendRequest ¶
func (*BaseApi) SetApiCredentialState ¶
func (b *BaseApi) SetApiCredentialState(credentialState *apiCredentialState)
type CertificateApi ¶
type CertificateApi interface { ListCertificate() error UploadCertificate(uploadDetail CertificateUploadDetail) error }
func NewCertificate ¶
func NewCertificate(baseApi *BaseApi) CertificateApi
type CertificateUploadDetail ¶
type CertificateUploadDetail struct { Certificate string `form:"cert" contentType:"application/x-x509-ca-cert" filename:"cert.cert"` PrivateKey string `form:"key" contentType:"application/octet-stream" filename:"key.key"` IntermediateCertificate string `form:"inter_cert" omitempty:"true"` SetDefault string `form:"as_default" default:"False"` Id string `form:"id"` Desc string `form:"desc"` }
type SynologyApi ¶
type SynologyApi interface { Authenticate() AuthenticateApi Info() InfoApi Certificate() CertificateApi SetApiCredentialState(credentialState *apiCredentialState) }
func NewSynologyApi ¶
func NewSynologyApi(apiEndpoint *ApiEndpoint) (SynologyApi, error)
A Facade pattern, Every one should create this instance before usage.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.