example

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 9 Imported by: 0

README

the following command when ran from the root of this project can be used to generate the code and files in this directory

# generates grpc-go, go proto code and goo generated code, can also include -go-goo_opt=

go install . && \
	protoc -I=example \
	--go-goo_out=example \
	--go-goo_opt=tests=true,server=true,connectGo=false,generatedPath=github.com/lcmaguire/protoc-gen-go-goo/example \
	--go-grpc_out=example \
	--go-grpc_opt=paths=source_relative \
	--go_out=example  \
	--go_opt=paths=source_relative \
	example/*.proto 

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExampleService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tutorial.ExampleService",
	HandlerType: (*ExampleServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateExample",
			Handler:    _ExampleService_CreateExample_Handler,
		},
		{
			MethodName: "GetExample",
			Handler:    _ExampleService_GetExample_Handler,
		},
		{
			MethodName: "ListExamples",
			Handler:    _ExampleService_ListExamples_Handler,
		},
		{
			MethodName: "UpdateExample",
			Handler:    _ExampleService_UpdateExample_Handler,
		},
		{
			MethodName: "DeleteExample",
			Handler:    _ExampleService_DeleteExample_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "example.proto",
}

ExampleService_ServiceDesc is the grpc.ServiceDesc for ExampleService 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 File_example_proto protoreflect.FileDescriptor

Functions

func RegisterExampleServiceServer

func RegisterExampleServiceServer(s grpc.ServiceRegistrar, srv ExampleServiceServer)

Types

type ExampleServiceClient

type ExampleServiceClient interface {
	CreateExample(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
	GetExample(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
	ListExamples(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
	UpdateExample(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
	DeleteExample(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

ExampleServiceClient is the client API for ExampleService 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 ExampleServiceServer

type ExampleServiceServer interface {
	CreateExample(context.Context, *SearchRequest) (*SearchResponse, error)
	GetExample(context.Context, *SearchRequest) (*SearchResponse, error)
	ListExamples(context.Context, *SearchRequest) (*SearchResponse, error)
	UpdateExample(context.Context, *SearchRequest) (*SearchResponse, error)
	DeleteExample(context.Context, *SearchRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

ExampleServiceServer is the server API for ExampleService service. All implementations must embed UnimplementedExampleServiceServer for forward compatibility

type SearchRequest

type SearchRequest struct {
	Name        string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchRequest) Descriptor deprecated

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

Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.

func (*SearchRequest) GetDisplayName

func (x *SearchRequest) GetDisplayName() string

func (*SearchRequest) GetName

func (x *SearchRequest) GetName() string

func (*SearchRequest) ProtoMessage

func (*SearchRequest) ProtoMessage()

func (*SearchRequest) ProtoReflect

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

func (*SearchRequest) Reset

func (x *SearchRequest) Reset()

func (*SearchRequest) String

func (x *SearchRequest) String() string

type SearchResponse

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

func (*SearchResponse) Descriptor deprecated

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

Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead.

func (*SearchResponse) GetName

func (x *SearchResponse) GetName() string

func (*SearchResponse) ProtoMessage

func (*SearchResponse) ProtoMessage()

func (*SearchResponse) ProtoReflect

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

func (*SearchResponse) Reset

func (x *SearchResponse) Reset()

func (*SearchResponse) String

func (x *SearchResponse) String() string

type UnimplementedExampleServiceServer

type UnimplementedExampleServiceServer struct {
}

UnimplementedExampleServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedExampleServiceServer) CreateExample

func (UnimplementedExampleServiceServer) DeleteExample added in v0.1.5

func (UnimplementedExampleServiceServer) GetExample

func (UnimplementedExampleServiceServer) ListExamples

func (UnimplementedExampleServiceServer) UpdateExample added in v0.1.5

type UnsafeExampleServiceServer

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

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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