db

package
v0.0.0-...-3f9ec74 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 23 Imported by: 2

Documentation

Index

Constants

View Source
const (
	NotFoundDoc = "mongo: no documents in result"
	InvalidPK   = "invalid pk"
)

Variables

View Source
var (
	ConnectionTimeout = 10 * time.Second
)

Functions

func CheckMongo

func CheckMongo() error

CheckMongo checks if Mongo is up and running

func Close

func Close()

func CloseConnection

func CloseConnection() error

func CreateMongo

func CreateMongo() (*mongo.Client, error)

CreateMongo cria uma nova instancia de conexão com o mongodb

func GetBoletoByID

func GetBoletoByID(id, pk string) (models.BoletoView, int64, error)

GetBoletoByID busca um boleto pelo ID que vem na URL O retorno será um objeto BoletoView, o tempo decorrido da operação (em milisegundos) e algum erro ocorrido durante a operação

func GetBoletoByIDMock

func GetBoletoByIDMock(id string) (models.BoletoView, error)

GetBoletoById retorna o boleto por id do cache em memoria

func GetDatabaseConfiguration

func GetDatabaseConfiguration() *mongoCheck.Config

func GetTokenByClientIDAndIssuerBank

func GetTokenByClientIDAndIssuerBank(clientID, issuerBank string) (models.Token, error)

GetTokenByClientIDAndIssuerBank fetches a token by clientID and issuerBank

func GetUserCredentials

func GetUserCredentials() ([]models.Credentials, error)

GetUserCredentials Busca as Credenciais dos Usuários

func SaveBoleto

func SaveBoleto(boleto models.BoletoView) error

SaveBoleto salva um boleto no mongoDB

func SaveBoletoMock

func SaveBoletoMock(boleto models.BoletoView) error

SaveBoleto salva o boleto num cache local em memoria

func SaveToken

func SaveToken(token models.Token) error

SaveToken saves an access token at mongoDB

Types

This section is empty.

Jump to

Keyboard shortcuts

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