object_model

package
v0.0.0-...-e5bd9e3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: MIT Imports: 1 Imported by: 0

README

Object Model

Delinkcious is built using modern software engineering best practices. The core logic and data management is implemented using Go libraries that exposes interfaces and POGOs (plain old Go objects). The shared object_model package defines all these interfaces and data types.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddLinkRequest

type AddLinkRequest struct {
	Url         string
	Title       string
	Description string
	Username    string
	Tags        map[string]bool
}

type Event

type Event struct {
	EventType EventTypeEnum
	Username  string
	Url       string
	Timestamp time.Time
}

type EventTypeEnum

type EventTypeEnum int
const (
	LinkAdded EventTypeEnum = iota
	LinkUpdated
	LinkDeleted
)

type GetLinksRequest

type GetLinksRequest struct {
	UrlRegex         string
	TitleRegex       string
	DescriptionRegex string
	Username         string
	Tag              string
	StartToken       string
}

type GetLinksResult

type GetLinksResult struct {
	Links         []Link
	NextPageToken string
}

type GetNewsRequest

type GetNewsRequest struct {
	Username   string
	StartToken string
}

type GetNewsResult

type GetNewsResult struct {
	Events    []*Event
	NextToken string
}
type Link struct {
	Url         string
	Title       string
	Description string
	Tags        map[string]bool
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type LinkManager

type LinkManager interface {
	GetLinks(request GetLinksRequest) (GetLinksResult, error)
	AddLink(request AddLinkRequest) error
	UpdateLink(request UpdateLinkRequest) error
	DeleteLink(username string, url string) error
}

type LinkManagerEvents

type LinkManagerEvents interface {
	OnLinkAdded(username string, link *Link)
	OnLinkUpdated(username string, link *Link)
	OnLinkDeleted(username string, url string)
}

type NewsManager

type NewsManager interface {
	GetNews(request GetNewsRequest) (GetNewsResult, error)
}

type SocialGraphManager

type SocialGraphManager interface {
	Follow(followed string, follower string) error
	Unfollow(followed string, follower string) error

	GetFollowing(username string) (map[string]bool, error)
	GetFollowers(username string) (map[string]bool, error)
}

type UpdateLinkRequest

type UpdateLinkRequest struct {
	Url         string
	Title       string
	Description string
	Username    string
	AddTags     map[string]bool
	RemoveTags  map[string]bool
}

type User

type User struct {
	Email string
	Name  string
}

type UserManager

type UserManager interface {
	Register(user User) error
	Login(username string, authToken string) (session string, err error)
	Logout(username string, session string) error
}

Jump to

Keyboard shortcuts

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