echo

package module
v0.0.0-...-6c74aba Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Unlicense Imports: 10 Imported by: 0

README

truss_example

An example truss service created using:

curl -o echo.proto https://raw.githubusercontent.com/metaverse/truss/master/_example/echo.proto
truss --svcout=. echo.proto

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthEcho = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEcho   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterEchoServer

func RegisterEchoServer(s *grpc.Server, srv EchoServer)

Types

type EchoClient

type EchoClient interface {
	// Echo "echos" the incoming string
	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
	// Louder "echos" the incoming string with `Loudness` additional exclamation marks
	Louder(ctx context.Context, in *LouderRequest, opts ...grpc.CallOption) (*EchoResponse, error)
	// LouderGet is the same as Louder, but pulls fields other than Loudness (i.e. In) from query params instead of POST
	LouderGet(ctx context.Context, in *LouderRequest, opts ...grpc.CallOption) (*EchoResponse, error)
}

EchoClient is the client API for Echo service.

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

func NewEchoClient

func NewEchoClient(cc *grpc.ClientConn) EchoClient

type EchoRequest

type EchoRequest struct {
	In string `protobuf:"bytes,1,opt,name=In,proto3" json:"In,omitempty"`
}

func (*EchoRequest) Descriptor

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

func (*EchoRequest) GetIn

func (m *EchoRequest) GetIn() string

func (*EchoRequest) Marshal

func (m *EchoRequest) Marshal() (dAtA []byte, err error)

func (*EchoRequest) MarshalTo

func (m *EchoRequest) MarshalTo(dAtA []byte) (int, error)

func (*EchoRequest) ProtoMessage

func (*EchoRequest) ProtoMessage()

func (*EchoRequest) Reset

func (m *EchoRequest) Reset()

func (*EchoRequest) Size

func (m *EchoRequest) Size() (n int)

func (*EchoRequest) String

func (m *EchoRequest) String() string

func (*EchoRequest) Unmarshal

func (m *EchoRequest) Unmarshal(dAtA []byte) error

func (*EchoRequest) XXX_DiscardUnknown

func (m *EchoRequest) XXX_DiscardUnknown()

func (*EchoRequest) XXX_Marshal

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

func (*EchoRequest) XXX_Merge

func (m *EchoRequest) XXX_Merge(src proto.Message)

func (*EchoRequest) XXX_Size

func (m *EchoRequest) XXX_Size() int

func (*EchoRequest) XXX_Unmarshal

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

type EchoResponse

type EchoResponse struct {
	Out string `protobuf:"bytes,1,opt,name=Out,proto3" json:"Out,omitempty"`
}

func (*EchoResponse) Descriptor

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

func (*EchoResponse) GetOut

func (m *EchoResponse) GetOut() string

func (*EchoResponse) Marshal

func (m *EchoResponse) Marshal() (dAtA []byte, err error)

func (*EchoResponse) MarshalTo

func (m *EchoResponse) MarshalTo(dAtA []byte) (int, error)

func (*EchoResponse) ProtoMessage

func (*EchoResponse) ProtoMessage()

func (*EchoResponse) Reset

func (m *EchoResponse) Reset()

func (*EchoResponse) Size

func (m *EchoResponse) Size() (n int)

func (*EchoResponse) String

func (m *EchoResponse) String() string

func (*EchoResponse) Unmarshal

func (m *EchoResponse) Unmarshal(dAtA []byte) error

func (*EchoResponse) XXX_DiscardUnknown

func (m *EchoResponse) XXX_DiscardUnknown()

func (*EchoResponse) XXX_Marshal

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

func (*EchoResponse) XXX_Merge

func (m *EchoResponse) XXX_Merge(src proto.Message)

func (*EchoResponse) XXX_Size

func (m *EchoResponse) XXX_Size() int

func (*EchoResponse) XXX_Unmarshal

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

type EchoServer

type EchoServer interface {
	// Echo "echos" the incoming string
	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
	// Louder "echos" the incoming string with `Loudness` additional exclamation marks
	Louder(context.Context, *LouderRequest) (*EchoResponse, error)
	// LouderGet is the same as Louder, but pulls fields other than Loudness (i.e. In) from query params instead of POST
	LouderGet(context.Context, *LouderRequest) (*EchoResponse, error)
}

EchoServer is the server API for Echo service.

type LouderRequest

type LouderRequest struct {
	// In is the string to echo back
	In string `protobuf:"bytes,1,opt,name=In,proto3" json:"In,omitempty"`
	// Loudness is the number of exclamations marks to add to the echoed string
	Loudness int32 `protobuf:"varint,2,opt,name=Loudness,proto3" json:"Loudness,omitempty"`
}

func (*LouderRequest) Descriptor

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

func (*LouderRequest) GetIn

func (m *LouderRequest) GetIn() string

func (*LouderRequest) GetLoudness

func (m *LouderRequest) GetLoudness() int32

func (*LouderRequest) Marshal

func (m *LouderRequest) Marshal() (dAtA []byte, err error)

func (*LouderRequest) MarshalTo

func (m *LouderRequest) MarshalTo(dAtA []byte) (int, error)

func (*LouderRequest) ProtoMessage

func (*LouderRequest) ProtoMessage()

func (*LouderRequest) Reset

func (m *LouderRequest) Reset()

func (*LouderRequest) Size

func (m *LouderRequest) Size() (n int)

func (*LouderRequest) String

func (m *LouderRequest) String() string

func (*LouderRequest) Unmarshal

func (m *LouderRequest) Unmarshal(dAtA []byte) error

func (*LouderRequest) XXX_DiscardUnknown

func (m *LouderRequest) XXX_DiscardUnknown()

func (*LouderRequest) XXX_Marshal

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

func (*LouderRequest) XXX_Merge

func (m *LouderRequest) XXX_Merge(src proto.Message)

func (*LouderRequest) XXX_Size

func (m *LouderRequest) XXX_Size() int

func (*LouderRequest) XXX_Unmarshal

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

type UnimplementedEchoServer

type UnimplementedEchoServer struct {
}

UnimplementedEchoServer can be embedded to have forward compatible implementations.

func (*UnimplementedEchoServer) Echo

func (*UnimplementedEchoServer) Louder

func (*UnimplementedEchoServer) LouderGet

Directories

Path Synopsis
cmd
svc
client/grpc
Package grpc provides a gRPC client for the Echo service.
Package grpc provides a gRPC client for the Echo service.
client/http
Package http provides an HTTP client for the Echo service.
Package http provides an HTTP client for the Echo service.

Jump to

Keyboard shortcuts

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