models

package
v0.0.0-...-f18d551 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caller

type Caller interface {
	lifecycles.Worker
	Handlers
	Call(name string, entityID ksuid.KSUID, endpoint string, data []byte) error
}

type CallerImplementation

type CallerImplementation struct {
	lifecycles.Worker
	Handlers
	// contains filtered or unexported fields
}

func NewCaller

func NewCaller(name string, entityID ksuid.KSUID) *CallerImplementation

func (*CallerImplementation) Call

func (c *CallerImplementation) Call(name string, entityID ksuid.KSUID, endpoint string, data []byte) error

type Handler

type Handler func(ksuid.KSUID, interface{}) (interface{}, error)

type Handlers

type Handlers interface {
	GetHandler(string) (Handler, error)
	AddHandler(string, Handler) error
	RemoveHandler(string) error
}

type HandlersImplementation

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

func NewHandlers

func NewHandlers() *HandlersImplementation

func (*HandlersImplementation) AddHandler

func (h *HandlersImplementation) AddHandler(endpoint string, handler Handler) error

func (*HandlersImplementation) GetHandler

func (h *HandlersImplementation) GetHandler(endpoint string) (Handler, error)

func (*HandlersImplementation) RemoveHandler

func (h *HandlersImplementation) RemoveHandler(endpoint string) error

type Reader

type Reader interface {
	lifecycles.Worker
	Handlers
	GetState(name string, entityID ksuid.KSUID) (*states.State, error)
}

type ReaderImplementation

type ReaderImplementation struct {
	lifecycles.Worker
	Handlers
	// contains filtered or unexported fields
}

func NewReader

func NewReader(name string) *ReaderImplementation

func (*ReaderImplementation) GetState

func (r *ReaderImplementation) GetState(name string, entityID ksuid.KSUID) (*states.State, error)

type Writer

type Writer interface {
	lifecycles.Worker
	Handlers
	SetState(data json.RawMessage) (err error)
}

type WriterImplementation

type WriterImplementation struct {
	lifecycles.Worker
	Handlers
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(
	name string,
	entityID ksuid.KSUID,
	getStateCallback func() (interface{}, error),
) *WriterImplementation

func NewWriterWithOverrides

func NewWriterWithOverrides(
	name string,
	entityID ksuid.KSUID,
	getStateCallback func() (interface{}, error),
	subject string,
	queue string,
	ignoreResponseNeeded bool,
	ignoreEventTypeName bool,
	handleEvents bool,
) *WriterImplementation

func (*WriterImplementation) SetState

func (w *WriterImplementation) SetState(data json.RawMessage) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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