Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterIdentType ¶
func RegisterIdentType[K comparable, T model.Node](key K, typeName string, lookup func(ctx context.Context, id Ident) (T, error))
RegisterIdentType registers a new ident type with the given key, type name and lookup function.
typeName must be globally unique and should be as short as possible. The lookup function must be able to retrieve the node associated with the given ident. The function will panic if lookup is nil, or if the key or the typeName is already registered.
This function is typically called during the initialization phase of the packages that defines unique identifiers by using the init() function.
Types ¶
type Ident ¶
func NewIdent ¶
func NewIdent[K comparable](t K, id ...string) Ident
NewIdent returns a new ident with the given type and id parts. The type must already be registered by using the RegisterIdentType function.
func (Ident) MarshalGQLContext ¶
Click to show internal directories.
Click to hide internal directories.