Documentation ¶
Index ¶
- Constants
- type AgendaServer
- func (s *AgendaServer) Channel() *utils.Listener
- func (s *AgendaServer) Daily(ctx context.Context, in *api.Day) (out *api.Docket, err error)
- func (s *AgendaServer) Reset()
- func (s *AgendaServer) Schedule(ctx context.Context, in *api.Item) (out *api.Item, err error)
- func (s *AgendaServer) Shutdown()
- func (s *AgendaServer) UseError(rpc string, code codes.Code, msg string) error
- func (s *AgendaServer) UseFixture(rpc, path string) (err error)
Constants ¶
View Source
const ( DailyRPC = "agenda.v1.Agenda/Daily" ScheduleRPC = "agenda.v1.Agenda/Schedule" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgendaServer ¶
type AgendaServer struct { api.UnimplementedAgendaServer Calls map[string]int OnSchedule func(context.Context, *api.Item) (*api.Item, error) OnDaily func(context.Context, *api.Day) (*api.Docket, error) // contains filtered or unexported fields }
func New ¶
func New(bufnet *utils.Listener) *AgendaServer
New creates a new mock RemotePeer. If bufnet is nil, one is created for the user.
func (*AgendaServer) Channel ¶
func (s *AgendaServer) Channel() *utils.Listener
func (*AgendaServer) Daily ¶
func (s *AgendaServer) Daily(ctx context.Context, in *api.Day) (out *api.Docket, err error)
func (*AgendaServer) Reset ¶
func (s *AgendaServer) Reset()
func (*AgendaServer) Schedule ¶
func (s *AgendaServer) Schedule(ctx context.Context, in *api.Item) (out *api.Item, err error)
func (*AgendaServer) Shutdown ¶
func (s *AgendaServer) Shutdown()
func (*AgendaServer) UseError ¶
UseError allows you to specify a gRPC status error to return from the specified RPC.
func (*AgendaServer) UseFixture ¶
func (s *AgendaServer) UseFixture(rpc, path string) (err error)
UseFixture loadsa a JSON fixture from disk (usually in a testdata folder) to use as the protocol buffer response to the specified RPC, simplifying handler mocking.
Click to show internal directories.
Click to hide internal directories.