hyphence

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package hyphence is dodder's facade over the external hyphence format library (github.com/amarbel-llc/hyphence/go/hyphence), pre-filling madder's TypeStruct / markl.Id into the library's four leading generic type parameters (T, PT, D, PD). dodder's typed blobs are always keyed by a madder TypeStruct and a madder markl.Id digest, so this exposes the same one-parameter API (`TypedBlob[BLOB]`, `CoderToTypedBlob[BLOB]`, …) that madder's now-deleted go/pkgs/hyphence facade provided.

madder extracted hyphence into a standalone repo and dropped its pre-filled facade in madder go/v0.4.0 (madder #253). Recreating the facade here keeps dodder's ~26 consumer call sites unchanged — they only swap the import path from github.com/amarbel-llc/madder/go/pkgs/hyphence to this package.

Generic type aliases require Go 1.24+ (dodder is on 1.26).

Index

Constants

View Source
const Boundary = ext.Boundary

Variables

This section is empty.

Functions

func DecodeFromFileInto

func DecodeFromFileInto[BLOB any, BLOB_PTR interfaces.Ptr[BLOB]](
	typedBlob *TypedBlob[BLOB],
	coders CoderToTypedBlob[BLOB],
	path string,
) error

func EncodeToFile

func EncodeToFile[BLOB any, BLOB_PTR interfaces.Ptr[BLOB]](
	coders CoderToTypedBlob[BLOB],
	typedBlob *TypedBlob[BLOB],
	path string,
) error

Generic function wrappers — Go cannot alias generic functions (golang/go#52654), so these re-fix the four leading type params and forward to the external library. BLOB_PTR is inferred from its interfaces.Ptr[BLOB] constraint's core type, as it was through madder's deleted facade.

Types

type Coder

type Coder[BLOB any] = ext.Coder[BLOB]

Single-BLOB-parameter generics — the library does not parameterize these by the type/digest types, so they pass through unchanged.

type CoderToTypedBlob

type CoderToTypedBlob[BLOB any] = ext.CoderToTypedBlob[mad_ids.TypeStruct, *mad_ids.TypeStruct, markl.Id, *markl.Id, BLOB]

Five-parameter generics, pre-filled with T=mad_ids.TypeStruct, PT=*mad_ids.TypeStruct, D=markl.Id, PD=*markl.Id.

type CoderTommy

type CoderTommy[BLOB any, BLOB_PTR interfaces.Ptr[BLOB]] = ext.CoderTommy[BLOB, BLOB_PTR]

BLOB + pointer coders, passed through unchanged.

type CoderTypeMapWithoutType

type CoderTypeMapWithoutType[BLOB any] = ext.CoderTypeMapWithoutType[mad_ids.TypeStruct, *mad_ids.TypeStruct, markl.Id, *markl.Id, BLOB]

Five-parameter generics, pre-filled with T=mad_ids.TypeStruct, PT=*mad_ids.TypeStruct, D=markl.Id, PD=*markl.Id.

type Decoder

type Decoder[BLOB any] = ext.Decoder[BLOB]

Single-BLOB-parameter generics — the library does not parameterize these by the type/digest types, so they pass through unchanged.

type DecoderTypeMapWithoutType

type DecoderTypeMapWithoutType[BLOB any] = ext.DecoderTypeMapWithoutType[mad_ids.TypeStruct, *mad_ids.TypeStruct, markl.Id, *markl.Id, BLOB]

Five-parameter generics, pre-filled with T=mad_ids.TypeStruct, PT=*mad_ids.TypeStruct, D=markl.Id, PD=*markl.Id.

type Encoder

type Encoder[BLOB any] = ext.Encoder[BLOB]

Single-BLOB-parameter generics — the library does not parameterize these by the type/digest types, so they pass through unchanged.

type EncoderTypeMapWithoutType

type EncoderTypeMapWithoutType[BLOB any] = ext.EncoderTypeMapWithoutType[mad_ids.TypeStruct, *mad_ids.TypeStruct, markl.Id, *markl.Id, BLOB]

Five-parameter generics, pre-filled with T=mad_ids.TypeStruct, PT=*mad_ids.TypeStruct, D=markl.Id, PD=*markl.Id.

type MetadataWriterTo

type MetadataWriterTo = ext.MetadataWriterTo

Non-generic format types.

type Reader

type Reader = ext.Reader

Non-generic format types.

type TommyBlobDecoder

type TommyBlobDecoder[BLOB any, BLOB_PTR interfaces.Ptr[BLOB]] = ext.TommyBlobDecoder[BLOB, BLOB_PTR]

BLOB + pointer coders, passed through unchanged.

type TommyBlobEncoder

type TommyBlobEncoder[BLOB any, BLOB_PTR interfaces.Ptr[BLOB]] = ext.TommyBlobEncoder[BLOB, BLOB_PTR]

BLOB + pointer coders, passed through unchanged.

type TypedBlob

type TypedBlob[BLOB any] = ext.TypedBlob[mad_ids.TypeStruct, *mad_ids.TypeStruct, markl.Id, *markl.Id, BLOB]

Five-parameter generics, pre-filled with T=mad_ids.TypeStruct, PT=*mad_ids.TypeStruct, D=markl.Id, PD=*markl.Id.

func DecodeFromFile

func DecodeFromFile[BLOB any, BLOB_PTR interfaces.Ptr[BLOB]](
	coders CoderToTypedBlob[BLOB],
	path string,
) (TypedBlob[BLOB], error)

func DecodeFromFileOrEmptyBuffer

func DecodeFromFileOrEmptyBuffer[BLOB any, BLOB_PTR interfaces.Ptr[BLOB]](
	coders CoderToTypedBlob[BLOB],
	path string,
	permitNotExist bool,
) (TypedBlob[BLOB], error)

type TypedBlobEmpty

type TypedBlobEmpty = ext.TypedBlob[mad_ids.TypeStruct, *mad_ids.TypeStruct, markl.Id, *markl.Id, struct{}]

TypedBlobEmpty is a header-only typed blob (no blob payload, BLOB=struct{}).

type TypedMetadataCoder

type TypedMetadataCoder[BLOB any] = ext.TypedMetadataCoder[mad_ids.TypeStruct, *mad_ids.TypeStruct, markl.Id, *markl.Id, BLOB]

Five-parameter generics, pre-filled with T=mad_ids.TypeStruct, PT=*mad_ids.TypeStruct, D=markl.Id, PD=*markl.Id.

type Writer

type Writer = ext.Writer

Non-generic format types.

Source Files

  • main.go

Jump to

Keyboard shortcuts

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