object_model

package
v0.0.0-...-f5046fd Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 1 Imported by: 4

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

View Source
const (
	LinkStatusPending = "pending"
	LinkStatusValid   = "valid"
	LinkStatusInvalid = "invalid"
)

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 CheckLinkRequest

type CheckLinkRequest struct {
	Username string
	Url      string
}

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    []*LinkManagerEvent
	NextToken string
}
type Link struct {
	Url         string
	Title       string
	Description string
	Status      LinkStatus
	Tags        map[string]bool
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type LinkCheckerEvents

type LinkCheckerEvents interface {
	OnLinkChecked(username string, url string, status LinkStatus)
}

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 LinkManagerEvent

type LinkManagerEvent struct {
	EventType LinkManagerEventTypeEnum
	Username  string
	Url       string
	Timestamp time.Time
}

type LinkManagerEventTypeEnum

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

type LinkManagerEvents

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

type LinkStatus

type LinkStatus = 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