link_manager

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

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

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLinkManager

func NewLinkManager(linkStore LinkStore,
	socialGraphManager om.SocialGraphManager,
	natsUrl string,
	eventSink om.LinkManagerEvents,
	maxLinksPerUser int64) (om.LinkManager, error)

Types

type DbLinkStore

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

func NewDbLinkStore

func NewDbLinkStore(host string, port int, username string, password string) (store *DbLinkStore, err error)
func (s *DbLinkStore) AddLink(request om.AddLinkRequest) (link *om.Link, err error)
func (s *DbLinkStore) DeleteLink(username string, url string) (err error)
func (s *DbLinkStore) GetLinks(request om.GetLinksRequest) (result om.GetLinksResult, err error)

func (*DbLinkStore) SetLinkStatus

func (s *DbLinkStore) SetLinkStatus(username string, url string, status om.LinkStatus) (err error)
func (s *DbLinkStore) UpdateLink(request om.UpdateLinkRequest) (link *om.Link, err error)

type LinkManager

type LinkManager struct {
	// contains filtered or unexported fields
}
func (m *LinkManager) AddLink(request om.AddLinkRequest) (err error)
func (m *LinkManager) DeleteLink(username string, url string) (err error)
func (m *LinkManager) GetLinks(request om.GetLinksRequest) (result om.GetLinksResult, err error)

func (*LinkManager) OnLinkChecked

func (m *LinkManager) OnLinkChecked(username string, url string, status om.LinkStatus)
func (m *LinkManager) UpdateLink(request om.UpdateLinkRequest) (err error)

type LinkStore

type LinkStore interface {
	GetLinks(request om.GetLinksRequest) (om.GetLinksResult, error)
	AddLink(request om.AddLinkRequest) (*om.Link, error)
	UpdateLink(request om.UpdateLinkRequest) (*om.Link, error)
	DeleteLink(username string, url string) error
	SetLinkStatus(username, url string, status om.LinkStatus) error
}
type UserLinks map[string]*om.Link

User links are a map of url:TaggedLink

Jump to

Keyboard shortcuts

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