示例#1
0
func NewComponent(dispatcher *webfw.Dispatcher, apiPattern string) Component {
	return Component{
		BasePatternController: webfw.NewBasePatternController("/component/:name", webfw.MethodAll, ""),
		dispatcher:            dispatcher,
		apiPattern:            apiPattern,
	}
}
示例#2
0
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),
	}
}
示例#3
0
文件: hubbub.go 项目: urandom/readeef
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}
}
示例#4
0
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),
	}
}
示例#5
0
文件: hubbub.go 项目: RavenB/readeef
func NewHubbubController(h *Hubbub) HubbubController {
	return HubbubController{
		webfw.NewBasePatternController(h.config.Hubbub.RelativePath+"/:feed-id", webfw.MethodGet|webfw.MethodPost, "hubbub-callback"),
		h}
}
示例#6
0
文件: login.go 项目: urandom/readeef
func NewLogin(pattern string) Login {
	return Login{webfw.NewBasePatternController(pattern, webfw.MethodGet|webfw.MethodPost, "auth-login")}
}
示例#7
0
文件: proxy.go 项目: urandom/readeef
func NewProxy() Proxy {
	return Proxy{
		BasePatternController: webfw.NewBasePatternController("/proxy", webfw.MethodGet, ""),
	}
}
示例#8
0
文件: search.go 项目: RavenB/readeef
func NewSearch(searchIndex readeef.SearchIndex) Search {
	return Search{
		webfw.NewBasePatternController("/v:version/search/:query", webfw.MethodGet, ""),
		searchIndex,
	}
}
示例#9
0
func NewUserSettings() UserSettings {
	return UserSettings{
		webfw.NewBasePatternController("/v:version/user-settings/:attribute", webfw.MethodGet|webfw.MethodPost, ""),
	}
}
示例#10
0
文件: auth.go 项目: RavenB/readeef
func NewAuth() Auth {
	return Auth{
		webfw.NewBasePatternController("/v:version/auth", webfw.MethodAll, ""),
	}
}
示例#11
0
文件: nonce.go 项目: urandom/readeef
func NewNonce(nonce *readeef.Nonce) Nonce {
	return Nonce{
		webfw.NewBasePatternController("/v:version/nonce", webfw.MethodAll, ""),
		nonce,
	}
}
示例#12
0
文件: fever.go 项目: urandom/readeef
func NewFever() Fever {
	return Fever{
		BasePatternController: webfw.NewBasePatternController(
			fmt.Sprintf("/v%d/fever/", FEVER_API_VERSION), webfw.MethodPost, ""),
	}
}