diff options
author | r <r@freesoftwareextremist.com> | 2020-02-23 19:51:42 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2020-02-23 19:51:42 +0000 |
commit | 4ac5022cf1aa80e633f3fd0b6fe8d4515110720e (patch) | |
tree | 589c5693288a6cfb114d2dfcc85c74d8a4323509 /service | |
parent | c2c5b641ca8c170811a619bf1860503f4dfbca20 (diff) | |
download | bloat-4ac5022cf1aa80e633f3fd0b6fe8d4515110720e.tar.gz bloat-4ac5022cf1aa80e633f3fd0b6fe8d4515110720e.zip |
Cleanup renderer.go
Diffstat (limited to 'service')
-rw-r--r-- | service/service.go | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/service/service.go b/service/service.go index 4316f86..f5d78aa 100644 --- a/service/service.go +++ b/service/service.go @@ -153,7 +153,7 @@ func (svc *service) ServeErrorPage(ctx context.Context, c *model.Client, err err } rCtx := getRendererContext(c) - svc.renderer.RenderErrorPage(rCtx, c.Writer, data) + svc.renderer.Render(rCtx, c.Writer, renderer.ErrorPage, data) } func (svc *service) ServeSigninPage(ctx context.Context, c *model.Client) ( @@ -165,7 +165,7 @@ func (svc *service) ServeSigninPage(ctx context.Context, c *model.Client) ( } rCtx := getRendererContext(nil) - return svc.renderer.RenderSigninPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.SigninPage, data) } func (svc *service) ServeRootPage(ctx context.Context, c *model.Client) (err error) { @@ -174,7 +174,7 @@ func (svc *service) ServeRootPage(ctx context.Context, c *model.Client) (err err } rCtx := getRendererContext(c) - return svc.renderer.RenderRootPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.RootPage, data) } func (svc *service) ServeNavPage(ctx context.Context, c *model.Client) (err error) { @@ -197,7 +197,7 @@ func (svc *service) ServeNavPage(ctx context.Context, c *model.Client) (err erro } rCtx := getRendererContext(c) - return svc.renderer.RenderNavPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.NavPage, data) } func (svc *service) ServeTimelinePage(ctx context.Context, c *model.Client, @@ -275,7 +275,7 @@ func (svc *service) ServeTimelinePage(ctx context.Context, c *model.Client, } rCtx := getRendererContext(c) - return svc.renderer.RenderTimelinePage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.TimelinePage, data) } func (svc *service) ServeThreadPage(ctx context.Context, c *model.Client, @@ -351,7 +351,7 @@ func (svc *service) ServeThreadPage(ctx context.Context, c *model.Client, } rCtx := getRendererContext(c) - return svc.renderer.RenderThreadPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.ThreadPage, data) } func (svc *service) ServeLikedByPage(ctx context.Context, c *model.Client, @@ -369,7 +369,7 @@ func (svc *service) ServeLikedByPage(ctx context.Context, c *model.Client, } rCtx := getRendererContext(c) - return svc.renderer.RenderLikedByPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.LikedByPage, data) } func (svc *service) ServeRetweetedByPage(ctx context.Context, c *model.Client, @@ -387,7 +387,7 @@ func (svc *service) ServeRetweetedByPage(ctx context.Context, c *model.Client, } rCtx := getRendererContext(c) - return svc.renderer.RenderRetweetedByPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.RetweetedByPage, data) } func (svc *service) ServeNotificationPage(ctx context.Context, c *model.Client, @@ -432,7 +432,7 @@ func (svc *service) ServeNotificationPage(ctx context.Context, c *model.Client, CommonData: commonData, } rCtx := getRendererContext(c) - return svc.renderer.RenderNotificationPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.NotificationPage, data) } func (svc *service) ServeUserPage(ctx context.Context, c *model.Client, @@ -504,7 +504,7 @@ func (svc *service) ServeUserPage(ctx context.Context, c *model.Client, CommonData: commonData, } rCtx := getRendererContext(c) - return svc.renderer.RenderUserPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.UserPage, data) } func (svc *service) ServeUserSearchPage(ctx context.Context, c *model.Client, @@ -542,7 +542,7 @@ func (svc *service) ServeUserSearchPage(ctx context.Context, c *model.Client, } rCtx := getRendererContext(c) - return svc.renderer.RenderUserSearchPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.UserSearchPage, data) } func (svc *service) ServeAboutPage(ctx context.Context, c *model.Client) (err error) { @@ -552,7 +552,7 @@ func (svc *service) ServeAboutPage(ctx context.Context, c *model.Client) (err er } rCtx := getRendererContext(c) - return svc.renderer.RenderAboutPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.AboutPage, data) } func (svc *service) ServeEmojiPage(ctx context.Context, c *model.Client) (err error) { @@ -568,7 +568,7 @@ func (svc *service) ServeEmojiPage(ctx context.Context, c *model.Client) (err er } rCtx := getRendererContext(c) - return svc.renderer.RenderEmojiPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.EmojiPage, data) } func (svc *service) ServeSearchPage(ctx context.Context, c *model.Client, @@ -603,7 +603,7 @@ func (svc *service) ServeSearchPage(ctx context.Context, c *model.Client, } rCtx := getRendererContext(c) - return svc.renderer.RenderSearchPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.SearchPage, data) } func (svc *service) ServeSettingsPage(ctx context.Context, c *model.Client) (err error) { @@ -614,7 +614,7 @@ func (svc *service) ServeSettingsPage(ctx context.Context, c *model.Client) (err } rCtx := getRendererContext(c) - return svc.renderer.RenderSettingsPage(rCtx, c.Writer, data) + return svc.renderer.Render(rCtx, c.Writer, renderer.SettingsPage, data) } func (svc *service) NewSession(ctx context.Context, instance string) ( |