(src interface{})
| 47 | type Actions []policy.Action |
| 48 | |
| 49 | func (a *Actions) Scan(src interface{}) error { |
| 50 | switch v := src.(type) { |
| 51 | case string: |
| 52 | return json.Unmarshal([]byte(v), &a) |
| 53 | case []byte: |
| 54 | return json.Unmarshal(v, &a) |
| 55 | } |
| 56 | return xerrors.Errorf("unexpected type %T", src) |
| 57 | } |
| 58 | |
| 59 | func (a *Actions) Value() (driver.Value, error) { |
| 60 | return json.Marshal(a) |