nametoguid.go 499 B

1234567891011121314151617181920
  1. package hcsshim
  2. import "github.com/Sirupsen/logrus"
  3. // NameToGuid converts the given string into a GUID using the algorithm in the
  4. // Host Compute Service, ensuring GUIDs generated with the same string are common
  5. // across all clients.
  6. func NameToGuid(name string) (id GUID, err error) {
  7. title := "hcsshim::NameToGuid "
  8. logrus.Debugf(title+"Name %s", name)
  9. err = nameToGuid(name, &id)
  10. if err != nil {
  11. err = makeErrorf(err, title, "name=%s", name)
  12. logrus.Error(err)
  13. return
  14. }
  15. return
  16. }