Documentation
¶
Overview ¶
Package repo implements application outer layer logic. Each logic group in own file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KafkaRepo ¶
type KafkaRepo interface {
SendMessage(ctx context.Context, topic string, key []byte, value interface{}) error
AddConsumer(topic, groupID string, handler func(ctx context.Context, key, value []byte) error) error
StartConsumer(ctx context.Context, topic string) error
StartAllConsumers(ctx context.Context)
Close() error
// Control methods
EnableProducer()
DisableProducer()
IsProducerEnabled() bool
EnableConsumer()
DisableConsumer()
IsConsumerEnabled() bool
GetStatus() map[string]interface{}
}
KafkaRepo -.
type NatsRepo ¶
type NatsRepo interface {
Publish(subject string, data []byte) error
Subscribe(subject string, handler func(msg []byte)) (unsubscribe func() error, err error)
}
NatsRepo -.
type RedisRepo ¶
type RedisRepo interface {
SetValue(context.Context, entity.RedisValue) error
GetValue(context.Context, string) (entity.RedisValue, error)
}
RedisRepo -.
type TranslationRepo ¶
type TranslationRepo interface {
Store(context.Context, models.TranslationModel) error
GetHistory(context.Context) ([]entity.Translation, error)
}
TranslationRepo -.
type TranslationWebAPI ¶
type TranslationWebAPI interface {
Translate(entity.Translation) (entity.Translation, error)
}
TranslationWebAPI -.
type UserRepo ¶
type UserRepo interface {
Create(context.Context, models.UserModel) (entity.User, error)
GetByID(context.Context, int64) (entity.User, error)
GetByEmail(context.Context, string) (entity.User, error)
Update(context.Context, models.UserModel) error
Delete(context.Context, int64) error
List(context.Context) ([]entity.User, error)
// Database access methods
GetBuilder() squirrel.StatementBuilderType
GetPool() *pgxpool.Pool
}
UserRepo -.
Click to show internal directories.
Click to hide internal directories.