Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 45 | |
| 46 | // Format implements the NodeFormatter interface. |
| 47 | func (node *ScheduledBackup) Format(ctx *FmtCtx) { |
| 48 | ctx.WriteString("CREATE SCHEDULE") |
| 49 | |
| 50 | ctx.FormatNode(&node.ScheduleLabelSpec) |
| 51 | ctx.WriteString(" FOR BACKUP") |
| 52 | if node.Targets != nil { |
| 53 | ctx.WriteString(" ") |
| 54 | ctx.FormatNode(node.Targets) |
| 55 | } |
| 56 | |
| 57 | ctx.WriteString(" INTO ") |
| 58 | ctx.FormatURIs(node.To) |
| 59 | |
| 60 | if !node.BackupOptions.IsDefault() { |
| 61 | ctx.WriteString(" WITH ") |
| 62 | ctx.FormatNode(&node.BackupOptions) |
| 63 | } |
| 64 | |
| 65 | ctx.WriteString(" RECURRING ") |
| 66 | if node.Recurrence == nil { |
| 67 | ctx.WriteString("NEVER") |
| 68 | } else { |
| 69 | ctx.FormatNode(node.Recurrence) |
| 70 | } |
| 71 | |
| 72 | if node.FullBackup != nil { |
| 73 | |
| 74 | if node.FullBackup.Recurrence != nil { |
| 75 | ctx.WriteString(" FULL BACKUP ") |
| 76 | ctx.FormatNode(node.FullBackup.Recurrence) |
| 77 | } else if node.FullBackup.AlwaysFull { |
| 78 | ctx.WriteString(" FULL BACKUP ALWAYS") |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | if node.ScheduleOptions != nil { |
| 83 | ctx.WriteString(" WITH SCHEDULE OPTIONS ") |
| 84 | ctx.FormatNode(&node.ScheduleOptions) |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | // Coverage return the coverage (all vs requested). |
| 89 | func (node ScheduledBackup) Coverage() DescriptorCoverage { |
nothing calls this directly
no test coverage detected