spotlight

package
v0.1.19-0...-44b64e3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

README

Spotlight

Url image preview generator

Running locally

Start
make build-linux
cp ../../bin/spotlightd bin/spotlightd
cp example.env spotlightd.env  # Update as required
CURRENT_UID=$(id -u):$(id -g) docker-compose up --build -d spotlightd
Test

Visit http://localhost:1337/api/v1/spotlight?story_id=132

Stop
docker-compose down

Trouble shooting

Packr2
$ make build
...
...
packr2 clean
make[1]: packr2: No such file or directory
make[1]: *** [deps] Error 1
make: *** [build] Error 2

Make sure $GOPATH/bin is linked in your $PATH

$PATH=$GOPATH/bin:$PATH
Logging
docker ps
docker logs [Container ID obtained from docker ps]
Running on macOS
make deps-darwin
make run

Documentation

Index

Constants

View Source
const (
	WORDS_PER_LINE_CLAIM     = 7
	WORDS_PER_LINE_ARGUMENT  = 10
	WORDS_PER_LINE_COMMENT   = 10
	WORDS_PER_LINE_HIGHLIGHT = 10

	MAX_CHARS_PER_LINE = 40

	BODY_LINES_CLAIM     = 3
	BODY_LINES_ARGUMENT  = 4
	BODY_LINES_COMMENT   = 4
	BODY_LINES_HIGHLIGHT = 4
)
View Source
const ArgumentByIDQuery = `` /* 226-byte string literal not displayed */

ArgumentByIDQuery fetches an argument by the given ID

View Source
const ClaimByIDQuery = `` /* 236-byte string literal not displayed */

ClaimByIDQuery fetches a claim by the given ID

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgumentByIDResponse

type ArgumentByIDResponse struct {
	ClaimArgument ArgumentObject `json:"claimArgument"`
}

ArgumentByIDResponse defines the JSON response

type ArgumentObject

type ArgumentObject struct {
	ID           int64      `json:"id"`
	Body         string     `json:"body"`
	Summary      string     `json:"summary"`
	Creator      UserObject `json:"creator"`
	UpvotedCount int        `json:"upvotedCount"`
}

ArgumentObject defines the schema of an argument

type ClaimByIDResponse

type ClaimByIDResponse struct {
	Claim ClaimObject `json:"claim"`
}

ClaimByIDResponse defines the JSON response

type ClaimObject

type ClaimObject struct {
	ID            int64           `json:"id"`
	Body          string          `json:"body"`
	Source        string          `json:"source"`
	Community     CommunityObject `json:"community"`
	Creator       UserObject      `json:"creator"`
	ArgumentCount int             `json:"argumentCount"`
	Comments      []CommentObject `json:"comments"`
}

ClaimObject defines the schema of a story

func (ClaimObject) GetSource

func (claim ClaimObject) GetSource() string

GetSource returns the hostname of the source

func (ClaimObject) HasSource

func (claim ClaimObject) HasSource() bool

HasSource returns whether a story has a source or not

type CommentObject

type CommentObject struct {
	ID      int64      `json:"id"`
	Body    string     `json:"body"`
	Creator UserObject `json:"creator"`
}

CommentObject defines the schema of a comment

type CommunityObject

type CommunityObject struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

CommunityObject defines the schema of a category

type Service

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

func NewService

func NewService(port, endpoint string, jpeg bool, config truCtx.Config) *Service

func (*Service) Run

func (s *Service) Run()

type UserObject

type UserObject struct {
	Address     string            `json:"address"`
	UserProfile UserProfileObject `json:"userProfile"`
}

UserObject defines the schema of a user

type UserProfileObject

type UserProfileObject struct {
	AvatarURL string `json:"avatarURL"`
	FullName  string `json:"fullName"`
	Username  string `json:"username"`
}

UserProfileObject defines the schema of the twitter profile

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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