schema

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0, MIT Imports: 15 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSchemaError

func NewSchemaError(message string) failure.Failure

Types

type DIDOption

type DIDOption func(*didConfig)

func WithMethod

func WithMethod(method string) DIDOption

type LinkOption

type LinkOption func(*linkCfg)

func WithCodec

func WithCodec(codec uint64) LinkOption

func WithMultihashConfig

func WithMultihashConfig(opts ...MultihashOption) LinkOption

func WithVersion

func WithVersion(version uint64) LinkOption

type MultihashOption

type MultihashOption func(*multihashConfig)

func WithAlg

func WithAlg(code uint64) MultihashOption

func WithDigest

func WithDigest(digest []byte) MultihashOption

type Reader

type Reader[I, O any] interface {
	Read(input I) (O, failure.Failure)
}

func DID

func DID(opts ...DIDOption) Reader[string, did.DID]

func DIDString

func DIDString(opts ...DIDOption) Reader[string, string]

DIDString read a string that is in DID format.

func Link(opts ...LinkOption) Reader[any, ipld.Link]

func Literal

func Literal(expected string) Reader[string, string]

func Mapped

func Mapped[I, O, O2 any](reader Reader[I, O], converter func(O) (O2, failure.Failure)) Reader[I, O2]

func Or

func Or[I, O any](readers ...Reader[I, O]) Reader[I, O]

func Struct

func Struct[T any](typ schema.Type, policy policy.Policy, opts ...bindnode.Option) Reader[any, T]

func URI

func URI(opts ...URIOption) Reader[any, url.URL]

type URIOption

type URIOption func(*uriConfig)

func WithProtocol

func WithProtocol(protocol string) URIOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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