Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAcronym ¶
func AddAcronym(lower, camel string)
AddAcronym is used to add exception words that will be used to intervene the conversion from lower case to camel case. It is suggested that users of this package make all AddAcronym calls before any usage (like init()) so that the conversions are consistent across the board.
Types ¶
type Name ¶
type Name struct { // Snake is the snake case version of the string: rds_instance Snake string // Camel is the camel case version of the string where known acronyms are // are uppercase: RDSInstance Camel string // LowerCamel is the camel case version with the first word being lower case // and the known acronyms are uppercase if they are not the first word: rdsInstance LowerCamel string // CamelComputed is the camel case version without any acronym changes: RdsInstance CamelComputed string // LowerCamelComputed is the camel case version without any acronym changes // and the first word is lower case: rdsInstance LowerCamelComputed string }
Name holds different variants of a name.
func NewFromCamel ¶
NewFromCamel produces a Name, using given camel case string as source of truth.
func NewFromSnake ¶
NewFromSnake produces a Name, using given snake case string as source of truth.
func ReferenceFieldName ¶
ReferenceFieldName returns the field name for a reference field whose value field name is given.
func SelectorFieldName ¶
SelectorFieldName returns the field name for a selector field whose value field name is given.