store

package
v1.13.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item[T middleware.Middleware] struct {
	Metadata
	Middleware T
}

Item is a single middleware in the store. It holds the middleware implementation and the metadata associated with it.

type Metadata

type Metadata struct {
	Name    string
	Type    string
	Version string
}

Metadata is the metadata associated with a middleware.

type Store

type Store[T middleware.Middleware] struct {
	// contains filtered or unexported fields
}

Store provides a dynamic dictionary to loaded Component Middleware implementations.

func New

func New[T middleware.Middleware](kind string) *Store[T]

func (*Store[T]) Add

func (s *Store[T]) Add(item Item[T])

Add adds a middleware to the store.

func (*Store[T]) Get

func (s *Store[T]) Get(m Metadata) (T, bool)

Get returns a middleware from the store.

func (*Store[T]) Remove

func (s *Store[T]) Remove(name string)

Remove removes a middleware from the store.

Jump to

Keyboard shortcuts

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