Documentation ¶ Index ¶ type Database type MongoDB func NewMongoDB() *MongoDB func (m *MongoDB) CreateShortURL(urlSchema model.UrlSchema) error func (m *MongoDB) GetURL(alias string) (string, error) 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) Source Files ¶ View all Source files database.go mongo.go Click to show internal directories. Click to hide internal directories.