database

package
v0.0.0-...-0622fba Latest Latest
Warning

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

Go to latest
Published: Nov 14, 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 struct {
	// contains filtered or unexported fields
}

func New

func New(path string) *Database

func (*Database) Add

func (db *Database) Add(URL, ID string) error

func (*Database) Get

func (db *Database) Get(ID string) (u URL, err error)

func (*Database) Stats

func (db *Database) Stats(ID string) (stats []Stats, err error)

func (*Database) UpdateStats

func (db *Database) UpdateStats(link string, loc api.Response, IP string) error

type Stats

type Stats struct {
	IP        string
	Country   string
	City      string
	VisitTime string
}

type URL

type URL struct {
	ID         int
	Original   string
	Shortened  string
	CreatedAt  time.Time
	Views      int
	LatestView string
}

Jump to

Keyboard shortcuts

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