Documentation
¶
Index ¶
- Variables
- type Author
- type Client
- func (c *Client) CompileCollection(id string) (*Collection, error)
- func (c *Client) CompileMediaEntry(id string) (*MediaEntry, error)
- func (c *Client) CompileMetaData(url string) (*MetaData, error)
- func (c *Client) Fetch(url string) (string, error)
- func (c *Client) GetAuthor(id string) (*Author, error)
- func (c *Client) GetGroup(id string) (*Group, error)
- func (c *Client) GetKeywordTerm(id string) (string, error)
- func (c *Client) GetLicenseLabel(id string) (string, error)
- func (c *Client) URL(format string, args ...interface{}) string
- type Collection
- type Copyright
- type Group
- type MediaEntry
- type MetaData
- type Preview
Constants ¶
This section is empty.
Variables ¶
var ErrAccessForbidden = errors.New("access forbidden")
ErrAccessForbidden is returned when the requested resources is protected.
var ErrInvalidAuthentication = errors.New("invalid authentication")
ErrInvalidAuthentication is returned when the supplied authentication credentials have been rejected.
var ErrNotFound = errors.New("not found")
ErrNotFound is returned when the requested resource ist not found.
var ErrRequestFailed = errors.New("request failed")
ErrRequestFailed is returned when the request failed due to some error.
Functions ¶
This section is empty.
Types ¶
type Author ¶
type Author struct {
ID string `json:"id,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
}
Author contains info about an author.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client is used to request data from the Madek API.
func (*Client) CompileCollection ¶
func (c *Client) CompileCollection(id string) (*Collection, error)
CompileCollection will fully compile a collection with all available data from the API.
func (*Client) CompileMediaEntry ¶
func (c *Client) CompileMediaEntry(id string) (*MediaEntry, error)
CompileMediaEntry will fully compile a media entry with all available data from the API.
func (*Client) CompileMetaData ¶
CompileMetaData will compile the metadata found at the specified url.
func (*Client) GetKeywordTerm ¶
GetKeywordTerm will find the term for the provided keyword id.
func (*Client) GetLicenseLabel ¶
GetLicenseLabel will find the label for the provided license id.
type Collection ¶
type Collection struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
MetaData *MetaData `json:"meta_data"`
MediaEntries []*MediaEntry `json:"media_entries"`
}
A Collection contains multiple media entries.
type Copyright ¶
type Copyright struct {
Holder string `json:"holder,omitempty"`
Usage string `json:"usage,omitempty"`
Licenses []string `json:"licenses,omitempty"`
}
Copyright contains copyright infos.
type Group ¶
type Group struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Pseudonym string `json:"pseudonym,omitempty"`
}
Group contains info about a group.
type MediaEntry ¶
type MediaEntry struct {
ID string `json:"id"`
MetaData *MetaData `json:"meta_data"`
CreatedAt time.Time `json:"created_at"`
FileID string `json:"file_id"`
FileName string `json:"file_name"`
FileType string `json:"file_type"`
FileSize int64 `json:"file_size"`
StreamURL string `json:"stream_url"`
DownloadURL string `json:"download_url"`
Previews []*Preview `json:"previews"`
}
A MediaEntry contains multiple previews.
type MetaData ¶
type MetaData struct {
Title string `json:"title,omitempty"`
Subtitle string `json:"subtitle,omitempty"`
Description string `json:"description,omitempty"`
Authors []*Author `json:"authors,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Genres []string `json:"genres,omitempty"`
Year string `json:"year,omitempty"`
Copyright Copyright `json:"copyright,omitempty"`
Affiliation []*Group `json:"affiliation,omitempty"`
}
MetaData contains multiple metadata key value pairs.