resources

package
v0.0.0-...-a2ea4c1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheRepo

type CacheRepo interface {
	AddMessage(ctx context.Context, data []byte) error
	GetLastTen(ctx context.Context) ([]response.Msg, error)
}

type ClientManager

type ClientManager interface {
	Store(con *websocket.Conn)
	Release(con *websocket.Conn)
	Broadcaster(ctx context.Context) chan<- response.Msg
	WriteMsg(con *websocket.Conn, msg response.Msg) error
}

type MessageBroker

type MessageBroker interface {
	Write(ctx context.Context, data []byte)
}

type Resources

type Resources struct {
	Cfg           config.ServerCfg
	Log           zerolog.Logger
	ClientManager ClientManager
	RedisRepo     CacheRepo
	KafkaWriter   MessageBroker
}

func New

func New(ctx context.Context, cfg config.ServerCfg) (*Resources, error)

Jump to

Keyboard shortcuts

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