Unique Constraint on string

Is there any examples how this could be accomplished in DQL with the GO-Client, I have some approaches but a best practice implementation would be nice