1// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
2// protoc-gen-go-drpc version: (devel)
3// source: sesamestreet.proto
4
5package pb
6
7import (
8	context "context"
9	errors "errors"
10	protojson "google.golang.org/protobuf/encoding/protojson"
11	proto "google.golang.org/protobuf/proto"
12	drpc "storj.io/drpc"
13	drpcerr "storj.io/drpc/drpcerr"
14)
15
16type drpcEncoding_File_sesamestreet_proto struct{}
17
18func (drpcEncoding_File_sesamestreet_proto) Marshal(msg drpc.Message) ([]byte, error) {
19	return proto.Marshal(msg.(proto.Message))
20}
21
22func (drpcEncoding_File_sesamestreet_proto) MarshalAppend(buf []byte, msg drpc.Message) ([]byte, error) {
23	return proto.MarshalOptions{}.MarshalAppend(buf, msg.(proto.Message))
24}
25
26func (drpcEncoding_File_sesamestreet_proto) Unmarshal(buf []byte, msg drpc.Message) error {
27	return proto.Unmarshal(buf, msg.(proto.Message))
28}
29
30func (drpcEncoding_File_sesamestreet_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
31	return protojson.Marshal(msg.(proto.Message))
32}
33
34func (drpcEncoding_File_sesamestreet_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
35	return protojson.Unmarshal(buf, msg.(proto.Message))
36}
37
38type DRPCCookieMonsterClient interface {
39	DRPCConn() drpc.Conn
40
41	EatCookie(ctx context.Context, in *Cookie) (*Crumbs, error)
42}
43
44type drpcCookieMonsterClient struct {
45	cc drpc.Conn
46}
47
48func NewDRPCCookieMonsterClient(cc drpc.Conn) DRPCCookieMonsterClient {
49	return &drpcCookieMonsterClient{cc}
50}
51
52func (c *drpcCookieMonsterClient) DRPCConn() drpc.Conn { return c.cc }
53
54func (c *drpcCookieMonsterClient) EatCookie(ctx context.Context, in *Cookie) (*Crumbs, error) {
55	out := new(Crumbs)
56	err := c.cc.Invoke(ctx, "/sesamestreet.CookieMonster/EatCookie", drpcEncoding_File_sesamestreet_proto{}, in, out)
57	if err != nil {
58		return nil, err
59	}
60	return out, nil
61}
62
63type DRPCCookieMonsterServer interface {
64	EatCookie(context.Context, *Cookie) (*Crumbs, error)
65}
66
67type DRPCCookieMonsterUnimplementedServer struct{}
68
69func (s *DRPCCookieMonsterUnimplementedServer) EatCookie(context.Context, *Cookie) (*Crumbs, error) {
70	return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
71}
72
73type DRPCCookieMonsterDescription struct{}
74
75func (DRPCCookieMonsterDescription) NumMethods() int { return 1 }
76
77func (DRPCCookieMonsterDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
78	switch n {
79	case 0:
80		return "/sesamestreet.CookieMonster/EatCookie", drpcEncoding_File_sesamestreet_proto{},
81			func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
82				return srv.(DRPCCookieMonsterServer).
83					EatCookie(
84						ctx,
85						in1.(*Cookie),
86					)
87			}, DRPCCookieMonsterServer.EatCookie, true
88	default:
89		return "", nil, nil, nil, false
90	}
91}
92
93func DRPCRegisterCookieMonster(mux drpc.Mux, impl DRPCCookieMonsterServer) error {
94	return mux.Register(impl, DRPCCookieMonsterDescription{})
95}
96
97type DRPCCookieMonster_EatCookieStream interface {
98	drpc.Stream
99	SendAndClose(*Crumbs) error
100}
101
102type drpcCookieMonster_EatCookieStream struct {
103	drpc.Stream
104}
105
106func (x *drpcCookieMonster_EatCookieStream) SendAndClose(m *Crumbs) error {
107	if err := x.MsgSend(m, drpcEncoding_File_sesamestreet_proto{}); err != nil {
108		return err
109	}
110	return x.CloseSend()
111}
112