github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/service/home.go (about)

     1  // Copyright 2017 Keybase, Inc. All rights reserved. Use of
     2  // this source code is governed by the included BSD license.
     3  
     4  // RPC handlers for home operations
     5  
     6  package service
     7  
     8  import (
     9  	"github.com/keybase/client/go/home"
    10  	"github.com/keybase/client/go/libkb"
    11  	keybase1 "github.com/keybase/client/go/protocol/keybase1"
    12  	"github.com/keybase/go-framed-msgpack-rpc/rpc"
    13  	"golang.org/x/net/context"
    14  )
    15  
    16  type HomeHandler struct {
    17  	*BaseHandler
    18  	home *home.Home
    19  }
    20  
    21  func NewHomeHandler(xp rpc.Transporter, g *libkb.GlobalContext, home *home.Home) *HomeHandler {
    22  	handler := &HomeHandler{
    23  		BaseHandler: NewBaseHandler(g, xp),
    24  		home:        home,
    25  	}
    26  	return handler
    27  }
    28  
    29  var _ keybase1.HomeInterface = (*HomeHandler)(nil)
    30  
    31  func (h *HomeHandler) HomeGetScreen(ctx context.Context, arg keybase1.HomeGetScreenArg) (keybase1.HomeScreen, error) {
    32  	return h.home.Get(ctx, arg.MarkViewed, arg.NumFollowSuggestionsWanted)
    33  }
    34  
    35  func (h *HomeHandler) HomeSkipTodoType(ctx context.Context, typ keybase1.HomeScreenTodoType) error {
    36  	return h.home.SkipTodoType(ctx, typ)
    37  }
    38  
    39  func (h *HomeHandler) HomeDismissAnnouncement(ctx context.Context, id keybase1.HomeScreenAnnouncementID) error {
    40  	return h.home.DismissAnnouncement(ctx, id)
    41  }
    42  
    43  func (h *HomeHandler) HomeActionTaken(ctx context.Context) error {
    44  	return h.home.ActionTaken(ctx)
    45  }
    46  
    47  func (h *HomeHandler) HomeMarkViewed(ctx context.Context) error {
    48  	return h.home.MarkViewed(ctx)
    49  }