github.com/cloudbase/juju-core@v0.0.0-20140504232958-a7271ac7912f/names/user.go (about)

     1  // Copyright 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package names
     5  
     6  import (
     7  	"strings"
     8  )
     9  
    10  // IsUser returns whether id is a valid user id.
    11  // TODO(rog) stricter constraints
    12  func IsUser(name string) bool {
    13  	return !strings.Contains(name, "/") && name != ""
    14  }
    15  
    16  // UserTag returns the tag for the user with the given name.
    17  func UserTag(userName string) string {
    18  	return makeTag(UserTagKind, userName)
    19  }