link

package
v0.0.0-...-e026bce Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	LinkID int `json:"linkId"`

	AccessedAt string `json:"AccessedAt"`
	// contains filtered or unexported fields
}

Activity represents access to one of the links

type Controller

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

Controller for Link methods

func NewController

func NewController(db *db.Database, logger *logger.Logger) *Controller

NewController creates new link controller

func (lc *Controller) GetLink(c echo.Context) error

GetLink get link with specific name

func (*Controller) GetLinkActivityStats

func (lc *Controller) GetLinkActivityStats(c echo.Context) error

GetLinkActivityStats get link with specific name

func (lc *Controller) InsertLink(c echo.Context) error

InsertLink adds new link

func (lc *Controller) RedirectToLink(c echo.Context) error

RedirectToLink get link with specifig name and redirects to it's url

type Link struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	URL  string `json:"url" binding:"required"`

	CreatedAt string `json:"createdAt"`
	// contains filtered or unexported fields
}

Link represent one shortened link

type Stats

type Stats struct {
	Views int `json:"views"`
}

Stats represent statistics on link

Jump to

Keyboard shortcuts

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