Create CNAME

This commit is contained in:
2025-11-28 12:31:45 +00:00
parent 22552aec99
commit 9c1c1eb9c6
17 changed files with 939 additions and 156 deletions
+21
View File
@@ -346,6 +346,27 @@ func (c *Client) ListBackups() ([]protocol.BackupInfo, error) {
return data.Backups, nil
}
// GetBackupContent returns the content of a backup file.
func (c *Client) GetBackupContent(backupName string) (string, error) {
req, _ := protocol.NewRequest(protocol.RequestBackupContent, protocol.BackupContentPayload{
BackupName: backupName,
})
resp, err := c.send(req)
if err != nil {
return "", err
}
if !resp.IsOK() {
return "", fmt.Errorf("backup content failed: %s", resp.Message)
}
var data protocol.BackupContentData
if err := resp.ParseData(&data); err != nil {
return "", err
}
return data.Content, nil
}
// RenameGroup renames a group.
func (c *Client) RenameGroup(oldName, newName string) error {
req, _ := protocol.NewRequest(protocol.RequestRenameGroup, protocol.RenameGroupPayload{