service

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service service struct

func New

func New(c *conf.Config) (s *Service)

New new service

func (*Service) Add

func (s *Service) Add(c context.Context, mid int64, long string) (short string, err error)

Add new url to db

func (*Service) Ping

func (s *Service) Ping(c context.Context) (err error)

Ping ping service.

func (*Service) ShortByID

func (s *Service) ShortByID(c context.Context, id int64) (su *model.ShortUrl, err error)

ShortByID model.ShortUrl by short id

func (*Service) ShortCache

func (s *Service) ShortCache(c context.Context, short string) (su *model.ShortUrl, err error)

ShortCache get short by cache

func (*Service) ShortCount

func (s *Service) ShortCount(c context.Context, mid int64, long string) (count int, err error)

ShortCount model.ShortCount count

func (*Service) ShortDel

func (s *Service) ShortDel(c context.Context, id, mid int64, now time.Time) (err error)

ShortDel model.ShortDel

func (*Service) ShortLimit

func (s *Service) ShortLimit(c context.Context, pn, ps int, mid int64, long string) (res []*model.ShortUrl, err error)

ShortLimit get short_url list

func (*Service) ShortUpdate

func (s *Service) ShortUpdate(c context.Context, id, mid int64, long string) (err error)

ShortUpdate model.ShortUpdate

Jump to

Keyboard shortcuts

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