NetworkHash computes the configuration hash for a network.
(o *types.NetworkConfig)
| 44 | |
| 45 | // NetworkHash computes the configuration hash for a network. |
| 46 | func NetworkHash(o *types.NetworkConfig) (string, error) { |
| 47 | bytes, err := json.Marshal(o) |
| 48 | if err != nil { |
| 49 | return "", err |
| 50 | } |
| 51 | return digest.SHA256.FromBytes(bytes).Encoded(), nil |
| 52 | } |
| 53 | |
| 54 | // VolumeHash computes the configuration hash for a volume. |
| 55 | func VolumeHash(o types.VolumeConfig) (string, error) { |
no outgoing calls