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

blocktype

package
v0.57.29 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 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: "spacewave-chat/channel"
	GetBlockTypeID() string
}

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 New

func New[T any, PT block.Ptr[T]](typeID string) BlockType

New builds the BlockType of *T with the unique identifier typeID, such as "spacewave-chat/channel".

func NewFunc

func NewFunc(typeID string, ctor func() block.Block) BlockType

NewFunc builds the BlockType with the unique identifier typeID that ctor constructs.

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