links

package
v0.0.0-...-c5fb9eb Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CookieExpiryTime = time.Hour * 24 * 180
View Source
const TickerInterval = time.Second * 10

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(backend Store, factory *factory.Factory, pipe *pipe.Pipe, ingestor *Ingestor) *Handler

func (*Handler) Create

func (h *Handler) Create(c *fiber.Ctx) error

func (*Handler) Delete

func (h *Handler) Delete(c *fiber.Ctx) error

func (*Handler) Get

func (h *Handler) Get(c *fiber.Ctx) error

func (*Handler) Redirect

func (h *Handler) Redirect(c *fiber.Ctx) error

func (*Handler) Update

func (h *Handler) Update(c *fiber.Ctx) error

type Ingestor

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

A simple link ingestor.

func NewIngestor

func NewIngestor(db *pgxpool.Pool, batchSize int) *Ingestor

func (*Ingestor) Push

func (i *Ingestor) Push(link *Link)

func (*Ingestor) Start

func (i *Ingestor) Start() *Ingestor
type Link struct {
	ID     string `json:"id"`
	Target string `json:"target"`
	Tag    string `json:"tag"`
}

func New

func New(id, target, tag string) *Link

type LinkCreateRequest

type LinkCreateRequest struct {
	Custom string `json:"custom"`
	Tag    string `json:"tag"`
	Target string `json:"target"`
}

type Store

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

func NewStore

func NewStore(pool *pgxpool.Pool) Store

func (*Store) Delete

func (p *Store) Delete(id string) error

func (*Store) Get

func (p *Store) Get(id string) (*Link, error)

func (*Store) Ids

func (p *Store) Ids() ([]string, error)

func (*Store) Update

func (p *Store) Update(link *Link) error

Jump to

Keyboard shortcuts

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