Documentation
¶
Index ¶
- Constants
- func Main() int
- func ParseFeedType(r io.Reader) (string, error)
- func RenderHTMLTemplate(w io.Writer, templatePath string, data any) error
- func RunServer(store Store, stdout, stderr io.Writer, args ...string) error
- type Feed
- type FileStore
- type FileStoreOption
- type MorningPost
- func (m *MorningPost) AddNews(news []News)
- func (m *MorningPost) EmptyNews()
- func (m *MorningPost) FindFeeds(URL string) []Feed
- func (m *MorningPost) GetNews() error
- func (m *MorningPost) HandleFeeds(w http.ResponseWriter, r *http.Request)
- func (m *MorningPost) HandleFeedsDelete(w http.ResponseWriter, r *http.Request)
- func (m *MorningPost) HandleFeedsTableRows(w http.ResponseWriter, r *http.Request)
- func (m *MorningPost) HandleNews(w http.ResponseWriter, r *http.Request)
- func (m *MorningPost) HandleNewsTableRows(w http.ResponseWriter, r *http.Request)
- func (m *MorningPost) ListenAndServe() error
- func (m *MorningPost) RandomNews()
- func (m *MorningPost) Serve(l net.Listener) error
- func (m *MorningPost) Shutdown() error
- func (m *MorningPost) WaitForExit() error
- type News
- type Option
- type Store
Constants ¶
View Source
const ( DefaultHTTPTimeout = 30 * time.Second DefaultListenAddress = "127.0.0.1:33000" DefaultNewsPageSize = 10 FeedTypeAtom = "Atom" FeedTypeRDF = "RDF" FeedTypeRSS = "RSS" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
func NewFileStore ¶
func NewFileStore(opts ...FileStoreOption) (*FileStore, error)
type FileStoreOption ¶
type FileStoreOption func(*FileStore)
func WithFileStorePath ¶
func WithFileStorePath(path string) FileStoreOption
type MorningPost ¶
type MorningPost struct { Client *http.Client ListenAddress string NewsPageSize int PageNews []News Stderr io.Writer Stdout io.Writer Store Store News []News // contains filtered or unexported fields }
func (*MorningPost) AddNews ¶
func (m *MorningPost) AddNews(news []News)
func (*MorningPost) EmptyNews ¶
func (m *MorningPost) EmptyNews()
func (*MorningPost) FindFeeds ¶
func (m *MorningPost) FindFeeds(URL string) []Feed
func (*MorningPost) GetNews ¶
func (m *MorningPost) GetNews() error
func (*MorningPost) HandleFeeds ¶
func (m *MorningPost) HandleFeeds(w http.ResponseWriter, r *http.Request)
func (*MorningPost) HandleFeedsDelete ¶
func (m *MorningPost) HandleFeedsDelete(w http.ResponseWriter, r *http.Request)
func (*MorningPost) HandleFeedsTableRows ¶
func (m *MorningPost) HandleFeedsTableRows(w http.ResponseWriter, r *http.Request)
func (*MorningPost) HandleNews ¶
func (m *MorningPost) HandleNews(w http.ResponseWriter, r *http.Request)
func (*MorningPost) HandleNewsTableRows ¶
func (m *MorningPost) HandleNewsTableRows(w http.ResponseWriter, r *http.Request)
func (*MorningPost) ListenAndServe ¶
func (m *MorningPost) ListenAndServe() error
func (*MorningPost) RandomNews ¶
func (m *MorningPost) RandomNews()
func (*MorningPost) Shutdown ¶
func (m *MorningPost) Shutdown() error
func (*MorningPost) WaitForExit ¶
func (m *MorningPost) WaitForExit() error
type Option ¶
type Option func(*MorningPost) error
func WithClient ¶
func WithStderr ¶
func WithStdout ¶
Click to show internal directories.
Click to hide internal directories.