safari

package
v0.0.0-...-5663587 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResponse

type AuthResponse struct {
	RefreshToken string `json:"refresh_token"`
	TokenType    string `json:"token_type"`
	AccessToken  string `json:"access_token"`
	ExpiresIn    int    `json:"expires_in"`
	Scope        string `json:"scope"`
}

type Book

type Book struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type Chapter

type Chapter struct {
	Filename       string
	Images         []string
	AssetBaseURL   string
	Title          string
	Content        string
	Id             string
	Order          int
	StylesheetsURL []string
}

type ChapterMeta

type ChapterMeta struct {
	Archive         string   `json:"archive"`
	Content         string   `json:"content"`
	URL             string   `json:"url"`
	NaturalKey      []string `json:"natural_key"`
	FullPath        string   `json:"full_path"`
	MinutesRequired float64  `json:"minutes_required"`
	NextChapter     struct {
		URL    string `json:"url"`
		Title  string `json:"title"`
		WebURL string `json:"web_url"`
	} `json:"next_chapter"`
	PreviousChapter struct {
		URL    string `json:"url"`
		Title  string `json:"title"`
		WebURL string `json:"web_url"`
	} `json:"previous_chapter"`
	Stylesheets []struct {
		FullPath    string `json:"full_path"`
		URL         string `json:"url"`
		OriginalURL string `json:"original_url"`
	} `json:"stylesheets"`
	Images               []interface{} `json:"images"`
	AssetBaseURL         string        `json:"asset_base_url"`
	WebURL               string        `json:"web_url"`
	LastPosition         interface{}   `json:"last_position"`
	Videoclips           []interface{} `json:"videoclips"`
	PublisherScripts     string        `json:"publisher_scripts"`
	PublisherScriptFiles []interface{} `json:"publisher_script_files"`
	AllowScripts         bool          `json:"allow_scripts"`
	Videoclip            interface{}   `json:"videoclip"`
	AcademicExcluded     bool          `json:"academic_excluded"`
	Subjects             []struct {
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"subjects"`
	Authors []struct {
		Name string `json:"name"`
	} `json:"authors"`
	Cover            string      `json:"cover"`
	BookTitle        string      `json:"book_title"`
	Updated          time.Time   `json:"updated"`
	SiteStyles       []string    `json:"site_styles"`
	CreatedTime      time.Time   `json:"created_time"`
	LastModifiedTime time.Time   `json:"last_modified_time"`
	Filename         string      `json:"filename"`
	Path             string      `json:"path"`
	EpubProperties   interface{} `json:"epub_properties"`
	HeadExtra        interface{} `json:"head_extra"`
	HasVideo         bool        `json:"has_video"`
	Title            string      `json:"title"`
	Description      string      `json:"description"`
	VirtualPages     int         `json:"virtual_pages"`
}

type Meta

type Meta struct {
	URL        string   `json:"url"`
	NaturalKey []string `json:"natural_key"`
	Authors    []struct {
		Name string `json:"name"`
	} `json:"authors"`
	Subjects []struct {
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"subjects"`
	Topics []struct {
		Score          float64 `json:"score"`
		Name           string  `json:"name"`
		Slug           string  `json:"slug"`
		UUID           string  `json:"uuid"`
		EpubIdentifier string  `json:"epub_identifier"`
	} `json:"topics"`
	Publishers []struct {
		Name string `json:"name"`
		ID   int    `json:"id"`
		Slug string `json:"slug"`
	} `json:"publishers"`
	Chapters        []string `json:"chapters"`
	Cover           string   `json:"cover"`
	ChapterList     string   `json:"chapter_list"`
	Toc             string   `json:"toc"`
	FlatToc         string   `json:"flat_toc"`
	WebURL          string   `json:"web_url"`
	LastChapterRead struct {
		URL    string `json:"url"`
		Title  string `json:"title"`
		WebURL string `json:"web_url"`
	} `json:"last_chapter_read"`
	AcademicExcluded        bool        `json:"academic_excluded"`
	OpfUniqueIdentifierType string      `json:"opf_unique_identifier_type"`
	CreatedTime             time.Time   `json:"created_time"`
	LastModifiedTime        time.Time   `json:"last_modified_time"`
	Identifier              string      `json:"identifier"`
	Name                    string      `json:"name"`
	Title                   string      `json:"title"`
	Format                  string      `json:"format"`
	ContentFormat           string      `json:"content_format"`
	Source                  string      `json:"source"`
	OrderableTitle          string      `json:"orderable_title"`
	HasStylesheets          bool        `json:"has_stylesheets"`
	Description             string      `json:"description"`
	Isbn                    string      `json:"isbn"`
	Issued                  string      `json:"issued"`
	Language                string      `json:"language"`
	Rights                  string      `json:"rights"`
	Updated                 time.Time   `json:"updated"`
	OrderableAuthor         string      `json:"orderable_author"`
	PurchaseLink            interface{} `json:"purchase_link"`
	PublisherResourceLinks  struct {
		Errata string `json:"Errata"`
	} `json:"publisher_resource_links"`
	IsFree          bool        `json:"is_free"`
	IsSystemBook    bool        `json:"is_system_book"`
	IsActive        bool        `json:"is_active"`
	IsHidden        bool        `json:"is_hidden"`
	VirtualPages    int         `json:"virtual_pages"`
	DurationSeconds interface{} `json:"duration_seconds"`
	Pagecount       int         `json:"pagecount"`
}

type Safari

type Safari struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSafari

func NewSafari() *Safari

func (*Safari) FetchBookById

func (s *Safari) FetchBookById(id string, username string, password string) ([]byte, error)

Get result by using book id

type TocContent

type TocContent struct {
	Fragment        string   `json:"fragment"`
	MinutesRequired float64  `json:"minutes_required"`
	Href            string   `json:"href"`
	Depth           int      `json:"depth"`
	ID              string   `json:"id"`
	FullPath        string   `json:"full_path"`
	Order           int      `json:"order"`
	Label           string   `json:"label"`
	Filename        string   `json:"filename"`
	NaturalKey      []string `json:"natural_key"`
	MediaType       string   `json:"media_type"`
	URL             string   `json:"url"`
}

Jump to

Keyboard shortcuts

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