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

runtimecore

package
v0.7.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FingerprintJSON

func FingerprintJSON[T any](id string, kind string, cfg T) (string, error)

Types

type BuildFunc

type BuildFunc[T any] func() (T, error)

type ConfigDecoder

type ConfigDecoder[C any, T any] func(C) (T, error)

type ConfigFingerprinter

type ConfigFingerprinter[C any] func(C) (string, error)

type ConfigIDFunc

type ConfigIDFunc[C any] func(C) string

type ConfigSource

type ConfigSource[C any, L any] interface {
	Get(ctx context.Context, id string) (C, error)
	List(ctx context.Context, opts L) ([]C, error)
}

type FuncSource

type FuncSource[C any, L any] struct {
	GetFunc  func(ctx context.Context, id string) (C, error)
	ListFunc func(ctx context.Context, opts L) ([]C, error)
}

func (FuncSource[C, L]) Get

func (s FuncSource[C, L]) Get(ctx context.Context, id string) (C, error)

func (FuncSource[C, L]) List

func (s FuncSource[C, L]) List(ctx context.Context, opts L) ([]C, error)

type Materializer

type Materializer[T any] struct {
	// contains filtered or unexported fields
}

func NewMaterializer

func NewMaterializer[T any]() *Materializer[T]

func (*Materializer[T]) Invalidate

func (m *Materializer[T]) Invalidate(key string)

func (*Materializer[T]) Reset

func (m *Materializer[T]) Reset()

func (*Materializer[T]) Resolve

func (m *Materializer[T]) Resolve(key string, version string, build BuildFunc[T]) (T, error)

type Resolver

type Resolver[C any, T any, L any] struct {
	// contains filtered or unexported fields
}

func NewResolver

func NewResolver[C any, T any, L any](
	source ConfigSource[C, L],
	configID ConfigIDFunc[C],
	fingerprint ConfigFingerprinter[C],
	decode ConfigDecoder[C, T],
) *Resolver[C, T, L]

func (*Resolver[C, T, L]) Get

func (r *Resolver[C, T, L]) Get(ctx context.Context, id string) (T, error)

func (*Resolver[C, T, L]) Invalidate

func (r *Resolver[C, T, L]) Invalidate(id string)

func (*Resolver[C, T, L]) List

func (r *Resolver[C, T, L]) List(ctx context.Context, opts L) ([]T, error)

func (*Resolver[C, T, L]) ResolveConfig

func (r *Resolver[C, T, L]) ResolveConfig(cfg C) (T, error)

func (*Resolver[C, T, L]) Source

func (r *Resolver[C, T, L]) Source() ConfigSource[C, L]

Jump to

Keyboard shortcuts

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