application

package
v0.0.0-...-2847b59 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

View Source
const (
	Secret = "secret"
)

Variables

View Source
var (
	Topic           = "user-transactions"
	Partition int32 = 0
)

Functions

func ConsumeUserRegistrationEvents

func ConsumeUserRegistrationEvents(consumer sarama.PartitionConsumer, handleEventType func(msgVal []byte, e interface{}))

func NewKafkaConsumer

func NewKafkaConsumer() sarama.Consumer

func NewKafkaSyncProducer

func NewKafkaSyncProducer() sarama.SyncProducer

func SubmitEvent

func SubmitEvent(kafka sarama.SyncProducer, event interface{}) error

Types

type AuthService

type AuthService struct {
	AuthRepository domain.AuthRepository
}

func (AuthService) Create

Create a new User Registration

func (AuthService) GetRegistrationByEmail

func (s AuthService) GetRegistrationByEmail(email string) (*domain.UserRegistration, error)

Returns a User Registration by email

type UserService

type UserService struct {
	UsersRepository domain.UserRepository
	EventsConsumer  sarama.Consumer
}

func (UserService) Create

func (s UserService) Create(u *domain.User) error

Creates a User

func (UserService) OnEventTypeHandle

func (s UserService) OnEventTypeHandle(msgVal []byte, eventType interface{})

func (UserService) Update

func (s UserService) Update(u *domain.User) error

Updates a User

func (UserService) Users

func (s UserService) Users() ([]*domain.User, error)

Returns all the Users

Jump to

Keyboard shortcuts

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