func NewComponent(dispatcher *webfw.Dispatcher, apiPattern string) Component { return Component{ BasePatternController: webfw.NewBasePatternController("/component/:name", webfw.MethodAll, ""), dispatcher: dispatcher, apiPattern: apiPattern, } }
func NewWebSocket(fm *readeef.FeedManager, si readeef.SearchIndex) WebSocket { return WebSocket{ BasePatternController: webfw.NewBasePatternController("/v:version/", webfw.MethodGet, ""), fm: fm, si: si, updateFeed: make(chan content.Feed), } }
func NewHubbubController(h *readeef.Hubbub, relativePath string, addFeed chan<- content.Feed, removeFeed chan<- content.Feed) HubbubController { return HubbubController{ BasePatternController: webfw.NewBasePatternController( "/v:version"+relativePath+"/:feed-id", webfw.MethodGet|webfw.MethodPost, "hubbub-callback", ), hubbub: h, addFeed: addFeed, removeFeed: removeFeed} }
func NewWebSocket(fm *readeef.FeedManager, sp content.SearchProvider, extractor content.Extractor, capabilities capabilities) WebSocket { return WebSocket{ BasePatternController: webfw.NewBasePatternController("/v:version/", webfw.MethodGet, ""), fm: fm, sp: sp, extractor: extractor, capabilities: capabilities, updateFeed: make(chan content.Feed), } }
func NewHubbubController(h *Hubbub) HubbubController { return HubbubController{ webfw.NewBasePatternController(h.config.Hubbub.RelativePath+"/:feed-id", webfw.MethodGet|webfw.MethodPost, "hubbub-callback"), h} }
func NewLogin(pattern string) Login { return Login{webfw.NewBasePatternController(pattern, webfw.MethodGet|webfw.MethodPost, "auth-login")} }
func NewProxy() Proxy { return Proxy{ BasePatternController: webfw.NewBasePatternController("/proxy", webfw.MethodGet, ""), } }
func NewSearch(searchIndex readeef.SearchIndex) Search { return Search{ webfw.NewBasePatternController("/v:version/search/:query", webfw.MethodGet, ""), searchIndex, } }
func NewUserSettings() UserSettings { return UserSettings{ webfw.NewBasePatternController("/v:version/user-settings/:attribute", webfw.MethodGet|webfw.MethodPost, ""), } }
func NewAuth() Auth { return Auth{ webfw.NewBasePatternController("/v:version/auth", webfw.MethodAll, ""), } }
func NewNonce(nonce *readeef.Nonce) Nonce { return Nonce{ webfw.NewBasePatternController("/v:version/nonce", webfw.MethodAll, ""), nonce, } }
func NewFever() Fever { return Fever{ BasePatternController: webfw.NewBasePatternController( fmt.Sprintf("/v%d/fever/", FEVER_API_VERSION), webfw.MethodPost, ""), } }