itemsprocessor

package
v0.0.0-...-8fb0787 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDispatcherStates

func ClearDispatcherStates()

ClearDispatcherStates remove all items

func GetState

func GetState(key string, index int) (*model.SampleItem, bool)

func SaveState

func SaveState(m *model.SomeProcessingTask) error

func StatesLength

func StatesLength() int

func StatesLengthByID

func StatesLengthByID(key string) int

func StopDispatcher

func StopDispatcher()

StopDispatcher shut down the background cleanup

Types

type Config

type Config struct {
	AMQP     rabbitmq.Config
	Database database.Database
	HTTP     api.Config
}

Config for application

func (*Config) AMQPConfig

func (c *Config) AMQPConfig() *rabbitmq.Config

AMQPConfig implements setup.AMQPConfigProvider

func (*Config) DatabaseConfig

func (c *Config) DatabaseConfig() *database.Database

DatabaseConfig implements setup.DatabaseConfigProvider

func (*Config) HTTPConfig

func (c *Config) HTTPConfig() *api.Config

HTTPConfig implements setup.HTTPConfigProvider

type Handler

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

Handler ...

func NewItemsHandler

func NewItemsHandler(p Processor) *Handler

NewItemsHandler ...

func (*Handler) LivenessHandler

func (h *Handler) LivenessHandler() func(w http.ResponseWriter, r *http.Request)

LivenessHandler to check api response

type Items

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

Items implements Processor

func NewItemsDomain

func NewItemsDomain(repo *datasource.SampleProcessorDB, pbl rabbitmq.AMQPPublisher) *Items

NewItemsDomain constructor

func (*Items) Readiness

func (i *Items) Readiness() error

Readiness of domain

func (*Items) UpdateItem

func (i *Items) UpdateItem(ctx context.Context, proc *model.SomeProcessingTask) error

UpdateItem ...

type Processor

type Processor interface {
	Readiness() error
	UpdateItem(ctx context.Context, sip *model.SomeProcessingTask) error
}

Processor represents sample usage of sample domain

type Server

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

Server representation

func NewServer

func NewServer(cfg *Config, env *server.Env) (*Server, error)

NewServer constructor

func (*Server) ConfigureExchange

func (s *Server) ConfigureExchange()

func (*Server) Routes

func (s *Server) Routes(ctx context.Context) *chi.Mux

Routes initialization

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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