db

package
v0.0.0-...-2475dad Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	// CreateShortURL insert the urlSchema given in the database if the alias is not already present.
	CreateShortURL(urlSchema model.UrlSchema) error
	GetURL(alias string) (string, error)
}

type MongoDB

type MongoDB struct {
	// contains filtered or unexported fields
}

func NewMongoDB

func NewMongoDB() *MongoDB

func (*MongoDB) CreateShortURL

func (m *MongoDB) CreateShortURL(urlSchema model.UrlSchema) error

func (*MongoDB) GetURL

func (m *MongoDB) GetURL(alias string) (string, error)

Jump to

Keyboard shortcuts

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