db

package
v0.0.0-...-7e29b92 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() (*firestore.Client, error)

Initiates the firestore db and returns the firestore client

func RetrieveURL

func RetrieveURL(client *firestore.Client, memorableUrl string) (string, error)

Gets the original URL using the memorable URL

func WipeDB

func WipeDB(client *firestore.Client) error

Wipes the URL collection. Adjusted from Firestore docs

Types

type DatabaseURL

type DatabaseURL struct {
	Expiration   time.Time `firestore:"expiration"`
	MemorableURL string    `firestore:"memorable"`
	OriginalURL  string    `firestore:"original"`
}

func MapURL

func MapURL(client *firestore.Client, originalUrl string) (DatabaseURL, error)

Maps the original URL to a generated URL,

Jump to

Keyboard shortcuts

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