models

package
v0.0.0-...-8a4e3a4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*mongo.Database
}

func NewDB

func NewDB(dbName string, uri string) (*DB, error)

func (*DB) CreateShort

func (db *DB) CreateShort(url string) (*Short, error)

func (*DB) GetShortById

func (db *DB) GetShortById(id string) (*Short, error)

func (*DB) RemoveShort

func (db *DB) RemoveShort(id string) error

type Datastore

type Datastore interface {
	GetShortById(id string) (*Short, error)
	RemoveShort(id string) error
	CreateShort(url string) (*Short, error)
}

type Short

type Short struct {
	ID  string
	URL string
}

Jump to

Keyboard shortcuts

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