data

package
v0.0.0-...-57f4814 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBClient *firestore.Client

DBClient is the firebase client

View Source
var ErrURLNotFound = fmt.Errorf("URL not found")

ErrURLNotFound is the common error message when an url is not found

Functions

func AssociateURL

func AssociateURL(url string) (*model.URLAssociation, error)

AssociateURL associates an URL to a unique id for short URL

func Connect

func Connect() *firestore.Client

Connect tries to connect to firebase bd and return a client

func DisassociateURL

func DisassociateURL(ID string) error

DisassociateURL disassociates the URL associated to the requestd id if exists

func FindAllURLs

func FindAllURLs() ([]*model.URLAssociation, error)

FindAllURLs return all the URLAssociations

func FindURL

func FindURL(ID string) (*model.URLAssociation, error)

FindURL finds an URLAssociation by id and returns error if not found

func UpdateURL

func UpdateURL(ID string, url string) error

UpdateURL updates the url associated to the requested uuid

Types

This section is empty.

Jump to

Keyboard shortcuts

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