grpc

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultModelService_ReadDefaultModel_FullMethodName = "/grpc.DefaultModelService/ReadDefaultModel"
)

Variables

View Source
var DefaultModelService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.DefaultModelService",
	HandlerType: (*DefaultModelServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ReadDefaultModel",
			Handler:    _DefaultModelService_ReadDefaultModel_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "default_model_gen.proto",
}

DefaultModelService_ServiceDesc is the grpc.ServiceDesc for DefaultModelService 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_default_model_gen_proto protoreflect.FileDescriptor
View Source
var Module = fx.Module(
	"grpc",
	fx.Provide(
		New,
	),
	fx.Invoke(
		func(
			impl *DefaultModelServiceImpl,
			logger *zap.Logger,
			grpcCfg config.GRPC,
		) {
			srv := grpc.NewServer()
			RegisterDefaultModelServiceServer(srv, impl)
			listener, err := net.Listen("tcp", grpcCfg.HTTP.Addr+":"+grpcCfg.HTTP.Port)
			if err != nil {
				logger.Fatal("failed to listen", zap.Error(err))
			}
			err = srv.Serve(listener)
		},
	),
)

Functions

func RegisterDefaultModelServiceServer

func RegisterDefaultModelServiceServer(s grpc.ServiceRegistrar, srv DefaultModelServiceServer)

Types

type DefaultModel

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

func NewDefaultModel

func NewDefaultModel(v service.DefaultModel) DefaultModel

func (*DefaultModel) Descriptor deprecated

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

Deprecated: Use DefaultModel.ProtoReflect.Descriptor instead.

func (*DefaultModel) GetID

func (x *DefaultModel) GetID() string

func (*DefaultModel) GetName

func (x *DefaultModel) GetName() string

func (*DefaultModel) ProtoMessage

func (*DefaultModel) ProtoMessage()

func (*DefaultModel) ProtoReflect

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

func (*DefaultModel) Reset

func (x *DefaultModel) Reset()

func (*DefaultModel) String

func (x *DefaultModel) String() string

type DefaultModelServiceClient

type DefaultModelServiceClient interface {
	ReadDefaultModel(ctx context.Context, in *ReadDefaultModelRequest, opts ...grpc.CallOption) (*DefaultModel, error)
}

DefaultModelServiceClient is the client API for DefaultModelService 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 DefaultModelServiceImpl

type DefaultModelServiceImpl struct {
	UnimplementedDefaultModelServiceServer
	// contains filtered or unexported fields
}

func New

func (*DefaultModelServiceImpl) ReadDefaultModel

type DefaultModelServiceServer

type DefaultModelServiceServer interface {
	ReadDefaultModel(context.Context, *ReadDefaultModelRequest) (*DefaultModel, error)
	// contains filtered or unexported methods
}

DefaultModelServiceServer is the server API for DefaultModelService service. All implementations must embed UnimplementedDefaultModelServiceServer for forward compatibility

type ReadDefaultModelRequest

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

func (*ReadDefaultModelRequest) Descriptor deprecated

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

Deprecated: Use ReadDefaultModelRequest.ProtoReflect.Descriptor instead.

func (*ReadDefaultModelRequest) GetID

func (x *ReadDefaultModelRequest) GetID() string

func (*ReadDefaultModelRequest) ProtoMessage

func (*ReadDefaultModelRequest) ProtoMessage()

func (*ReadDefaultModelRequest) ProtoReflect

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

func (*ReadDefaultModelRequest) Reset

func (x *ReadDefaultModelRequest) Reset()

func (*ReadDefaultModelRequest) String

func (x *ReadDefaultModelRequest) String() string

type ReadManyDefaultModelRequest

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

func (*ReadManyDefaultModelRequest) Descriptor deprecated

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

Deprecated: Use ReadManyDefaultModelRequest.ProtoReflect.Descriptor instead.

func (*ReadManyDefaultModelRequest) GetID

func (*ReadManyDefaultModelRequest) ProtoMessage

func (*ReadManyDefaultModelRequest) ProtoMessage()

func (*ReadManyDefaultModelRequest) ProtoReflect

func (*ReadManyDefaultModelRequest) Reset

func (x *ReadManyDefaultModelRequest) Reset()

func (*ReadManyDefaultModelRequest) String

func (x *ReadManyDefaultModelRequest) String() string

type ReadManyDefaultModelResponse

type ReadManyDefaultModelResponse struct {
	Items *DefaultModel `protobuf:"bytes,1,opt,name=Items,proto3" json:"Items,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadManyDefaultModelResponse) Descriptor deprecated

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

Deprecated: Use ReadManyDefaultModelResponse.ProtoReflect.Descriptor instead.

func (*ReadManyDefaultModelResponse) GetItems

func (*ReadManyDefaultModelResponse) ProtoMessage

func (*ReadManyDefaultModelResponse) ProtoMessage()

func (*ReadManyDefaultModelResponse) ProtoReflect

func (*ReadManyDefaultModelResponse) Reset

func (x *ReadManyDefaultModelResponse) Reset()

func (*ReadManyDefaultModelResponse) String

type UnimplementedDefaultModelServiceServer

type UnimplementedDefaultModelServiceServer struct {
}

UnimplementedDefaultModelServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedDefaultModelServiceServer) ReadDefaultModel

type UnsafeDefaultModelServiceServer

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

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

Jump to

Keyboard shortcuts

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