hellopb

package
v0.0.0-...-48c4086 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Package hellopb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package hellopb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package hellopb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package hellopb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const GreeterPathPrefix = "/twirp/hello.Greeter/"

GreeterPathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

View Source
const TestApiPathPrefix = "/twirp/hello.TestApi/"

TestApiPathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

View Source
const TestApiV2PathPrefix = "/twirp/hello.TestApiV2/"

TestApiV2PathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

View Source
const TransportPathPrefix = "/twirp/hello.Transport/"

TransportPathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

View Source
const UserServicePathPrefix = "/twirp/hello.UserService/"

UserServicePathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

Variables

View Source
var (
	PhoneType_name = map[int32]string{
		0: "MOBILE",
		1: "HOME",
		2: "WORK",
	}
	PhoneType_value = map[string]int32{
		"MOBILE": 0,
		"HOME":   1,
		"WORK":   2,
	}
)

Enum value maps for PhoneType.

View Source
var (
	Role_name = map[int32]string{
		0: "GUEST",
		1: "MEMBER",
		2: "ADMIN",
	}
	Role_value = map[string]int32{
		"GUEST":  0,
		"MEMBER": 1,
		"ADMIN":  2,
	}
)

Enum value maps for Role.

View Source
var (
	EnumValue_name = map[int32]string{
		0: "X",
		1: "Y",
		2: "Z",
	}
	EnumValue_value = map[string]int32{
		"X": 0,
		"Y": 1,
		"Z": 2,
	}
)

Enum value maps for EnumValue.

View Source
var File_hello_api1_proto protoreflect.FileDescriptor
View Source
var File_hello_api_proto protoreflect.FileDescriptor
View Source
var File_hello_example_proto protoreflect.FileDescriptor
View Source
var File_hello_helloworld_proto protoreflect.FileDescriptor
View Source
var File_hello_proto3_proto protoreflect.FileDescriptor
View Source
var File_hello_transport_proto protoreflect.FileDescriptor
View Source
var Greeter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "hello.Greeter",
	HandlerType: (*GreeterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SayHello",
			Handler:    _Greeter_SayHello_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "hello/helloworld.proto",
}

Greeter_ServiceDesc is the grpc.ServiceDesc for Greeter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var TestApiV2_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "hello.TestApiV2",
	HandlerType: (*TestApiV2Server)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Version1",
			Handler:    _TestApiV2_Version1_Handler,
		},
		{
			MethodName: "VersionTest1",
			Handler:    _TestApiV2_VersionTest1_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "hello/api.proto",
}

TestApiV2_ServiceDesc is the grpc.ServiceDesc for TestApiV2 service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var TestApi_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "hello.TestApi",
	HandlerType: (*TestApiServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Version",
			Handler:    _TestApi_Version_Handler,
		},
		{
			MethodName: "Version1",
			Handler:    _TestApi_Version1_Handler,
		},
		{
			MethodName: "VersionTest",
			Handler:    _TestApi_VersionTest_Handler,
		},
		{
			MethodName: "VersionTestCustom",
			Handler:    _TestApi_VersionTestCustom_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "hello/api.proto",
}

TestApi_ServiceDesc is the grpc.ServiceDesc for TestApi service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var Transport_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "hello.Transport",
	HandlerType: (*TransportServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TestStream3",
			Handler:    _Transport_TestStream3_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "TestStream",
			Handler:       _Transport_TestStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "TestStream1",
			Handler:       _Transport_TestStream1_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "TestStream2",
			Handler:       _Transport_TestStream2_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "hello/transport.proto",
}

Transport_ServiceDesc is the grpc.ServiceDesc for Transport service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "hello.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddUser",
			Handler:    _UserService_AddUser_Handler,
		},
		{
			MethodName: "GetUser",
			Handler:    _UserService_GetUser_Handler,
		},
		{
			MethodName: "UpdateUser",
			Handler:    _UserService_UpdateUser_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListUsers",
			Handler:       _UserService_ListUsers_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ListUsersByRole",
			Handler:       _UserService_ListUsersByRole_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "hello/example.proto",
}

UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterGreeterHandler

func RegisterGreeterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterGreeterHandler registers the http handlers for service Greeter to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterGreeterHandlerClient

func RegisterGreeterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreeterClient) error

RegisterGreeterHandlerClient registers the http handlers for service Greeter to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GreeterClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GreeterClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GreeterClient" to call the correct interceptors.

func RegisterGreeterHandlerFromEndpoint

func RegisterGreeterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterGreeterHandlerFromEndpoint is same as RegisterGreeterHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterGreeterHandlerServer

func RegisterGreeterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreeterServer) error

RegisterGreeterHandlerServer registers the http handlers for service Greeter to "mux". UnaryRPC :call GreeterServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterGreeterHandlerFromEndpoint instead.

func RegisterGreeterServer

func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer)

func RegisterTestApiHandler

func RegisterTestApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTestApiHandler registers the http handlers for service TestApi to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTestApiHandlerClient

func RegisterTestApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestApiClient) error

RegisterTestApiHandlerClient registers the http handlers for service TestApi to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TestApiClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TestApiClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TestApiClient" to call the correct interceptors.

func RegisterTestApiHandlerFromEndpoint

func RegisterTestApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTestApiHandlerFromEndpoint is same as RegisterTestApiHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTestApiHandlerServer

func RegisterTestApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TestApiServer) error

RegisterTestApiHandlerServer registers the http handlers for service TestApi to "mux". UnaryRPC :call TestApiServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTestApiHandlerFromEndpoint instead.

func RegisterTestApiServer

func RegisterTestApiServer(s grpc.ServiceRegistrar, srv TestApiServer)

func RegisterTestApiV2Handler

func RegisterTestApiV2Handler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTestApiV2Handler registers the http handlers for service TestApiV2 to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTestApiV2HandlerClient

func RegisterTestApiV2HandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestApiV2Client) error

RegisterTestApiV2HandlerClient registers the http handlers for service TestApiV2 to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TestApiV2Client". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TestApiV2Client" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TestApiV2Client" to call the correct interceptors.

func RegisterTestApiV2HandlerFromEndpoint

func RegisterTestApiV2HandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTestApiV2HandlerFromEndpoint is same as RegisterTestApiV2Handler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTestApiV2HandlerServer

func RegisterTestApiV2HandlerServer(ctx context.Context, mux *runtime.ServeMux, server TestApiV2Server) error

RegisterTestApiV2HandlerServer registers the http handlers for service TestApiV2 to "mux". UnaryRPC :call TestApiV2Server directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTestApiV2HandlerFromEndpoint instead.

func RegisterTestApiV2Server

func RegisterTestApiV2Server(s grpc.ServiceRegistrar, srv TestApiV2Server)

func RegisterTransportHandler

func RegisterTransportHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTransportHandler registers the http handlers for service Transport to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTransportHandlerClient

func RegisterTransportHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TransportClient) error

RegisterTransportHandlerClient registers the http handlers for service Transport to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TransportClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TransportClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TransportClient" to call the correct interceptors.

func RegisterTransportHandlerFromEndpoint

func RegisterTransportHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTransportHandlerFromEndpoint is same as RegisterTransportHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTransportHandlerServer

func RegisterTransportHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TransportServer) error

RegisterTransportHandlerServer registers the http handlers for service Transport to "mux". UnaryRPC :call TransportServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTransportHandlerFromEndpoint instead.

func RegisterTransportServer

func RegisterTransportServer(s grpc.ServiceRegistrar, srv TransportServer)

func RegisterUserServiceHandler

func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterUserServiceHandler registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterUserServiceHandlerClient

func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error

RegisterUserServiceHandlerClient registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UserServiceClient" to call the correct interceptors.

func RegisterUserServiceHandlerFromEndpoint

func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterUserServiceHandlerServer

func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error

RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". UnaryRPC :call UserServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserServiceHandlerFromEndpoint instead.

func RegisterUserServiceServer

func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)

func WriteError

func WriteError(resp http.ResponseWriter, err error)

WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

Types

type EnumValue

type EnumValue int32
const (
	EnumValue_X EnumValue = 0
	EnumValue_Y EnumValue = 1
	EnumValue_Z EnumValue = 2
)

func (EnumValue) Descriptor

func (EnumValue) Descriptor() protoreflect.EnumDescriptor

func (EnumValue) Enum

func (x EnumValue) Enum() *EnumValue

func (EnumValue) EnumDescriptor deprecated

func (EnumValue) EnumDescriptor() ([]byte, []int)

Deprecated: Use EnumValue.Descriptor instead.

func (EnumValue) Number

func (x EnumValue) Number() protoreflect.EnumNumber

func (EnumValue) String

func (x EnumValue) String() string

func (EnumValue) Type

type Greeter

type Greeter interface {
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
}

func NewGreeterJSONClient

func NewGreeterJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Greeter

NewGreeterJSONClient creates a JSON client that implements the Greeter interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewGreeterProtobufClient

func NewGreeterProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Greeter

NewGreeterProtobufClient creates a Protobuf client that implements the Greeter interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type GreeterClient

type GreeterClient interface {
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
}

GreeterClient is the client API for Greeter service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewGreeterClient

func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient

type GreeterServer

type GreeterServer interface {
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
}

GreeterServer is the server API for Greeter service. All implementations should embed UnimplementedGreeterServer for forward compatibility

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.

HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.

type HelloReply

type HelloReply struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloReply) Descriptor deprecated

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

Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.

func (*HelloReply) GetMessage

func (x *HelloReply) GetMessage() string

func (*HelloReply) ProtoMessage

func (*HelloReply) ProtoMessage()

func (*HelloReply) ProtoReflect

func (x *HelloReply) ProtoReflect() protoreflect.Message

func (*HelloReply) Reset

func (x *HelloReply) Reset()

func (*HelloReply) String

func (x *HelloReply) String() string

type HelloRequest

type HelloRequest struct {
	Name      string                  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	StrVal    *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=strVal,proto3" json:"strVal,omitempty"`
	FloatVal  *wrapperspb.FloatValue  `protobuf:"bytes,3,opt,name=floatVal,proto3" json:"floatVal,omitempty"`
	DoubleVal *wrapperspb.DoubleValue `protobuf:"bytes,4,opt,name=doubleVal,proto3" json:"doubleVal,omitempty"`
	BoolVal   *wrapperspb.BoolValue   `protobuf:"bytes,5,opt,name=boolVal,proto3" json:"boolVal,omitempty"`
	BytesVal  *wrapperspb.BytesValue  `protobuf:"bytes,6,opt,name=bytesVal,proto3" json:"bytesVal,omitempty"`
	Int32Val  *wrapperspb.Int32Value  `protobuf:"bytes,7,opt,name=int32Val,proto3" json:"int32Val,omitempty"`
	Uint32Val *wrapperspb.UInt32Value `protobuf:"bytes,8,opt,name=uint32Val,proto3" json:"uint32Val,omitempty"`
	Int64Val  *wrapperspb.Int64Value  `protobuf:"bytes,9,opt,name=int64Val,proto3" json:"int64Val,omitempty"`
	Uint64Val *wrapperspb.UInt64Value `protobuf:"bytes,10,opt,name=uint64Val,proto3" json:"uint64Val,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloRequest) Descriptor deprecated

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetBoolVal

func (x *HelloRequest) GetBoolVal() *wrapperspb.BoolValue

func (*HelloRequest) GetBytesVal

func (x *HelloRequest) GetBytesVal() *wrapperspb.BytesValue

func (*HelloRequest) GetDoubleVal

func (x *HelloRequest) GetDoubleVal() *wrapperspb.DoubleValue

func (*HelloRequest) GetFloatVal

func (x *HelloRequest) GetFloatVal() *wrapperspb.FloatValue

func (*HelloRequest) GetInt32Val

func (x *HelloRequest) GetInt32Val() *wrapperspb.Int32Value

func (*HelloRequest) GetInt64Val

func (x *HelloRequest) GetInt64Val() *wrapperspb.Int64Value

func (*HelloRequest) GetName

func (x *HelloRequest) GetName() string

func (*HelloRequest) GetStrVal

func (x *HelloRequest) GetStrVal() *wrapperspb.StringValue

func (*HelloRequest) GetUint32Val

func (x *HelloRequest) GetUint32Val() *wrapperspb.UInt32Value

func (*HelloRequest) GetUint64Val

func (x *HelloRequest) GetUint64Val() *wrapperspb.UInt64Value

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect

func (x *HelloRequest) ProtoReflect() protoreflect.Message

func (*HelloRequest) Reset

func (x *HelloRequest) Reset()

func (*HelloRequest) String

func (x *HelloRequest) String() string

type ListUsersRequest

type ListUsersRequest struct {

	// Only list users created after this timestamp
	CreatedSince *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=created_since,json=createdSince,proto3" json:"created_since,omitempty"`
	// Only list users older than this Duration
	OlderThan *durationpb.Duration `protobuf:"bytes,2,opt,name=older_than,json=olderThan,proto3" json:"older_than,omitempty"`
	// contains filtered or unexported fields
}

func (*ListUsersRequest) Descriptor deprecated

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

Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead.

func (*ListUsersRequest) GetCreatedSince

func (x *ListUsersRequest) GetCreatedSince() *timestamppb.Timestamp

func (*ListUsersRequest) GetOlderThan

func (x *ListUsersRequest) GetOlderThan() *durationpb.Duration

func (*ListUsersRequest) ProtoMessage

func (*ListUsersRequest) ProtoMessage()

func (*ListUsersRequest) ProtoReflect

func (x *ListUsersRequest) ProtoReflect() protoreflect.Message

func (*ListUsersRequest) Reset

func (x *ListUsersRequest) Reset()

func (*ListUsersRequest) String

func (x *ListUsersRequest) String() string

type Message

type Message struct {
	Header map[string]string `` /* 153-byte string literal not displayed */
	Body   []byte            `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetBody

func (x *Message) GetBody() []byte

func (*Message) GetHeader

func (x *Message) GetHeader() map[string]string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

func (x *Message) ProtoReflect() protoreflect.Message

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type PhoneType

type PhoneType int32

枚举消息类型

const (
	PhoneType_MOBILE PhoneType = 0 //proto3版本中,首成员必须为0,成员不应有相同的值
	PhoneType_HOME   PhoneType = 1
	PhoneType_WORK   PhoneType = 2
)

func (PhoneType) Descriptor

func (PhoneType) Descriptor() protoreflect.EnumDescriptor

func (PhoneType) Enum

func (x PhoneType) Enum() *PhoneType

func (PhoneType) EnumDescriptor deprecated

func (PhoneType) EnumDescriptor() ([]byte, []int)

Deprecated: Use PhoneType.Descriptor instead.

func (PhoneType) Number

func (x PhoneType) Number() protoreflect.EnumNumber

func (PhoneType) String

func (x PhoneType) String() string

func (PhoneType) Type

type Proto3Message

type Proto3Message struct {

	// Next number: 46
	Nested          *Proto3Message            `protobuf:"bytes,41,opt,name=nested,proto3" json:"nested,omitempty"`
	FloatValue      float32                   `protobuf:"fixed32,42,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"`
	DoubleValue     float64                   `protobuf:"fixed64,43,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"`
	Int64Value      int64                     `protobuf:"varint,3,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"`
	Int32Value      int32                     `protobuf:"varint,4,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"`
	Uint64Value     uint64                    `protobuf:"varint,5,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"`
	Uint32Value     uint32                    `protobuf:"varint,6,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"`
	BoolValue       bool                      `protobuf:"varint,7,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"`
	StringValue     string                    `protobuf:"bytes,8,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"`
	BytesValue      []byte                    `protobuf:"bytes,9,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"`
	RepeatedValue   []string                  `protobuf:"bytes,10,rep,name=repeated_value,json=repeatedValue,proto3" json:"repeated_value,omitempty"`
	RepeatedMessage []*wrapperspb.UInt64Value `protobuf:"bytes,44,rep,name=repeated_message,json=repeatedMessage,proto3" json:"repeated_message,omitempty"`
	EnumValue       EnumValue                 `protobuf:"varint,11,opt,name=enum_value,json=enumValue,proto3,enum=hello.EnumValue" json:"enum_value,omitempty"`
	RepeatedEnum    []EnumValue               `` /* 127-byte string literal not displayed */
	TimestampValue  *timestamppb.Timestamp    `protobuf:"bytes,13,opt,name=timestamp_value,json=timestampValue,proto3" json:"timestamp_value,omitempty"`
	DurationValue   *durationpb.Duration      `protobuf:"bytes,14,opt,name=duration_value,json=durationValue,proto3" json:"duration_value,omitempty"`
	FieldmaskValue  *fieldmaskpb.FieldMask    `protobuf:"bytes,15,opt,name=fieldmask_value,json=fieldmaskValue,proto3" json:"fieldmask_value,omitempty"`
	// Types that are assignable to OneofValue:
	//	*Proto3Message_OneofBoolValue
	//	*Proto3Message_OneofStringValue
	OneofValue         isProto3Message_OneofValue         `protobuf_oneof:"oneof_value"`
	WrapperDoubleValue *wrapperspb.DoubleValue            `protobuf:"bytes,17,opt,name=wrapper_double_value,json=wrapperDoubleValue,proto3" json:"wrapper_double_value,omitempty"`
	WrapperFloatValue  *wrapperspb.FloatValue             `protobuf:"bytes,18,opt,name=wrapper_float_value,json=wrapperFloatValue,proto3" json:"wrapper_float_value,omitempty"`
	WrapperInt64Value  *wrapperspb.Int64Value             `protobuf:"bytes,19,opt,name=wrapper_int64_value,json=wrapperInt64Value,proto3" json:"wrapper_int64_value,omitempty"`
	WrapperInt32Value  *wrapperspb.Int32Value             `protobuf:"bytes,20,opt,name=wrapper_int32_value,json=wrapperInt32Value,proto3" json:"wrapper_int32_value,omitempty"`
	WrapperUInt64Value *wrapperspb.UInt64Value            `protobuf:"bytes,21,opt,name=wrapper_u_int64_value,json=wrapperUInt64Value,proto3" json:"wrapper_u_int64_value,omitempty"`
	WrapperUInt32Value *wrapperspb.UInt32Value            `protobuf:"bytes,22,opt,name=wrapper_u_int32_value,json=wrapperUInt32Value,proto3" json:"wrapper_u_int32_value,omitempty"`
	WrapperBoolValue   *wrapperspb.BoolValue              `protobuf:"bytes,23,opt,name=wrapper_bool_value,json=wrapperBoolValue,proto3" json:"wrapper_bool_value,omitempty"`
	WrapperStringValue *wrapperspb.StringValue            `protobuf:"bytes,24,opt,name=wrapper_string_value,json=wrapperStringValue,proto3" json:"wrapper_string_value,omitempty"`
	WrapperBytesValue  *wrapperspb.BytesValue             `protobuf:"bytes,25,opt,name=wrapper_bytes_value,json=wrapperBytesValue,proto3" json:"wrapper_bytes_value,omitempty"`
	MapValue           map[string]string                  `` /* 174-byte string literal not displayed */
	MapValue2          map[string]int32                   `` /* 178-byte string literal not displayed */
	MapValue3          map[int32]string                   `` /* 178-byte string literal not displayed */
	MapValue4          map[string]int64                   `` /* 178-byte string literal not displayed */
	MapValue5          map[int64]string                   `` /* 178-byte string literal not displayed */
	MapValue6          map[string]uint32                  `` /* 178-byte string literal not displayed */
	MapValue7          map[uint32]string                  `` /* 178-byte string literal not displayed */
	MapValue8          map[string]uint64                  `` /* 178-byte string literal not displayed */
	MapValue9          map[uint64]string                  `` /* 178-byte string literal not displayed */
	MapValue10         map[string]float32                 `` /* 182-byte string literal not displayed */
	MapValue12         map[string]float64                 `` /* 182-byte string literal not displayed */
	MapValue14         map[string]bool                    `` /* 181-byte string literal not displayed */
	MapValue15         map[bool]string                    `` /* 181-byte string literal not displayed */
	MapValue16         map[string]*wrapperspb.UInt64Value `` /* 180-byte string literal not displayed */
	Details            []*anypb.Any                       `protobuf:"bytes,46,rep,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

func (*Proto3Message) Descriptor deprecated

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

Deprecated: Use Proto3Message.ProtoReflect.Descriptor instead.

func (*Proto3Message) GetBoolValue

func (x *Proto3Message) GetBoolValue() bool

func (*Proto3Message) GetBytesValue

func (x *Proto3Message) GetBytesValue() []byte

func (*Proto3Message) GetDetails

func (x *Proto3Message) GetDetails() []*anypb.Any

func (*Proto3Message) GetDoubleValue

func (x *Proto3Message) GetDoubleValue() float64

func (*Proto3Message) GetDurationValue

func (x *Proto3Message) GetDurationValue() *durationpb.Duration

func (*Proto3Message) GetEnumValue

func (x *Proto3Message) GetEnumValue() EnumValue

func (*Proto3Message) GetFieldmaskValue

func (x *Proto3Message) GetFieldmaskValue() *fieldmaskpb.FieldMask

func (*Proto3Message) GetFloatValue

func (x *Proto3Message) GetFloatValue() float32

func (*Proto3Message) GetInt32Value

func (x *Proto3Message) GetInt32Value() int32

func (*Proto3Message) GetInt64Value

func (x *Proto3Message) GetInt64Value() int64

func (*Proto3Message) GetMapValue

func (x *Proto3Message) GetMapValue() map[string]string

func (*Proto3Message) GetMapValue10

func (x *Proto3Message) GetMapValue10() map[string]float32

func (*Proto3Message) GetMapValue12

func (x *Proto3Message) GetMapValue12() map[string]float64

func (*Proto3Message) GetMapValue14

func (x *Proto3Message) GetMapValue14() map[string]bool

func (*Proto3Message) GetMapValue15

func (x *Proto3Message) GetMapValue15() map[bool]string

func (*Proto3Message) GetMapValue16

func (x *Proto3Message) GetMapValue16() map[string]*wrapperspb.UInt64Value

func (*Proto3Message) GetMapValue2

func (x *Proto3Message) GetMapValue2() map[string]int32

func (*Proto3Message) GetMapValue3

func (x *Proto3Message) GetMapValue3() map[int32]string

func (*Proto3Message) GetMapValue4

func (x *Proto3Message) GetMapValue4() map[string]int64

func (*Proto3Message) GetMapValue5

func (x *Proto3Message) GetMapValue5() map[int64]string

func (*Proto3Message) GetMapValue6

func (x *Proto3Message) GetMapValue6() map[string]uint32

func (*Proto3Message) GetMapValue7

func (x *Proto3Message) GetMapValue7() map[uint32]string

func (*Proto3Message) GetMapValue8

func (x *Proto3Message) GetMapValue8() map[string]uint64

func (*Proto3Message) GetMapValue9

func (x *Proto3Message) GetMapValue9() map[uint64]string

func (*Proto3Message) GetNested

func (x *Proto3Message) GetNested() *Proto3Message

func (*Proto3Message) GetOneofBoolValue

func (x *Proto3Message) GetOneofBoolValue() bool

func (*Proto3Message) GetOneofStringValue

func (x *Proto3Message) GetOneofStringValue() string

func (*Proto3Message) GetOneofValue

func (m *Proto3Message) GetOneofValue() isProto3Message_OneofValue

func (*Proto3Message) GetRepeatedEnum

func (x *Proto3Message) GetRepeatedEnum() []EnumValue

func (*Proto3Message) GetRepeatedMessage

func (x *Proto3Message) GetRepeatedMessage() []*wrapperspb.UInt64Value

func (*Proto3Message) GetRepeatedValue

func (x *Proto3Message) GetRepeatedValue() []string

func (*Proto3Message) GetStringValue

func (x *Proto3Message) GetStringValue() string

func (*Proto3Message) GetTimestampValue

func (x *Proto3Message) GetTimestampValue() *timestamppb.Timestamp

func (*Proto3Message) GetUint32Value

func (x *Proto3Message) GetUint32Value() uint32

func (*Proto3Message) GetUint64Value

func (x *Proto3Message) GetUint64Value() uint64

func (*Proto3Message) GetWrapperBoolValue

func (x *Proto3Message) GetWrapperBoolValue() *wrapperspb.BoolValue

func (*Proto3Message) GetWrapperBytesValue

func (x *Proto3Message) GetWrapperBytesValue() *wrapperspb.BytesValue

func (*Proto3Message) GetWrapperDoubleValue

func (x *Proto3Message) GetWrapperDoubleValue() *wrapperspb.DoubleValue

func (*Proto3Message) GetWrapperFloatValue

func (x *Proto3Message) GetWrapperFloatValue() *wrapperspb.FloatValue

func (*Proto3Message) GetWrapperInt32Value

func (x *Proto3Message) GetWrapperInt32Value() *wrapperspb.Int32Value

func (*Proto3Message) GetWrapperInt64Value

func (x *Proto3Message) GetWrapperInt64Value() *wrapperspb.Int64Value

func (*Proto3Message) GetWrapperStringValue

func (x *Proto3Message) GetWrapperStringValue() *wrapperspb.StringValue

func (*Proto3Message) GetWrapperUInt32Value

func (x *Proto3Message) GetWrapperUInt32Value() *wrapperspb.UInt32Value

func (*Proto3Message) GetWrapperUInt64Value

func (x *Proto3Message) GetWrapperUInt64Value() *wrapperspb.UInt64Value

func (*Proto3Message) ProtoMessage

func (*Proto3Message) ProtoMessage()

func (*Proto3Message) ProtoReflect

func (x *Proto3Message) ProtoReflect() protoreflect.Message

func (*Proto3Message) Reset

func (x *Proto3Message) Reset()

func (*Proto3Message) String

func (x *Proto3Message) String() string

type Proto3Message_OneofBoolValue

type Proto3Message_OneofBoolValue struct {
	OneofBoolValue bool `protobuf:"varint,1,opt,name=oneof_bool_value,json=oneofBoolValue,proto3,oneof"`
}

type Proto3Message_OneofStringValue

type Proto3Message_OneofStringValue struct {
	OneofStringValue string `protobuf:"bytes,2,opt,name=oneof_string_value,json=oneofStringValue,proto3,oneof"`
}

type Role

type Role int32
const (
	Role_GUEST  Role = 0
	Role_MEMBER Role = 1
	Role_ADMIN  Role = 2
)

func (Role) Descriptor

func (Role) Descriptor() protoreflect.EnumDescriptor

func (Role) Enum

func (x Role) Enum() *Role

func (Role) EnumDescriptor deprecated

func (Role) EnumDescriptor() ([]byte, []int)

Deprecated: Use Role.Descriptor instead.

func (Role) Number

func (x Role) Number() protoreflect.EnumNumber

func (Role) String

func (x Role) String() string

func (Role) Type

func (Role) Type() protoreflect.EnumType

type TestApi

type TestApi interface {
	// Version rpc
	Version(context.Context, *TestReq) (*TestApiOutput, error)

	Version1(context.Context, *google_protobuf.Value) (*TestApiOutput1, error)

	// VersionTest rpc
	VersionTest(context.Context, *TestReq) (*TestApiOutput, error)

	// VersionTest rpc custom
	VersionTestCustom(context.Context, *TestReq) (*TestApiOutput, error)
}

TestApi service

func NewTestApiJSONClient

func NewTestApiJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) TestApi

NewTestApiJSONClient creates a JSON client that implements the TestApi interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewTestApiProtobufClient

func NewTestApiProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) TestApi

NewTestApiProtobufClient creates a Protobuf client that implements the TestApi interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type TestApiClient

type TestApiClient interface {
	// Version rpc
	Version(ctx context.Context, in *TestReq, opts ...grpc.CallOption) (*TestApiOutput, error)
	Version1(ctx context.Context, in *structpb.Value, opts ...grpc.CallOption) (*TestApiOutput1, error)
	// VersionTest rpc
	VersionTest(ctx context.Context, in *TestReq, opts ...grpc.CallOption) (*TestApiOutput, error)
	// VersionTest rpc custom
	VersionTestCustom(ctx context.Context, in *TestReq, opts ...grpc.CallOption) (*TestApiOutput, error)
}

TestApiClient is the client API for TestApi service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewTestApiClient

func NewTestApiClient(cc grpc.ClientConnInterface) TestApiClient

type TestApiData

type TestApiData struct {
	Version    string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	SrvVersion string `protobuf:"bytes,2,opt,name=srvVersion,json=srv_ver,proto3" json:"srvVersion,omitempty"`
	// contains filtered or unexported fields
}

func (*TestApiData) Descriptor deprecated

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

Deprecated: Use TestApiData.ProtoReflect.Descriptor instead.

func (*TestApiData) GetSrvVersion

func (x *TestApiData) GetSrvVersion() string

func (*TestApiData) GetVersion

func (x *TestApiData) GetVersion() string

func (*TestApiData) ProtoMessage

func (*TestApiData) ProtoMessage()

func (*TestApiData) ProtoReflect

func (x *TestApiData) ProtoReflect() protoreflect.Message

func (*TestApiData) Reset

func (x *TestApiData) Reset()

func (*TestApiData) String

func (x *TestApiData) String() string

type TestApiOutput

type TestApiOutput struct {
	Code    int32        `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg     string       `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	NowTime int64        `protobuf:"varint,3,opt,name=nowTime,proto3" json:"nowTime,omitempty"`
	Data    *TestApiData `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*TestApiOutput) Descriptor deprecated

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

Deprecated: Use TestApiOutput.ProtoReflect.Descriptor instead.

func (*TestApiOutput) GetCode

func (x *TestApiOutput) GetCode() int32

func (*TestApiOutput) GetData

func (x *TestApiOutput) GetData() *TestApiData

func (*TestApiOutput) GetMsg

func (x *TestApiOutput) GetMsg() string

func (*TestApiOutput) GetNowTime

func (x *TestApiOutput) GetNowTime() int64

func (*TestApiOutput) ProtoMessage

func (*TestApiOutput) ProtoMessage()

func (*TestApiOutput) ProtoReflect

func (x *TestApiOutput) ProtoReflect() protoreflect.Message

func (*TestApiOutput) Reset

func (x *TestApiOutput) Reset()

func (*TestApiOutput) String

func (x *TestApiOutput) String() string

type TestApiOutput1

type TestApiOutput1 struct {
	Data *structpb.Value `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Abc  string          `protobuf:"bytes,2,opt,name=abc,proto3" json:"abc,omitempty"`
	// contains filtered or unexported fields
}

func (*TestApiOutput1) Descriptor deprecated

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

Deprecated: Use TestApiOutput1.ProtoReflect.Descriptor instead.

func (*TestApiOutput1) GetAbc

func (x *TestApiOutput1) GetAbc() string

func (*TestApiOutput1) GetData

func (x *TestApiOutput1) GetData() *structpb.Value

func (*TestApiOutput1) ProtoMessage

func (*TestApiOutput1) ProtoMessage()

func (*TestApiOutput1) ProtoReflect

func (x *TestApiOutput1) ProtoReflect() protoreflect.Message

func (*TestApiOutput1) Reset

func (x *TestApiOutput1) Reset()

func (*TestApiOutput1) String

func (x *TestApiOutput1) String() string

type TestApiServer

type TestApiServer interface {
	// Version rpc
	Version(context.Context, *TestReq) (*TestApiOutput, error)
	Version1(context.Context, *structpb.Value) (*TestApiOutput1, error)
	// VersionTest rpc
	VersionTest(context.Context, *TestReq) (*TestApiOutput, error)
	// VersionTest rpc custom
	VersionTestCustom(context.Context, *TestReq) (*TestApiOutput, error)
}

TestApiServer is the server API for TestApi service. All implementations should embed UnimplementedTestApiServer for forward compatibility

type TestApiV2

type TestApiV2 interface {
	Version1(context.Context, *TestReq) (*TestApiOutput, error)

	VersionTest1(context.Context, *TestReq) (*TestApiOutput, error)
}

func NewTestApiV2JSONClient

func NewTestApiV2JSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) TestApiV2

NewTestApiV2JSONClient creates a JSON client that implements the TestApiV2 interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewTestApiV2ProtobufClient

func NewTestApiV2ProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) TestApiV2

NewTestApiV2ProtobufClient creates a Protobuf client that implements the TestApiV2 interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type TestApiV2Client

type TestApiV2Client interface {
	Version1(ctx context.Context, in *TestReq, opts ...grpc.CallOption) (*TestApiOutput, error)
	VersionTest1(ctx context.Context, in *TestReq, opts ...grpc.CallOption) (*TestApiOutput, error)
}

TestApiV2Client is the client API for TestApiV2 service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewTestApiV2Client

func NewTestApiV2Client(cc grpc.ClientConnInterface) TestApiV2Client

type TestApiV2Server

type TestApiV2Server interface {
	Version1(context.Context, *TestReq) (*TestApiOutput, error)
	VersionTest1(context.Context, *TestReq) (*TestApiOutput, error)
}

TestApiV2Server is the server API for TestApiV2 service. All implementations should embed UnimplementedTestApiV2Server for forward compatibility

type TestReq

type TestReq struct {
	Input   string                         `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"`
	Name    string                         `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Lists   *structpb.ListValue            `protobuf:"bytes,3,opt,name=lists,proto3" json:"lists,omitempty"`
	Headers map[string]*structpb.ListValue `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*TestReq) Descriptor deprecated

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

Deprecated: Use TestReq.ProtoReflect.Descriptor instead.

func (*TestReq) GetHeaders

func (x *TestReq) GetHeaders() map[string]*structpb.ListValue

func (*TestReq) GetInput

func (x *TestReq) GetInput() string

func (*TestReq) GetLists

func (x *TestReq) GetLists() *structpb.ListValue

func (*TestReq) GetName

func (x *TestReq) GetName() string

func (*TestReq) ProtoMessage

func (*TestReq) ProtoMessage()

func (*TestReq) ProtoReflect

func (x *TestReq) ProtoReflect() protoreflect.Message

func (*TestReq) Reset

func (x *TestReq) Reset()

func (*TestReq) String

func (x *TestReq) String() string

type Transport

type Transport interface {
	TestStream(context.Context, *Message) (*Message, error)

	TestStream1(context.Context, *Message) (*Message, error)

	TestStream2(context.Context, *Message) (*Message, error)

	TestStream3(context.Context, *Message) (*Message, error)
}

func NewTransportJSONClient

func NewTransportJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Transport

NewTransportJSONClient creates a JSON client that implements the Transport interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewTransportProtobufClient

func NewTransportProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Transport

NewTransportProtobufClient creates a Protobuf client that implements the Transport interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type TransportClient

type TransportClient interface {
	TestStream(ctx context.Context, opts ...grpc.CallOption) (Transport_TestStreamClient, error)
	TestStream1(ctx context.Context, opts ...grpc.CallOption) (Transport_TestStream1Client, error)
	TestStream2(ctx context.Context, in *Message, opts ...grpc.CallOption) (Transport_TestStream2Client, error)
	TestStream3(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
}

TransportClient is the client API for Transport service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewTransportClient

func NewTransportClient(cc grpc.ClientConnInterface) TransportClient

type TransportServer

type TransportServer interface {
	TestStream(Transport_TestStreamServer) error
	TestStream1(Transport_TestStream1Server) error
	TestStream2(*Message, Transport_TestStream2Server) error
	TestStream3(context.Context, *Message) (*Message, error)
}

TransportServer is the server API for Transport service. All implementations should embed UnimplementedTransportServer for forward compatibility

type Transport_TestStream1Client

type Transport_TestStream1Client interface {
	Send(*Message) error
	CloseAndRecv() (*Message, error)
	grpc.ClientStream
}

type Transport_TestStream1Server

type Transport_TestStream1Server interface {
	SendAndClose(*Message) error
	Recv() (*Message, error)
	grpc.ServerStream
}

type Transport_TestStream2Client

type Transport_TestStream2Client interface {
	Recv() (*Message, error)
	grpc.ClientStream
}

type Transport_TestStream2Server

type Transport_TestStream2Server interface {
	Send(*Message) error
	grpc.ServerStream
}

type Transport_TestStreamClient

type Transport_TestStreamClient interface {
	Send(*Message) error
	Recv() (*Message, error)
	grpc.ClientStream
}

type Transport_TestStreamServer

type Transport_TestStreamServer interface {
	Send(*Message) error
	Recv() (*Message, error)
	grpc.ServerStream
}

type TwirpServer

type TwirpServer interface {
	http.Handler

	// ServiceDescriptor returns gzipped bytes describing the .proto file that
	// this service was generated from. Once unzipped, the bytes can be
	// unmarshalled as a
	// google.golang.org/protobuf/types/descriptorpb.FileDescriptorProto.
	//
	// The returned integer is the index of this particular service within that
	// FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a
	// low-level field, expected to be used for reflection.
	ServiceDescriptor() ([]byte, int)

	// ProtocGenTwirpVersion is the semantic version string of the version of
	// twirp used to generate this file.
	ProtocGenTwirpVersion() string

	// PathPrefix returns the HTTP URL path prefix for all methods handled by this
	// service. This can be used with an HTTP mux to route Twirp requests.
	// The path prefix is in the form: "/<prefix>/<package>.<Service>/"
	// that is, everything in a Twirp route except for the <Method> at the end.
	PathPrefix() string
}

TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.

func NewGreeterServer

func NewGreeterServer(svc Greeter, opts ...interface{}) TwirpServer

NewGreeterServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

func NewTestApiServer

func NewTestApiServer(svc TestApi, opts ...interface{}) TwirpServer

NewTestApiServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

func NewTestApiV2Server

func NewTestApiV2Server(svc TestApiV2, opts ...interface{}) TwirpServer

NewTestApiV2Server builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

func NewTransportServer

func NewTransportServer(svc Transport, opts ...interface{}) TwirpServer

NewTransportServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

func NewUserServiceServer

func NewUserServiceServer(svc UserService, opts ...interface{}) TwirpServer

NewUserServiceServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

type UnimplementedGreeterServer

type UnimplementedGreeterServer struct {
}

UnimplementedGreeterServer should be embedded to have forward compatible implementations.

func (UnimplementedGreeterServer) SayHello

type UnimplementedTestApiServer

type UnimplementedTestApiServer struct {
}

UnimplementedTestApiServer should be embedded to have forward compatible implementations.

func (UnimplementedTestApiServer) Version

func (UnimplementedTestApiServer) Version1

func (UnimplementedTestApiServer) VersionTest

func (UnimplementedTestApiServer) VersionTestCustom

type UnimplementedTestApiV2Server

type UnimplementedTestApiV2Server struct {
}

UnimplementedTestApiV2Server should be embedded to have forward compatible implementations.

func (UnimplementedTestApiV2Server) Version1

func (UnimplementedTestApiV2Server) VersionTest1

type UnimplementedTransportServer

type UnimplementedTransportServer struct {
}

UnimplementedTransportServer should be embedded to have forward compatible implementations.

func (UnimplementedTransportServer) TestStream

func (UnimplementedTransportServer) TestStream1

func (UnimplementedTransportServer) TestStream2

func (UnimplementedTransportServer) TestStream3

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedUserServiceServer) AddUser

func (UnimplementedUserServiceServer) GetUser

func (UnimplementedUserServiceServer) ListUsers

func (UnimplementedUserServiceServer) ListUsersByRole

func (UnimplementedUserServiceServer) UpdateUser

type UnsafeGreeterServer

type UnsafeGreeterServer interface {
	// contains filtered or unexported methods
}

UnsafeGreeterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreeterServer will result in compilation errors.

type UnsafeTestApiServer

type UnsafeTestApiServer interface {
	// contains filtered or unexported methods
}

UnsafeTestApiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TestApiServer will result in compilation errors.

type UnsafeTestApiV2Server

type UnsafeTestApiV2Server interface {
	// contains filtered or unexported methods
}

UnsafeTestApiV2Server may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TestApiV2Server will result in compilation errors.

type UnsafeTransportServer

type UnsafeTransportServer interface {
	// contains filtered or unexported methods
}

UnsafeTransportServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TransportServer will result in compilation errors.

type UnsafeUserServiceServer

type UnsafeUserServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServiceServer will result in compilation errors.

type UpdateUserRequest

type UpdateUserRequest struct {

	// The user resource which replaces the resource on the server.
	User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	// The update mask applies to the resource. For the `FieldMask` definition,
	// see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
	UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateUserRequest) Descriptor deprecated

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

Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.

func (*UpdateUserRequest) GetUpdateMask

func (x *UpdateUserRequest) GetUpdateMask() *fieldmaskpb.FieldMask

func (*UpdateUserRequest) GetUser

func (x *UpdateUserRequest) GetUser() *User

func (*UpdateUserRequest) ProtoMessage

func (*UpdateUserRequest) ProtoMessage()

func (*UpdateUserRequest) ProtoReflect

func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message

func (*UpdateUserRequest) Reset

func (x *UpdateUserRequest) Reset()

func (*UpdateUserRequest) String

func (x *UpdateUserRequest) String() string

type User

type User struct {
	Id         uint32                 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Role       Role                   `protobuf:"varint,2,opt,name=role,proto3,enum=hello.Role" json:"role,omitempty"`
	CreateDate *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_date,json=createDate,proto3" json:"create_date,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetCreateDate

func (x *User) GetCreateDate() *timestamppb.Timestamp

func (*User) GetId

func (x *User) GetId() uint32

func (*User) GetRole

func (x *User) GetRole() Role

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

func (x *User) ProtoReflect() protoreflect.Message

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

type UserRole

type UserRole struct {
	Role    Role                           `protobuf:"varint,1,opt,name=role,proto3,enum=hello.Role" json:"role,omitempty"`
	Lists   *structpb.ListValue            `protobuf:"bytes,2,opt,name=lists,proto3" json:"lists,omitempty"`
	Headers map[string]*structpb.ListValue `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*UserRole) Descriptor deprecated

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

Deprecated: Use UserRole.ProtoReflect.Descriptor instead.

func (*UserRole) GetHeaders

func (x *UserRole) GetHeaders() map[string]*structpb.ListValue

func (*UserRole) GetLists

func (x *UserRole) GetLists() *structpb.ListValue

func (*UserRole) GetRole

func (x *UserRole) GetRole() Role

func (*UserRole) ProtoMessage

func (*UserRole) ProtoMessage()

func (*UserRole) ProtoReflect

func (x *UserRole) ProtoReflect() protoreflect.Message

func (*UserRole) Reset

func (x *UserRole) Reset()

func (*UserRole) String

func (x *UserRole) String() string

type UserService

type UserService interface {
	AddUser(context.Context, *User) (*google_protobuf2.Empty, error)

	GetUser(context.Context, *User) (*google_protobuf2.Empty, error)

	ListUsers(context.Context, *ListUsersRequest) (*User, error)

	ListUsersByRole(context.Context, *UserRole) (*User, error)

	UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
}

func NewUserServiceJSONClient

func NewUserServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) UserService

NewUserServiceJSONClient creates a JSON client that implements the UserService interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewUserServiceProtobufClient

func NewUserServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) UserService

NewUserServiceProtobufClient creates a Protobuf client that implements the UserService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type UserServiceClient

type UserServiceClient interface {
	AddUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*emptypb.Empty, error)
	ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (UserService_ListUsersClient, error)
	ListUsersByRole(ctx context.Context, opts ...grpc.CallOption) (UserService_ListUsersByRoleClient, error)
	UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error)
}

UserServiceClient is the client API for UserService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type UserServiceServer

type UserServiceServer interface {
	AddUser(context.Context, *User) (*emptypb.Empty, error)
	GetUser(context.Context, *User) (*emptypb.Empty, error)
	ListUsers(*ListUsersRequest, UserService_ListUsersServer) error
	ListUsersByRole(UserService_ListUsersByRoleServer) error
	UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
}

UserServiceServer is the server API for UserService service. All implementations should embed UnimplementedUserServiceServer for forward compatibility

type UserService_ListUsersByRoleClient

type UserService_ListUsersByRoleClient interface {
	Send(*UserRole) error
	Recv() (*User, error)
	grpc.ClientStream
}

type UserService_ListUsersByRoleServer

type UserService_ListUsersByRoleServer interface {
	Send(*User) error
	Recv() (*UserRole, error)
	grpc.ServerStream
}

type UserService_ListUsersClient

type UserService_ListUsersClient interface {
	Recv() (*User, error)
	grpc.ClientStream
}

type UserService_ListUsersServer

type UserService_ListUsersServer interface {
	Send(*User) error
	grpc.ServerStream
}

Jump to

Keyboard shortcuts

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