(data map[string]interface{}, state *transaction.ResourceState)
| 820 | } |
| 821 | |
| 822 | func decodeState(data map[string]interface{}, state *transaction.ResourceState) error { |
| 823 | var ok bool |
| 824 | state.ConfigVersion, ok = data[configVersionColumnName].(int64) |
| 825 | if !ok { |
| 826 | return fmt.Errorf("Wrong state column %s returned from query", configVersionColumnName) |
| 827 | } |
| 828 | state.StateVersion, ok = data[stateVersionColumnName].(int64) |
| 829 | if !ok { |
| 830 | return fmt.Errorf("Wrong state column %s returned from query", stateVersionColumnName) |
| 831 | } |
| 832 | stateError, ok := data[stateErrorColumnName].([]byte) |
| 833 | if !ok { |
| 834 | return fmt.Errorf("Wrong state column %s returned from query", stateErrorColumnName) |
| 835 | } |
| 836 | state.Error = string(stateError) |
| 837 | stateState, ok := data[stateColumnName].([]byte) |
| 838 | if !ok { |
| 839 | return fmt.Errorf("Wrong state column %s returned from query", stateColumnName) |
| 840 | } |
| 841 | state.State = string(stateState) |
| 842 | stateMonitoring, ok := data[stateMonitoringColumnName].([]byte) |
| 843 | if !ok { |
| 844 | return fmt.Errorf("Wrong state column %s returned from query", stateMonitoringColumnName) |
| 845 | } |
| 846 | state.Monitoring = string(stateMonitoring) |
| 847 | return nil |
| 848 | } |
| 849 | |
| 850 | //normFields runs normFields on all the fields. |
| 851 | func normFields(fields []string, s *schema.Schema) []string { |
no test coverage detected