IStringIdentifiable

Interface for data objects that can be uniquely identifed by a string id. The interface extends IIdentifiable to hardcode id type to string.

Extends: IIdentifiable

Description

The IIdentifiable interface extends IIdentifiable to hardcode id type to string.

Important points

  • It is common to use a string GUID as the id, generated by IdGenerator.

Fields

id

The object’s unique string id.

id: string

Examples

type MyStruct struct {
	...
	id string
}
func (c *MyStruct) GetId() string {
	return c.id
}
func (c *MyStruct) SetId(id string) {
	c.id = id
}

See also