internal

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAdapterUndefined = errors.New("undefined adapter")
)

Functions

This section is empty.

Types

type Adapter

type Adapter[T any] interface {
	Init(map[string]string) (T, error)
}

type Register

type Register[T any] struct {
	sync.Map
}

func (*Register[T]) Add

func (r *Register[T]) Add(name string, f func(map[string]string) (T, error))

Add 注册适配器

func (*Register[T]) Get

func (r *Register[T]) Get(name string) (Adapter[T], error)

Get 获取适配器实例

Jump to

Keyboard shortcuts

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