example

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClientCommandConfig = newClientCommandConfig()

-----------------------------------------------------------------------------

View Source
var EchoServiceClientCommand = &cobra.Command{
	Use: "echoService",
}

Functions

func RegisterEchoServiceServer

func RegisterEchoServiceServer(s *grpc.Server, srv EchoServiceServer)

Types

type ClientCommandConfig

type ClientCommandConfig struct {
	ServerAddr         string        `envconfig:"SERVER_ADDR" default:"localhost:8080"`
	Timeout            time.Duration `envconfig:"TIMEOUT" default:"10s"`
	TLS                bool          `envconfig:"TLS"`
	ServerName         string        `envconfig:"TLS_SERVER_NAME"`
	InsecureSkipVerify bool          `envconfig:"TLS_INSECURE_SKIP_VERIFY"`
	CACertFile         string        `envconfig:"TLS_CA_CERT_FILE"`
	CertFile           string        `envconfig:"TLS_CERT_FILE"`
	KeyFile            string        `envconfig:"TLS_KEY_FILE"`
	AuthToken          string        `envconfig:"AUTH_TOKEN"`
	AuthTokenType      string        `envconfig:"AUTH_TOKEN_TYPE" default:"Bearer"`
	JWTKey             string        `envconfig:"JWT_KEY"`
	JWTKeyFile         string        `envconfig:"JWT_KEY_FILE"`
}

func (*ClientCommandConfig) AddFlags

func (o *ClientCommandConfig) AddFlags(fs *pflag.FlagSet)

type EchoRequest

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

func (*EchoRequest) Descriptor

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

func (*EchoRequest) GetPing

func (m *EchoRequest) GetPing() string

func (*EchoRequest) ProtoMessage

func (*EchoRequest) ProtoMessage()

func (*EchoRequest) Reset

func (m *EchoRequest) Reset()

func (*EchoRequest) String

func (m *EchoRequest) String() string

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 {
	Pong                 string   `protobuf:"bytes,1,opt,name=pong,proto3" json:"pong,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*EchoResponse) Descriptor

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

func (*EchoResponse) GetPong

func (m *EchoResponse) GetPong() string

func (*EchoResponse) ProtoMessage

func (*EchoResponse) ProtoMessage()

func (*EchoResponse) Reset

func (m *EchoResponse) Reset()

func (*EchoResponse) String

func (m *EchoResponse) String() string

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 EchoServiceClient

type EchoServiceClient interface {
	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
}

EchoServiceClient is the client API for EchoService service.

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

func NewEchoServiceClient

func NewEchoServiceClient(cc *grpc.ClientConn) EchoServiceClient

type EchoServiceServer

type EchoServiceServer interface {
	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
}

EchoServiceServer is the server API for EchoService service.

type UnimplementedEchoServiceServer added in v0.0.4

type UnimplementedEchoServiceServer struct {
}

UnimplementedEchoServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedEchoServiceServer) Echo added in v0.0.4

Jump to

Keyboard shortcuts

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