structural

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDecoratorFactory

func GenerateDecoratorFactory[T Decorable](handler *func(T), initialDecorable T, decorables ...T) *creational.Factory[*Decorator[T]]

Types

type Adaptable

type Adaptable interface{}

type Adapter

type Adapter[T Adaptable, U Target] struct {
	Adaptee *T
	Adapt   func(*T) *U
}

func NewAdapter

func NewAdapter[T Adaptable, U Target](adaptee *T, handler func(*T) *U) *Adapter[T, U]

func (*Adapter[T, U]) Adapted

func (adapter *Adapter[T, U]) Adapted() *U

type Bridge

type Bridge[T Bridgeable] struct {
	Impl *T
}

func (*Bridge[T]) SetImpl

func (b *Bridge[T]) SetImpl(impl T)

type Bridgeable

type Bridgeable interface{}

type Composable

type Composable interface{}

type Composite

type Composite[T Composable] struct {
	Children []T
}

func NewComposite

func NewComposite[T Composable]() *Composite[T]

func (*Composite[T]) Add

func (c *Composite[T]) Add(child T)

type Decorable

type Decorable interface{}

type Decorator

type Decorator[T Decorable] struct {
	*behavioral.Iterator[T]
	// contains filtered or unexported fields
}

func NewDecorator

func NewDecorator[T Decorable](decorable T) *Decorator[T]

func (*Decorator[T]) Execute

func (d *Decorator[T]) Execute() error

func (*Decorator[T]) SetExecutionHandler

func (d *Decorator[T]) SetExecutionHandler(handler *func(T)) *Decorator[T]

func (*Decorator[T]) Wrap

func (d *Decorator[T]) Wrap(decorable T) *Decorator[T]

type Flyweight

type Flyweight[T IntrinsicState] struct {
	Instances        map[string]*T
	CreationHandlers map[string]behavioral.StrategyCreatorHandler[T]
}

func NewFlyweight

func NewFlyweight[T IntrinsicState]() *Flyweight[T]

func (*Flyweight[T]) GetInstance

func (f *Flyweight[T]) GetInstance(key string) *T

func (*Flyweight[T]) NewCreationHandler

func (f *Flyweight[T]) NewCreationHandler(key string, createFunc behavioral.StrategyCreatorHandler[T])

type IntrinsicState

type IntrinsicState interface{}

type NotInitializedExecutionHandler

type NotInitializedExecutionHandler struct{}

func (*NotInitializedExecutionHandler) Error

type Proxifiable

type Proxifiable interface{}

type Proxy

type Proxy[T Proxifiable] struct {
	Wrapped *T
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy[T Proxifiable](wrapped *T, handler func(*T)) *Proxy[T]

func (*Proxy[T]) Execute

func (p *Proxy[T]) Execute() error

type Target

type Target interface{}

Jump to

Keyboard shortcuts

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