MCPcopy
hub / github.com/docker/compose / NetworkHash

Function NetworkHash

pkg/compose/hash.go:46–52  ·  view source on GitHub ↗

NetworkHash computes the configuration hash for a network.

(o *types.NetworkConfig)

Source from the content-addressed store, hash-verified

44
45// NetworkHash computes the configuration hash for a network.
46func 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.
55func VolumeHash(o types.VolumeConfig) (string, error) {

Callers 3

reconcileNetworksMethod · 0.85

Calls

no outgoing calls

Tested by 1