Documentation ¶
Index ¶
- type PostgresClient
- func (pc *PostgresClient) AddEvent(ctx context.Context, name string) error
- func (pc *PostgresClient) Close()
- func (pc *PostgresClient) DeleteEventByID(ctx context.Context, id int) error
- func (pc *PostgresClient) StartListeningToNotifications(ctx context.Context) error
- func (pc *PostgresClient) UpdateEventByID(ctx context.Context, name string, id int) error
- func (pc *PostgresClient) WithEventBus(eventBus *eventbus.EventBus)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresClient ¶
type PostgresClient struct {
// contains filtered or unexported fields
}
PostgresClient cliente para manipulações em banco de dados postgres
func NewProduction ¶
func NewProduction(tables []string, host, dbname, user, port, password string, logger *zap.SugaredLogger) (*PostgresClient, error)
NewProduction se conecta ao banco de dados tenta criar o banco e suas tabelas e retorna um cliente
func (*PostgresClient) AddEvent ¶
func (pc *PostgresClient) AddEvent(ctx context.Context, name string) error
func (*PostgresClient) Close ¶
func (pc *PostgresClient) Close()
func (*PostgresClient) DeleteEventByID ¶
func (pc *PostgresClient) DeleteEventByID(ctx context.Context, id int) error
func (*PostgresClient) StartListeningToNotifications ¶
func (pc *PostgresClient) StartListeningToNotifications(ctx context.Context) error
func (*PostgresClient) UpdateEventByID ¶
func (*PostgresClient) WithEventBus ¶
func (pc *PostgresClient) WithEventBus(eventBus *eventbus.EventBus)
Click to show internal directories.
Click to hide internal directories.