svc

package
v0.0.0-...-58d7e0c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGreetingServiceServer

func RegisterGreetingServiceServer(s *grpc.Server, srv GreetingServiceServer)

Types

type ExpensiveRequest

type ExpensiveRequest struct {
	C string `json:"connection_string"`
	U string `json:"username"`
	P string `json:"password"`
}

type ExpensiveResponse

type ExpensiveResponse struct {
	V   string `json:"status"`
	Err string `json:"err,omitempty"` // errors don't JSON-marshal, so we use a string
}

type GRPCGreetRequest

type GRPCGreetRequest struct {
	S                    string   `protobuf:"bytes,1,opt,name=s,proto3" json:"s,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The request message containing the user's name.

func (*GRPCGreetRequest) Descriptor

func (*GRPCGreetRequest) Descriptor() ([]byte, []int)

func (*GRPCGreetRequest) GetS

func (m *GRPCGreetRequest) GetS() string

func (*GRPCGreetRequest) ProtoMessage

func (*GRPCGreetRequest) ProtoMessage()

func (*GRPCGreetRequest) Reset

func (m *GRPCGreetRequest) Reset()

func (*GRPCGreetRequest) String

func (m *GRPCGreetRequest) String() string

func (*GRPCGreetRequest) XXX_DiscardUnknown

func (m *GRPCGreetRequest) XXX_DiscardUnknown()

func (*GRPCGreetRequest) XXX_Marshal

func (m *GRPCGreetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GRPCGreetRequest) XXX_Merge

func (dst *GRPCGreetRequest) XXX_Merge(src proto.Message)

func (*GRPCGreetRequest) XXX_Size

func (m *GRPCGreetRequest) XXX_Size() int

func (*GRPCGreetRequest) XXX_Unmarshal

func (m *GRPCGreetRequest) XXX_Unmarshal(b []byte) error

type GRPCGreetResponse

type GRPCGreetResponse struct {
	Greeting             string   `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"`
	Err                  string   `protobuf:"bytes,2,opt,name=err,proto3" json:"err,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The response message containing the greetings

func (*GRPCGreetResponse) Descriptor

func (*GRPCGreetResponse) Descriptor() ([]byte, []int)

func (*GRPCGreetResponse) GetErr

func (m *GRPCGreetResponse) GetErr() string

func (*GRPCGreetResponse) GetGreeting

func (m *GRPCGreetResponse) GetGreeting() string

func (*GRPCGreetResponse) ProtoMessage

func (*GRPCGreetResponse) ProtoMessage()

func (*GRPCGreetResponse) Reset

func (m *GRPCGreetResponse) Reset()

func (*GRPCGreetResponse) String

func (m *GRPCGreetResponse) String() string

func (*GRPCGreetResponse) XXX_DiscardUnknown

func (m *GRPCGreetResponse) XXX_DiscardUnknown()

func (*GRPCGreetResponse) XXX_Marshal

func (m *GRPCGreetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GRPCGreetResponse) XXX_Merge

func (dst *GRPCGreetResponse) XXX_Merge(src proto.Message)

func (*GRPCGreetResponse) XXX_Size

func (m *GRPCGreetResponse) XXX_Size() int

func (*GRPCGreetResponse) XXX_Unmarshal

func (m *GRPCGreetResponse) XXX_Unmarshal(b []byte) error

type GreetRequest

type GreetRequest struct {
	S string `json:"s"`
}

type GreetResponse

type GreetResponse struct {
	V   string `json:"greeting"`
	Err string `json:"err,omitempty"` // errors don't JSON-marshal, so we use a string
}

type Greeter

type Greeter interface {
	Greet(context.Context, string) (string, error)
	Expensive(context.Context, string, string, string) (string, error)
}

type GreeterGRPC

type GreeterGRPC interface {
	GreetGRPC(context.Context, *GRPCGreetRequest) (*GRPCGreetResponse, error)
}

type GreetingService

type GreetingService struct{}

func (GreetingService) Expensive

func (g GreetingService) Expensive(ctx context.Context, connectionString, username, password string) (string, error)

func (GreetingService) Greet

func (g GreetingService) Greet(ctx context.Context, greeting string) (string, error)

type GreetingServiceClient

type GreetingServiceClient interface {
	// Sends a greeting
	GreetGRPC(ctx context.Context, in *GRPCGreetRequest, opts ...grpc.CallOption) (*GRPCGreetResponse, error)
}

GreetingServiceClient is the client API for GreetingService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewGreetingServiceClient

func NewGreetingServiceClient(cc *grpc.ClientConn) GreetingServiceClient

type GreetingServiceGRPC

type GreetingServiceGRPC struct{}

func (*GreetingServiceGRPC) GreetGRPC

type GreetingServiceServer

type GreetingServiceServer interface {
	// Sends a greeting
	GreetGRPC(context.Context, *GRPCGreetRequest) (*GRPCGreetResponse, error)
}

GreetingServiceServer is the server API for GreetingService service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL