function
NewBlockRegistry
NewBlockRegistry snapshots and binds a finite registry of centrally declared blocks. Forward references are supported; cycles and duplicate declarations are configuration errors. Inline declarations within these definitions are interned like any other.
Arguments
| Argument | Type | Description |
|---|---|---|
blocks | []Block | The blocks value. |
Returns
The declared result.
(*BlockRegistry, error)Full signature
func NewBlockRegistry(blocks ...Block) (*BlockRegistry, error)Related types
BlockBlock is one discriminated layout allowed by a blocks field.
BlockRegistryBlockRegistry owns the block definitions of one configuration, one per slug. Blocks registered centrally and blocks declared inline in a Blocks field or an embedded tree case are the same kind of definition: binding interns every inline declaration by slug, so each definition is bound once and shared by all of its placements. Bound containers select their definitions by slug and do not grant a placement mutation rights over a shared definition.