Versions in this module Expand all Collapse all v0 v0.0.1 Sep 28, 2022 Changes in this version + var ErrExceededMaxAttempts = errors.New(...) + var ErrLoginError = errors.New("Login error") + var ErrLoginFailed = errors.New("Login failed, wrong password") + var ErrUserConflict = errors.New("Login conflict. Someone else is logged in.") + func MarshalForm(obj interface{}) ([]byte, error) + func Operation(op string) map[string]string + func Pad(data []byte, size int) []byte + func ReadResponse(data []byte) (*T, error) + func Unpad(data []byte) []byte + type AESCipher struct + func GenAESCipher() (*AESCipher, error) + func NewAESCipher(key, iv string) (*AESCipher, error) + func (c *AESCipher) Decrypt(data []byte) ([]byte, error) + func (c *AESCipher) DecryptBase64(data string) ([]byte, error) + func (c *AESCipher) DecryptHex(data string) ([]byte, error) + func (c *AESCipher) Encrypt(data []byte) ([]byte, error) + func (c *AESCipher) EncryptBase64(data []byte) (string, error) + func (c *AESCipher) EncryptHex(data []byte) (string, error) + func (c *AESCipher) IV() string + func (c *AESCipher) Key() string + type AccessDevice struct + Hostname string + IPv4 string + MAC string + WireType string + type Client struct + func NewClient(host string) (*Client, error) + func (client *Client) GetClientList() (*ClientList, error) + func (client *Client) Login(password string) error + func (client *Client) Logout() error + func (client *Client) MakeFormURL(endpoint, form string) *url.URL + func (client *Client) MakeURL(endpoint string, query url.Values) *url.URL + type ClientList struct + Wired []*AccessDevice + Wireless []*AccessDevice + type EncryptedFormData struct + Data string + Sign string + type EncryptedResponse struct + Data string + type FormMarshaler interface + MarshalForm func() ([]byte, error) + type RSACipher struct + func ParseRSAKey(key []string) (*RSACipher, error) + func (c *RSACipher) Encrypt(data []byte) ([]byte, error) + func (c *RSACipher) EncryptBase64(data []byte) (string, error) + func (c *RSACipher) EncryptHex(data []byte) (string, error) + type RSASigner struct + func NewRSASigner(password string, key []string, seq int, aesKey *AESCipher) (*RSASigner, error) + func (signer *RSASigner) DecryptResponse(body []byte) ([]byte, error) + func (signer *RSASigner) Sign(data interface{}, isLogin bool) (*EncryptedFormData, error) + type ResponseWrapper struct + Data *T + ErrorCode *string + Success bool