containers

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InterceptorsContainer

type InterceptorsContainer struct {
	// contains filtered or unexported fields
}

InterceptorsContainer is an interceptors holder organized by type

func NewInterceptorsContainer

func NewInterceptorsContainer() *InterceptorsContainer

NewInterceptorsContainer will create a new instance of a container

func (*InterceptorsContainer) Add

func (ic *InterceptorsContainer) Add(key string, interceptor process.Interceptor) error

Add will add an object at a given key. Returns an error if the element already exists

func (*InterceptorsContainer) AddMultiple

func (ic *InterceptorsContainer) AddMultiple(keys []string, interceptors []process.Interceptor) error

AddMultiple will add objects with given keys. Returns an error if one element already exists, lengths mismatch or an interceptor is nil

func (*InterceptorsContainer) Get

Get returns the object stored at a certain key. Returns an error if the element does not exist

func (*InterceptorsContainer) Len

func (ic *InterceptorsContainer) Len() int

Len returns the length of the added objects

func (*InterceptorsContainer) Remove

func (ic *InterceptorsContainer) Remove(key string)

Remove will remove an object at a given key

func (*InterceptorsContainer) Replace

func (ic *InterceptorsContainer) Replace(key string, interceptor process.Interceptor) error

Replace will add (or replace if it already exists) an object at a given key

Jump to

Keyboard shortcuts

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