Documentation ¶
Overview ¶
Package dodp implements DAISY Online Delivery Protocol v1.
Index ¶
- Constants
- type Announcement
- type Announcements
- type Audio
- type Bookmark
- type BookmarkSet
- type Choice
- type Choices
- type Client
- func (c *Client) GetBookmarks(contentID string) (*BookmarkSet, error)
- func (c *Client) GetContentList(id string, firstItem int32, lastItem int32) (*ContentList, error)
- func (c *Client) GetContentMetadata(contentID string) (*ContentMetadata, error)
- func (c *Client) GetContentResources(contentID string) (*Resources, error)
- func (c *Client) GetQuestions(userResponses *UserResponses) (*Questions, error)
- func (c *Client) GetServiceAnnouncements() (*Announcements, error)
- func (c *Client) GetServiceAttributes() (*ServiceAttributes, error)
- func (c *Client) IssueContent(contentID string) (bool, error)
- func (c *Client) LogOff() (bool, error)
- func (c *Client) LogOn(username, password string) (bool, error)
- func (c *Client) MarkAnnouncementsAsRead(read *Read) (bool, error)
- func (c *Client) ReturnContent(contentID string) (bool, error)
- func (c *Client) SetBookmarks(contentID string, bookmarkSet *BookmarkSet) (bool, error)
- func (c *Client) SetReadingSystemAttributes(readingSystemAttributes *ReadingSystemAttributes) (bool, error)
- type Config
- type ContentItem
- type ContentList
- type ContentMetadata
- type Fault
- type Hilite
- type HiliteEnd
- type HiliteStart
- type Input
- type InputQuestion
- type InputTypes
- type Label
- type Lastmark
- type Meta
- type Metadata
- type MimeType
- type MultipleChoiceQuestion
- type Note
- type Questions
- type Read
- type ReadingSystemAttributes
- type Resource
- type Resources
- type Sample
- type Service
- type ServiceAttributes
- type ServiceProvider
- type SupportedContentFormats
- type SupportedContentProtectionFormats
- type SupportedContentSelectionMethods
- type SupportedInputTypes
- type SupportedMimeTypes
- type SupportedOptionalOperations
- type SupportedUplinkAudioCodecs
- type Title
- type UserResponse
- type UserResponses
Constants ¶
const ( TEXT_NUMERIC = "TEXT_NUMERIC" TEXT_ALPHANUMERIC = "TEXT_ALPHANUMERIC" AUDIO = "AUDIO" )
Supported input types
const ( Issued = "issued" New = "new" Expired = "expired" )
The identifiers of the content list for getContentList operation
const ( Default = "default" Search = "search" Back = "back" )
The identifiers of the question for getQuestions operation
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Announcement ¶
type Announcements ¶
type Announcements struct { XMLName xml.Name `xml:"announcements"` Announcement []Announcement `xml:"announcement"` }
type BookmarkSet ¶ added in v0.3.0
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
DAISY Online client
func NewClientWithContext ¶ added in v0.2.0
Creates an instance of a new DAISY Online client with context and the specified service URL. Timeout limits the execution time of each HTTP request for this client. Zero timeout means no timeout.
func (*Client) GetBookmarks ¶ added in v0.3.0
func (c *Client) GetBookmarks(contentID string) (*BookmarkSet, error)
Retrieves the bookmarks for a Content item from a Service.
func (*Client) GetContentList ¶
Retrieves a list of Content items. The list returned by the Service can be pre-composed, in which case it is retrieved by passing one of the three reserved values defined in the id parameter below. (Refer to 4, Protocol Fundamentals for information on the contexts in which these reserved values are used.) The list can also be dynamic (e.g., the result of a dynamic menu search operation sequence). In this case, the id value used to refer to the list is provided in the return value of a previous call to getQuestions. (Refer to the questions type for more information.)
func (*Client) GetContentMetadata ¶
func (c *Client) GetContentMetadata(contentID string) (*ContentMetadata, error)
Retrieves the contentMetadata of the specified Content item. This operation must be called as part of the Content Retrieval Sequence.
func (*Client) GetContentResources ¶
Retrieves the resources list for the specified Content item. The Content item must be issued before this operation is called. If not, the Service shall respond with an invalidParameter Fault.
func (*Client) GetQuestions ¶
func (c *Client) GetQuestions(userResponses *UserResponses) (*Questions, error)
Retrieves a question from the series of questions that comprise the dynamic menu system.
func (*Client) GetServiceAnnouncements ¶
func (c *Client) GetServiceAnnouncements() (*Announcements, error)
Retrieves any announcements from the Service that a User has not yet read.
func (*Client) GetServiceAttributes ¶
func (c *Client) GetServiceAttributes() (*ServiceAttributes, error)
Retrieves Service properties, including information on which optional Operations the Service supports. A Reading System must call this operation as part of the Session Initialization Sequence and may call the operation to retrieve information on possible changes to Service properties at any other time during a Session.
func (*Client) IssueContent ¶
Requests a Service to issue the specified Content item.
func (*Client) LogOff ¶
Logs a Reading System off a Service. A return value of false or a Fault both indicate that the operation was not successful.
func (*Client) MarkAnnouncementsAsRead ¶ added in v0.3.0
Marks the specified announcement(s) as read. This operation is only valid if a previous call to getServiceAnnouncements has been made during the Session.
func (*Client) ReturnContent ¶
Notifies the Service that the specified Content item has been deleted from the Reading System. The specified Content item is no longer issued to the User after a successful call to this operation. A Reading System must not call this function for a Content item that has a requiresReturn attribute with a value of false. A Reading System must delete the Content item before calling returnContent. A Reading System must not call returnContent for a Content item that was not issued to the User on that Reading System.
func (*Client) SetBookmarks ¶ added in v0.3.0
func (c *Client) SetBookmarks(contentID string, bookmarkSet *BookmarkSet) (bool, error)
Requests that a Service store the supplied bookmarks for a Content item. This operation only supports the storage of bookmarks for one Content item at a time.
func (*Client) SetReadingSystemAttributes ¶
func (c *Client) SetReadingSystemAttributes(readingSystemAttributes *ReadingSystemAttributes) (bool, error)
Sends Reading System properties to a Service. A Reading System must call this operation as part of the Session Initialization Sequence. The operation may be called additional times during a Session to record dynamic changes in a Reading System's properties.
type Config ¶
type Config struct { XMLName xml.Name `xml:"config"` SupportsMultipleSelections bool `xml:"supportsMultipleSelections"` PreferredUILanguage string `xml:"preferredUILanguage"` SupportedContentFormats SupportedContentFormats SupportedContentProtectionFormats SupportedContentProtectionFormats SupportedMimeTypes SupportedMimeTypes SupportedInputTypes SupportedInputTypes RequiresAudioLabels bool `xml:"requiresAudioLabels"` }
type ContentItem ¶
type ContentList ¶
type ContentMetadata ¶
type HiliteStart ¶ added in v0.3.0
type InputQuestion ¶
type InputQuestion struct { XMLName xml.Name `xml:"inputQuestion"` ID string `xml:"id,attr"` InputTypes InputTypes Label Label }
type InputTypes ¶
type Label ¶
type Label struct { XMLName xml.Name `xml:"label"` Lang string `xml:"lang,attr"` Dir string `xml:"dir,attr"` Text string `xml:"text"` Audio Audio }
A multi-purpose label, containing text and optionally audio. To achieve maximum interoperability, Services should support the provision of audio labels, as Reading Systems may require them in order to render Service messages to the user.
type Metadata ¶
type Metadata struct { XMLName xml.Name `xml:"metadata"` Title string `xml:"title"` Identifier string `xml:"identifier"` Publisher string `xml:"publisher"` Format string `xml:"format"` Date string `xml:"date"` Source string `xml:"source"` Type []string `xml:"type"` Subject []string `xml:"subject"` Rights []string `xml:"rights"` Relation []string `xml:"relation"` Language []string `xml:"language"` Description []string `xml:"description"` Creator []string `xml:"creator"` Coverage []string `xml:"coverage"` Contributor []string `xml:"contributor"` Narrator []string `xml:"narrator"` Size int64 `xml:"size"` Meta []Meta `xml:"meta"` }
type MultipleChoiceQuestion ¶
type Questions ¶
type Questions struct { XMLName xml.Name `xml:"questions"` MultipleChoiceQuestion []MultipleChoiceQuestion `xml:"multipleChoiceQuestion"` InputQuestion []InputQuestion `xml:"inputQuestion"` ContentListRef string `xml:"contentListRef"` Label Label }
type ReadingSystemAttributes ¶
type ReadingSystemAttributes struct { XMLName xml.Name `xml:"readingSystemAttributes"` Manufacturer string `xml:"manufacturer"` Model string `xml:"model"` Version string `xml:"version"` Config Config }
Specifies Reading System properties. The properties specified are valid until the end of the Session.
type Resources ¶
type Resources struct { XMLName xml.Name `xml:"resources"` ReturnBy string `xml:"returnBy,attr"` LastModifiedDate string `xml:"lastModifiedDate,attr"` Resources []Resource `xml:"resource"` }
A list of all the resources that constitute the Content item.
type Sample ¶
A sample of the Content item that the User may retrieve without the Content item being issued.
type ServiceAttributes ¶
type ServiceAttributes struct { XMLName xml.Name `xml:"serviceAttributes"` ServiceProvider ServiceProvider Service Service SupportedContentSelectionMethods SupportedContentSelectionMethods SupportsServerSideBack bool `xml:"supportsServerSideBack"` SupportsSearch bool `xml:"supportsSearch"` SupportedUplinkAudioCodecs SupportedUplinkAudioCodecs SupportsAudioLabels bool `xml:"supportsAudioLabels"` SupportedOptionalOperations SupportedOptionalOperations }
Properties of the Service. The properties specified must be constant for the duration of the Session.
type ServiceProvider ¶
type ServiceProvider struct { XMLName xml.Name `xml:"serviceProvider"` ID string `xml:"id,attr"` Label Label }
The identity of the Service Provider.
type SupportedContentFormats ¶
type SupportedContentFormats struct { XMLName xml.Name `xml:"supportedContentFormats"` ContentFormat []string `xml:"contentFormat"` }
Specifies which Content formats the Reading System supports. A Service may use this information to choose which formats to offer to the Reading System. This document does not specify the behavior of the Service if this list is empty.
type SupportedContentProtectionFormats ¶
type SupportedContentProtectionFormats struct { XMLName xml.Name `xml:"supportedContentProtectionFormats"` ProtectionFormat []string `xml:"protectionFormat"` }
Specifies which Content protection (Digital Rights Management) standards the Reading System supports, if any.
type SupportedContentSelectionMethods ¶
type SupportedContentSelectionMethods struct { XMLName xml.Name `xml:"supportedContentSelectionMethods"` Method []string `xml:"method"` }
A list of Content Selection Methods supported by this Service. A Service must support at least one of the two methods.
type SupportedInputTypes ¶
type SupportedMimeTypes ¶
type SupportedOptionalOperations ¶
type SupportedOptionalOperations struct { XMLName xml.Name `xml:"supportedOptionalOperations"` Operation []string `xml:"operation"` }
Specifies which (if any) of the optional operations are supported by the Service.
type SupportedUplinkAudioCodecs ¶
type SupportedUplinkAudioCodecs struct { XMLName xml.Name `xml:"supportedUplinkAudioCodecs"` Codec []string `xml:"codec"` }
A list of the audio codecs (if any) supported in userResponses in addition to [ RIFF WAVE ] .
type UserResponse ¶
type UserResponses ¶
type UserResponses struct { XMLName xml.Name `xml:"userResponses"` UserResponse []UserResponse `xml:"userResponse"` }
A set of User responses to questions provided by the Service.