synologydsm

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code int `json:"code,omitempty"`
}

type APIInfo

type APIInfo struct {
	Path       string `json:"path"`
	MinVersion int    `json:"minVersion"`
	MaxVersion int    `json:"maxVersion"`
}

type CertificateInfo

type CertificateInfo struct {
	ID          string `json:"id"`
	Description string `json:"desc"`
	IsDefault   bool   `json:"is_default"`
	IsBroken    bool   `json:"is_broken"`
	Issuer      struct {
		CommonName   string `json:"common_name"`
		Country      string `json:"country"`
		Organization string `json:"organization"`
	} `json:"issuer"`
	Subject struct {
		CommonName   string   `json:"common_name"`
		Country      string   `json:"country"`
		Organization string   `json:"organization"`
		SAN          []string `json:"sub_alt_name"`
	} `json:"subject"`
	ValidFrom          string                `json:"valid_from"`
	ValidTill          string                `json:"valid_till"`
	SignatureAlgorithm string                `json:"signature_algorithm"`
	Renewable          bool                  `json:"renewable"`
	Services           []*CertificateService `json:"services"`
}

type CertificateService

type CertificateService struct {
	DisplayName     string `json:"display_name"`
	DisplayNameI18N string `json:"display_name_i18n,omitempty"`
	IsPkg           bool   `json:"isPkg"`
	Owner           string `json:"owner"`
	Service         string `json:"service"`
	Subscriber      string `json:"subscriber"`
}

type Client

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

func NewClient

func NewClient(serverUrl string) (*Client, error)

func (*Client) ImportCertificate

func (c *Client) ImportCertificate(req *ImportCertificateRequest) (*ImportCertificateResponse, error)

func (*Client) ListCertificates

func (c *Client) ListCertificates() (*ListCertificatesResponse, error)

func (*Client) Login

func (c *Client) Login(req *LoginRequest) (*LoginResponse, error)

func (*Client) Logout

func (c *Client) Logout() (*LogoutResponse, error)

func (*Client) QueryAPIInfo

func (c *Client) QueryAPIInfo(req *QueryAPIInfoRequest) (*QueryAPIInfoResponse, error)

func (*Client) SetServiceCertificate

func (c *Client) SetServiceCertificate(req *SetServiceCertificateRequest) (*SetServiceCertificateResponse, error)

func (*Client) SetTLSConfig

func (c *Client) SetTLSConfig(config *tls.Config) *Client

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration) *Client

type ImportCertificateRequest

type ImportCertificateRequest struct {
	ID          string `json:"id"         url:"id"`
	Description string `json:"desc"       url:"desc"`
	Key         string `json:"key"        url:"key"`
	Cert        string `json:"cert"       url:"cert"`
	InterCert   string `json:"inter_cert" url:"inter_cert"`
	AsDefault   bool   `json:"as_default" url:"as_default"`
}

type ImportCertificateResponse

type ImportCertificateResponse struct {
	Data *struct {
		RestartHttpd bool `json:"restart_httpd"`
	} `json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*ImportCertificateResponse) GetErrorCode

func (r *ImportCertificateResponse) GetErrorCode() int

func (*ImportCertificateResponse) GetSuccess

func (r *ImportCertificateResponse) GetSuccess() bool

type ListCertificatesResponse

type ListCertificatesResponse struct {
	Data *struct {
		Certificates []*CertificateInfo `json:"certificates"`
	} `json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*ListCertificatesResponse) GetErrorCode

func (r *ListCertificatesResponse) GetErrorCode() int

func (*ListCertificatesResponse) GetSuccess

func (r *ListCertificatesResponse) GetSuccess() bool

type LoginRequest

type LoginRequest struct {
	Account  string `json:"account"            url:"account"`
	Password string `json:"passwd"             url:"passwd"`
	OtpCode  string `json:"otp_code,omitempty" url:"otp_code,omitempty"`
}

type LoginResponse

type LoginResponse struct {
	Data *struct {
		Sid       string `json:"sid"`
		SynoToken string `json:"synotoken"`
		DeviceId  string `json:"device_id,omitempty"`
		Did       string `json:"did,omitempty"`
	} `json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginResponse) GetErrorCode

func (r *LoginResponse) GetErrorCode() int

func (*LoginResponse) GetSuccess

func (r *LoginResponse) GetSuccess() bool

type LogoutResponse

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

func (*LogoutResponse) GetErrorCode

func (r *LogoutResponse) GetErrorCode() int

func (*LogoutResponse) GetSuccess

func (r *LogoutResponse) GetSuccess() bool

type QueryAPIInfoRequest

type QueryAPIInfoRequest struct {
	Query string `json:"query" url:"query"`
}

type QueryAPIInfoResponse

type QueryAPIInfoResponse struct {
	Data map[string]APIInfo `json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryAPIInfoResponse) GetErrorCode

func (r *QueryAPIInfoResponse) GetErrorCode() int

func (*QueryAPIInfoResponse) GetSuccess

func (r *QueryAPIInfoResponse) GetSuccess() bool

type ServiceCertificateSetting

type ServiceCertificateSetting struct {
	Service   *CertificateService `json:"service"`
	OldCertID string              `json:"old_id"`
	CertID    string              `json:"id"`
}

type SetServiceCertificateRequest

type SetServiceCertificateRequest struct {
	Settings []*ServiceCertificateSetting `json:"settings"`
}

type SetServiceCertificateResponse

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

func (*SetServiceCertificateResponse) GetErrorCode

func (r *SetServiceCertificateResponse) GetErrorCode() int

func (*SetServiceCertificateResponse) GetSuccess

func (r *SetServiceCertificateResponse) GetSuccess() bool

Jump to

Keyboard shortcuts

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