Documentation ¶
Index ¶
- Constants
- Variables
- func BookDir(name string) (string, error)
- func UserData() string
- type Book
- type BookSet
- type Bookmark
- type Config
- func (cfg *Config) CurrentService() (*Service, error)
- func (cfg *Config) Load(path string) error
- func (cfg *Config) RemoveService(service *Service) bool
- func (cfg *Config) Save(path string) error
- func (cfg *Config) ServiceByID(id string) (*Service, error)
- func (cfg *Config) ServiceByName(name string) (*Service, error)
- func (cfg *Config) SetCurrentService(service *Service) error
- func (cfg *Config) SetService(service *Service)
- type General
- type Service
Constants ¶
View Source
const ( ProgramAuthor = "Alexander Linkov <kvark128@yandex.ru>" ProgramName = "OnlineLibrary" ProgramVersion = "2024.01.20" ProgramDescription = "DAISY Online Client" CopyrightInfo = "Copyright (C) 2020 - 2024 Alexander Linkov" ConfigFile = "config.yaml" LogFile = "session.log" MessageBufferSize = 16 HTTPTimeout = time.Second * 12 LocalStorageID = "localstorage" MetadataFileName = "metadata.xml" )
View Source
const ( MP3_FORMAT = "audio/mpeg" LKF_FORMAT = "audio/x-lkf" LGK_FORMAT = "application/lgk" )
Supported mime types of content
Variables ¶
View Source
var ( BookNotFound = errors.New("book not found") ListeningPosition = "listening_position" )
View Source
var ReadingSystemAttributes = dodp.ReadingSystemAttributes{ Manufacturer: ProgramAuthor, Model: ProgramName, Version: ProgramVersion, Config: dodp.Config{ SupportsMultipleSelections: false, PreferredUILanguage: "ru-RU", SupportedContentFormats: dodp.SupportedContentFormats{}, SupportedContentProtectionFormats: dodp.SupportedContentProtectionFormats{}, SupportedMimeTypes: dodp.SupportedMimeTypes{MimeType: []dodp.MimeType{dodp.MimeType{Type: LKF_FORMAT}, dodp.MimeType{Type: LGK_FORMAT}, dodp.MimeType{Type: MP3_FORMAT}}}, SupportedInputTypes: dodp.SupportedInputTypes{Input: []dodp.Input{dodp.Input{Type: dodp.TEXT_ALPHANUMERIC}, dodp.Input{Type: dodp.AUDIO}}}, RequiresAudioLabels: false, }, }
General client configuration of DAISY-online
View Source
var (
ServiceNotFound = errors.New("service not found")
)
Functions ¶
Types ¶
type Config ¶
type Config struct { General General `yaml:"general,omitempty"` Services []*Service `yaml:"services,omitempty"` LocalBooks BookSet `yaml:"local_books,omitempty"` }
func (*Config) CurrentService ¶
func (*Config) RemoveService ¶
func (*Config) SetCurrentService ¶
func (*Config) SetService ¶
type General ¶
type General struct { OutputDevice string `yaml:"output_device,omitempty"` Language string `yaml:"language,omitempty"` Volume float64 `yaml:"volume,omitempty"` PauseTimer time.Duration `yaml:"pause_timer,omitempty"` LogLevel string `yaml:"log_level,omitempty"` Provider string `yaml:"provider,omitempty"` }
Click to show internal directories.
Click to hide internal directories.