link_manager

package
v0.0.0-...-0ae7237 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLinkManager

func NewLinkManager(linkStore LinkStore,
	socialGraphManager om.SocialGraphManager,
	eventSink om.LinkManagerEvents) (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 (s *DbLinkStore) UpdateLink(request om.UpdateLinkRequest) (link *om.Link, err error)

type InMemoryLinkStore

type InMemoryLinkStore map[string]UserLinks

Link store is a map of username:UserLinks

func (m *InMemoryLinkStore) AddLink(request om.AddLinkRequest) (link *om.Link, err error)
func (m *InMemoryLinkStore) DeleteLink(username string, url string) error
func (m *InMemoryLinkStore) GetLinks(request om.GetLinksRequest) (result om.GetLinksResult, err error)
func (m *InMemoryLinkStore) 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 (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
}
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