dtos

package
v0.0.0-...-37719a7 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REQUEST_ID ctxKey = iota
	BOOK_ID    ctxKey = iota
	TIME_TAKEN ctxKey = iota
	START_TIME ctxKey = iota
	WS         ctxKey = iota
)

Variables

View Source
var (
	MGS_WS_MESSAGE_TYPE            = "message"
	ERROR_WS_MESSAGE_TYPE          = "error"
	BOOK_INFO_WS_MESSAGE_TYPE      = "bookInfo"
	WS_LIVE_STATUS_WS_MESSAGE_TYPE = "liveStatus"
	MORPHEUS_EVENT_TYPE            = "lofilibrarian"
)

Functions

func NewWsBookInfo

func NewWsBookInfo(ctx context.Context, bookInfo BookBreadcrumb, isFromOpenLibrary bool) wsBookInfo

func NewWsError

func NewWsError(ctx context.Context, msg string) wsError

func NewWsMessage

func NewWsMessage(ctx context.Context, msg string) wsMessage

Types

type AppConfig

type AppConfig struct {
	ApplicationStartUpTime time.Time
}

type Authors

type Authors struct {
	Key string `json:"key"`
}

type BookBreadcrumb

type BookBreadcrumb struct {
	Title        string   `json:"title"`
	Author       string   `json:"author"`
	Series       string   `json:"series"`
	MainCover    string   `json:"mainCover"`
	OtherCovers  []string `json:"otherCovers"`
	Pages        int      `json:"pages"`
	Link         string   `json:"link"`
	Rating       float64  `json:"rating"`
	RatingsCount int      `json:"ratingsCount"`
	Genres       []string `json:"genres"`
	ISBN         string   `json:"isbn"`
}

type Created

type Created struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type GoodReadsAuthor

type GoodReadsAuthor struct {
	ID                int    `json:"id"`
	Name              string `json:"name"`
	IsGoodreadsAuthor bool   `json:"isGoodreadsAuthor"`
	ProfileURL        string `json:"profileUrl"`
	WorksListURL      string `json:"worksListUrl"`
}

type GoodReadsDescription

type GoodReadsDescription struct {
	HTML           string `json:"html"`
	Truncated      bool   `json:"truncated"`
	FullContentURL string `json:"fullContentUrl"`
}

type GoodReadsSearchBookResult

type GoodReadsSearchBookResult struct {
	ImageURL      string               `json:"imageUrl"`
	BookID        string               `json:"bookId"`
	WorkID        string               `json:"workId"`
	BookURL       string               `json:"bookUrl"`
	FromSearch    bool                 `json:"from_search"`
	FromSrp       bool                 `json:"from_srp"`
	Qid           string               `json:"qid"`
	Rank          int                  `json:"rank"`
	Title         string               `json:"title"`
	BookTitleBare string               `json:"bookTitleBare"`
	NumPages      int                  `json:"numPages"`
	AvgRating     string               `json:"avgRating"`
	RatingsCount  int                  `json:"ratingsCount"`
	Author        GoodReadsAuthor      `json:"author"`
	KcrPreviewURL string               `json:"kcrPreviewUrl"`
	Description   GoodReadsDescription `json:"description"`
}

type LastModified

type LastModified struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type LookupRequest

type LookupRequest struct {
	ID     string `json:"id"`
	BookId string `json:"bookId"`
}

type MorpheusEvent

type MorpheusEvent struct {
	ID        string `json:"id"`
	Timestamp int64  `json:"timestamp"`
	Type      string `json:"type"`
	Level     string `json:"level"`
	Msg       string `json:"data"`
}

Optional, only used when rabbitMQ is enabled

func NewMorpheusEvent

func NewMorpheusEvent(msg, level string) MorpheusEvent

type OpenLibraryBook

type OpenLibraryBook struct {
	Publishers         []string                `json:"publishers"`
	Identifiers        OtherServiceIdentifiers `json:"identifiers"`
	Weight             string                  `json:"weight"`
	Covers             []int                   `json:"covers"`
	PhysicalFormat     string                  `json:"physical_format"`
	Key                string                  `json:"key"`
	Authors            []Authors               `json:"authors"`
	Ocaid              string                  `json:"ocaid"`
	Subjects           []string                `json:"subjects"`
	SourceRecords      []string                `json:"source_records"`
	Title              string                  `json:"title"`
	NumberOfPages      int                     `json:"number_of_pages"`
	Isbn13             []string                `json:"isbn_13"`
	Isbn10             []string                `json:"isbn_10"`
	PublishDate        string                  `json:"publish_date"`
	Works              []Works                 `json:"works"`
	Type               Type                    `json:"type"`
	PhysicalDimensions string                  `json:"physical_dimensions"`
	Lccn               []string                `json:"lccn"`
	LcClassifications  []string                `json:"lc_classifications"`
	LocalID            []string                `json:"local_id"`
	OclcNumbers        []string                `json:"oclc_numbers"`
	LatestRevision     int                     `json:"latest_revision"`
	Revision           int                     `json:"revision"`
	Created            Created                 `json:"created"`
	LastModified       LastModified            `json:"last_modified"`
}

type OtherServiceIdentifiers

type OtherServiceIdentifiers struct {
	Librarything []string `json:"librarything"`
	Goodreads    []string `json:"goodreads"`
}

type Type

type Type struct {
	Key string `json:"key"`
}

type UptimeResponse

type UptimeResponse struct {
	Status      string        `json:"status,omitempty"`
	Uptime      time.Duration `json:"uptime,omitempty"`
	StartUpTime int64         `json:"startuptime,omitempty"`
}

type Works

type Works struct {
	Key string `json:"key"`
}

type WsLiveStatus

type WsLiveStatus struct {
	Type              string `json:"type"`
	ServerSentTime    int64  `json:"serverSentTime"`
	ServerStartupTime int64  `json:"serverStartupTime,omitempty"`
}

func NewWsLiveStatus

func NewWsLiveStatus(appStartTime time.Time) WsLiveStatus

Jump to

Keyboard shortcuts

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