Help us shape the future of Go! Take the 2026 Go Developer Survey

blocktype

package
v0.57.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockType

type BlockType interface {
	// Constructor builds a new zero-value block.Block instance.
	Constructor() block.Block

	// GetBlockTypeID returns the unique identifier for this block type.
	// Format: "github.com/s4wave/spacewave/db/block/mock.Root"
	GetBlockTypeID() string

	// MatchesBlockType checks if a block.Block is of this type.
	MatchesBlockType(b block.Block) bool
}

BlockType provides construction and identification for a block.Block type.

func ExLookupBlockType

func ExLookupBlockType(
	ctx context.Context,
	b bus.Bus,
	blockTypeID string,
) (BlockType, directive.Reference, error)

ExLookupBlockType executes a lookup for a single block type on the bus.

blockTypeID is the block type identifier to lookup. Returns the BlockType or an error if not found.

func NewBlockType

func NewBlockType[T block.Block](typeID string, constructor func() T) BlockType

NewBlockType builds a BlockType using generics to reduce boilerplate.

T is the concrete block type, typeID is the unique identifier like "github.com/s4wave/spacewave/db/block/mock.Root", and constructor is a function that returns a new zero-value instance.

type LookupBlockType

type LookupBlockType interface {
	// Directive indicates LookupBlockType is a directive.
	directive.Directive

	// LookupBlockTypeID returns the block type ID to lookup.
	LookupBlockTypeID() string
}

LookupBlockType is a directive to look up a block type.

func NewLookupBlockType

func NewLookupBlockType(blockTypeID string) LookupBlockType

NewLookupBlockType constructs a new LookupBlockType directive.

type LookupBlockTypeValue

type LookupBlockTypeValue = BlockType

LookupBlockTypeValue is the result type for LookupBlockType.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL