grpc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const Binding = "goravel.grpc"

Variables

View Source
var (
	ErrInvalidLengthTest        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTest          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTest = fmt.Errorf("proto: unexpected end of group")
)
View Source
var LogFacade log.Log

Functions

func RegisterTestServiceServer

func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(config config.Config) *Application

func (*Application) Client

func (app *Application) Client(ctx context.Context, name string) (*grpc.ClientConn, error)

func (*Application) Run

func (app *Application) Run(host ...string) error

func (*Application) Server

func (app *Application) Server() *grpc.Server

func (*Application) UnaryClientInterceptorGroups

func (app *Application) UnaryClientInterceptorGroups(unaryClientInterceptorGroups map[string][]grpc.UnaryClientInterceptor)

func (*Application) UnaryServerInterceptors

func (app *Application) UnaryServerInterceptors(unaryServerInterceptors []grpc.UnaryServerInterceptor)

type ServiceProvider

type ServiceProvider struct {
}

func (*ServiceProvider) Boot

func (route *ServiceProvider) Boot(app foundation.Application)

func (*ServiceProvider) Register

func (route *ServiceProvider) Register(app foundation.Application)

type TestRequest

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

func (*TestRequest) Descriptor

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

func (*TestRequest) GetName

func (m *TestRequest) GetName() string

func (*TestRequest) Marshal

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

func (*TestRequest) MarshalTo

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

func (*TestRequest) MarshalToSizedBuffer

func (m *TestRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TestRequest) ProtoMessage

func (*TestRequest) ProtoMessage()

func (*TestRequest) Reset

func (m *TestRequest) Reset()

func (*TestRequest) Size

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

func (*TestRequest) String

func (m *TestRequest) String() string

func (*TestRequest) Unmarshal

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

func (*TestRequest) XXX_DiscardUnknown

func (m *TestRequest) XXX_DiscardUnknown()

func (*TestRequest) XXX_Marshal

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

func (*TestRequest) XXX_Merge

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

func (*TestRequest) XXX_Size

func (m *TestRequest) XXX_Size() int

func (*TestRequest) XXX_Unmarshal

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

type TestResponse

type TestResponse struct {
	Code                 int32    `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message              string   `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TestResponse) Descriptor

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

func (*TestResponse) GetCode

func (m *TestResponse) GetCode() int32

func (*TestResponse) GetMessage

func (m *TestResponse) GetMessage() string

func (*TestResponse) Marshal

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

func (*TestResponse) MarshalTo

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

func (*TestResponse) MarshalToSizedBuffer

func (m *TestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TestResponse) ProtoMessage

func (*TestResponse) ProtoMessage()

func (*TestResponse) Reset

func (m *TestResponse) Reset()

func (*TestResponse) Size

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

func (*TestResponse) String

func (m *TestResponse) String() string

func (*TestResponse) Unmarshal

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

func (*TestResponse) XXX_DiscardUnknown

func (m *TestResponse) XXX_DiscardUnknown()

func (*TestResponse) XXX_Marshal

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

func (*TestResponse) XXX_Merge

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

func (*TestResponse) XXX_Size

func (m *TestResponse) XXX_Size() int

func (*TestResponse) XXX_Unmarshal

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

type TestServiceClient

type TestServiceClient interface {
	Get(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error)
}

TestServiceClient is the client API for TestService service.

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

func NewTestServiceClient

func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient

type TestServiceServer

type TestServiceServer interface {
	Get(context.Context, *TestRequest) (*TestResponse, error)
}

TestServiceServer is the server API for TestService service.

type UnimplementedTestServiceServer

type UnimplementedTestServiceServer struct {
}

UnimplementedTestServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedTestServiceServer) Get

Jump to

Keyboard shortcuts

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