Documentation ¶
Index ¶
- type RssServer
- func (s *RssServer) CreateRssItem(file *domain.MediaFile) *feeds.RssItem
- func (s *RssServer) GetFile(w http.ResponseWriter, r *http.Request)
- func (s *RssServer) GetList(w http.ResponseWriter, r *http.Request)
- func (s *RssServer) MakeLinkUrl(parts ...string) string
- func (s *RssServer) Run() error
- func (s *RssServer) ServerAddress() string
- func (s *RssServer) SetFileInput(additions chan *domain.MediaFile)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RssServer ¶
type RssServer struct { // URL of the Server Server string // Port the server listens on Port int // Feed Object Feed *feeds.RssFeed // Internal map of files that we are making available Filemap map[string]*domain.MediaFile }
RssServer is a HTTP server which maintains and presents a https://github.com/gorilla/feeds feed
Exposes:
/ - Prints the RSS XML /file/<id>/filename - Downloads the file
func NewRssServer ¶
NewRssServer takes the URL and port that the server will listen and offer its wares from.
func (*RssServer) CreateRssItem ¶
CreateRssItem takes a provided file.MediaFile and converts it into a RssItem
func (*RssServer) GetFile ¶
func (s *RssServer) GetFile(w http.ResponseWriter, r *http.Request)
GetFile is the endpoint that will return the file requested, or raise a 404 error if the file cannot be found
func (*RssServer) GetList ¶
func (s *RssServer) GetList(w http.ResponseWriter, r *http.Request)
GetList is the endpoint that will return the XML file
func (*RssServer) MakeLinkUrl ¶
MakeLinkUrl creates a URL from the provided string parts
func (*RssServer) Run ¶
Run starts the HTTP listener. Returns whatever error the HTTP server may raise (not HTTP errors)
func (*RssServer) ServerAddress ¶
ServerAddress returns the base URL
func (*RssServer) SetFileInput ¶
SetFileInput sets the input channel that will feed the RSS feed Starts a new go routine